(pf-)Firewall restart beendet bereits laufende Verbindungen

apriori

New Member
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
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
 
Nein, denn beim Neustart (des Rechners) wird die State Table gekillt. Da bei "...keep state" Regeln mittlerweile (AFAIK) implizit auch "flags S/SA" angenommen wird, werden nur durch die Pakete, die den TCP Handshake übernehmen States angelegt.
 
Was meinst Du denn mit Neustart? Das Neueinlesen einer Änderung an der Konfiguration? Dazu ist eingentlich nur "pfctl -f /etc/pf.conf" notwendig. Wenn Du bestehende Verbindungen "killen" oder den State Table leeren willst, mußt Du das explizit mit angeben (-F). Ein Aus- und Wiedereinschalten (pfctl -d bzw. -e) ist nicht notwendig.
 
Achso.. muss man auch erstmal wissen. Nein, ich wollte eben nicht, dass die States gekillt werden, ich wollte nur, dass beim Ändern und Neuladen der Firewall nicht alle laufenden Verbindungen unterbrochen werden.
Ich danke euch ;)
 
Nein, denn beim Neustart (des Rechners) wird die State Table gekillt. Da bei "...keep state" Regeln mittlerweile (AFAIK) implizit auch "flags S/SA" angenommen wird, werden nur durch die Pakete, die den TCP Handshake übernehmen States angelegt.

das ist momentan aber nur in -current, oder mittlerweile -beta. im aktuellen -release oder -stable ist dies noch nicht der fall.
 
4.1-beta... das ist der status vor -release, also prinzipiell -current, nur eben nicht mehr 4.0-current sondern eben 4.1-beta
 
Zurück
Oben