Hallo allerseits!
Ich bin noch recht unerfahren was das einrichten eins FreeBSD-Routers angeht und hätte da eine Frage bezüglich der pf-Firewall, welche ich verwende. Von meinem damaligen Gentoo-Setup (iptables-firewall) war ich es gewohnt, dass bereits erstellte Verbindungen auch den Neustart der Firewall auf dem Router überleben -bei pf scheint das anders zu sein. Gibt es dafür eine Lösung?
Es folgt die gekürze pf.conf
Ich bin noch recht unerfahren was das einrichten eins FreeBSD-Routers angeht und hätte da eine Frage bezüglich der pf-Firewall, welche ich verwende. Von meinem damaligen Gentoo-Setup (iptables-firewall) war ich es gewohnt, dass bereits erstellte Verbindungen auch den Neustart der Firewall auf dem Router überleben -bei pf scheint das anders zu sein. Gibt es dafür eine Lösung?
Es folgt die gekürze pf.conf
Code:
ext_if="tun0" # replace with actual external interface name i.e., dc0
int_if="rl0" # replace with actual internal interface name i.e., dc1
internal_net="192.168.0.0/16"
scrub out on tun0 no-df random-id min-ttl 24 max-mss 1452
nat pass on $ext_if from $int_if:network to any -> ($ext_if)
nat pass on rl1 from $int_if:network to any -> (rl1)
#make modem accessible
pass out quick on rl1 from $internal_net to any keep state
#first block all
block all
#leave lo completely unfiltered
pass in quick on lo0 all
pass out quick on lo0 all
#ssh
pass in quick on $int_if proto tcp from any to any port 22 keep state
#domain
pass in quick on $int_if proto udp from any to any port 53 keep state
pass in quick on $int_if proto tcp from any to any port 53 keep state
#proxy
pass in quick on $int_if proto tcp from any to any port 8080 keep state
pass in quick on $int_if proto tcp from any to any port 443 keep state
#apache2
pass in quick on $ext_if proto tcp from any to any port 80 keep state
#dhcp
pass in quick on $ext_if proto udp from any to any port 67 keep state
#nfs
pass in quick on $int_if proto {tcp, udp} from any to any port nfsd keep state
#icmp
pass in quick on $ext_if proto icmp keep state
pass in quick on $int_if proto icmp keep state
#allow routed machines to connect to the internet
pass out on $ext_if from $int_if:network to any keep state
pass in on $ext_if from $int_if:network to any keep state
pass in on $int_if from $internal_net to !$internal_net keep state
#allow local machine to connect everywhere
pass out on $ext_if all keep state
pass out on $int_if all keep state
#antisppof
antispoof for $ext_if
antispoof for $int_if
antispoof for tap0