Ребята, вопрос таков, стал тут изучать pf и что-то немного вошел в ступор. Задача:
сделать чтобы из локалки можно было достучаться до VPN-сервера посредством PPTP (по сути это нужно только для одного из компов из локалки - 192.168.11.249), при этом выход в интернет напрямую для всех остальных должен быть перекрыт (т,к. стоит squid)
Изначально у меня было вот такое правило ната:
Код: Выделить всё
nat on $ext_if_main from $int_if:network to any port {ntp, nntp, domain } -> $ext_if_mainКод: Выделить всё
nat on $ext_if_main from $int_if:network to any -> $ext_if_mainПодскажите, что подправить, чтоб впн из локалки был доступен (хотя бы одному компу из локалки, для него даже если необходимо пусть и инет будет напрямую), а для всех остальных выход напрямую в инет был бы закрыт. Вот мои правила:
Код: Выделить всё
int_if="igb0"
ext_if_main="igb2"
ext_if_rezerv="igb3"
vpn_if="tun0"
allowed_icmp_types="{ echoreq, unreach}"
lan_sklad="192.168.11.0/24"
lan_office="192.168.10.0/24"
table <BRUTEFORCERS> persist
set block-policy return
set skip on lo0 # ?? ????????? ?? lo0
set timeout { frag 10, tcp.established 3600 }
scrub in all
#nat on $ext_if_main from $int_if:network to any port {ntp, nntp, domain } -> $ext_if_main
#nat on $ext_if_main proto gre from $int_if:network to any -> $ext_if_main
nat on $ext_if_main from $int_if:network to any -> $ext_if_main
pass in on $int_if proto tcp from $int_if:network to $int_if port ssh queue ( qssh, qack ) synproxy state ( max-src-conn-rate 1/60, overload <BRUTEFORCERS> flush global )
block on $ext_if_main proto tcp from any to $ext_if_main port ssh
block on $ext_if_main proto tcp from any to $ext_if_main port 139
block on $ext_if_main proto tcp from any to $ext_if_main port 3551
block on $ext_if_main proto tcp from any to $ext_if_main port 445
pass in quick on $ext_if_main proto { tcp, udp } from any to self port 1723
pass in on $int_if proto udp from $int_if:network to any port ntp queue qntp keep state
pass in on $int_if proto tcp from $int_if:network to any port 993
pass in on $int_if proto tcp from $int_if:network to any port 465
pass in on $int_if proto tcp from $int_if:network to any port 8081
pass in on $int_if proto tcp from 192.168.11.249 to any
pass in on $int_if proto udp from 192.168.11.249 to any
block on $int_if proto tcp from $int_if:network to any port www
pass in on $ext_if_main proto tcp from 192.168.11.249 to any port www keep state
pass in on $int_if proto udp from $int_if:network to any port domain queue qdns keep state
pass proto gre from any to any keep state
pass out on $ext_if_main proto udp from $ext_if_main to any port ntp keep state queue qntp
pass out on $ext_if_main proto tcp from $ext_if_main to any port www modulate state
pass out on $ext_if_main proto udp from $ext_if_main to any port domain keep state queue qdns
block out on $ext_if_main proto tcp from $int_if:network to any port www
pass out on $ext_if_main from 192.168.11.249 to any keep state
pass in on $int_if from any to any keep state
pass out on $int_if from any to any keep state
pass log inet proto icmp all icmp-type $allowed_icmp_types
