Nach Update funktioniert pf nicht mehr richtig

PaulAtreides

Well-Known Member
Hallo,

nach einem Upgrade von 6.5 auf 6.6 funktioniert meine firewall nicht mehr richtig.
Beim einem Neustart werden all DNS Anfragen blockiert. Erst wenn ich pfctl -ef /etc/pf.conf ausführe funktioniert alles wieder

Hat jemand eine Idee?
 
Nein. Es sieht so aus das es wohl doch nicht an einem Neustart liegt.
Sobald ich ifconfig pppoe0 down und dann wieder up ausführe verhaspelt sich das System.
Code:
ext_if = "pppoe0"
int_if = "em0"
voip_if = "vlan200"
localnet = "{10.0.30.0/24, 10.0.20.0/24}"

match out on egress inet from $localnet nat-to (egress:0)
 
pf aktualisiert die ip von pppoe0 nicht mehr.

ifconfig pppoe0 down
ifconfig pppoe0 up

pfctl -s rules zeigt meine vorherige IP an und nicht die neue
 
Ist das die komplette pf.conf? Denn pfctl zeigt überhaupt keine IP-Adressen an, wenn man () benutzt.
 
Mit wenig OBSD Praxis.
Auf FBSD allerdings hatte ein Eintrag in ppp.linkup für die Reinitialisierung der aktuellen IP gesorgt, nachdem pf schneller war als ppp.
In der Art:
Code:
MYADDR:
   !bg /sbin/pfctl -f /etc/pf.conf
man ppp(8), eventuell vorhandene ppp.linkup Beschreibung oder ppp.linkup.sample scripte suchen.
hth
 
hi

was sagt er denn wenn du

ifconfig egress

machst

ich würde ja eher sagen

match out on egress inet from $localnet nat-to (pppoe0:0)


holger
 
Hier noch einmal ausführlich. Voip habe ich weggelassen.


# DEFAULT OPTIONS
#################

set block-policy drop
set loginterface $ext_if
set skip on lo0

#################
# NAT
#################

match in all scrub (no-df max-mss 1440)
match out on $ext_if inet from $localnet nat-to ($ext_if)
match out on $ext_if inet from $voipnet nat-to ($ext_if) static-port

#################
# ANTISPOOOF
#################

antispoof for $ext_if
antispoof for $int_if

block in quick on $ext_if from <martians> to any
block return out quick on $ext_if from any to <martians>

#################
# DEFAULT BLOCK
#################

block log all
pass from self

##################
# ALLOWED NETWORK SERVICES LAN
##################

tcp_services = "{ ftp-data, ftp, ssh, smtp, smtps, domain, pop3, auth, http, https, pop3s, imap, imaps, 6667 }"
udp_services = "{ domain, ntp }"

pass proto tcp from $localnet to port $tcp_services
pass quick proto { tcp, udp } from $localnet to port $udp_services

# FTP Proxy
anchor "ftp-proxy/*"
pass in quick inet proto tcp from $localnet to port ftp divert-to 127.0.0.1 port 8021

##################
# ICMP
##################

icmp_types = "{ echoreq, unreach }"

pass log inet proto icmp icmp-type $icmp_types

##################
# LOCALHOST SERVER
##################

local_tcp_server = "{ ssh }"
local_udp_server = "{ domain, ntp }"

pass in on $int_if proto tcp from $localnet to port $local_tcp_server
pass in on $int_if proto udp from $localnet to port $local_udp_server


Folgender Bereich wird nicht aktualisiert

#################
# ANTISPOOOF
#################

antispoof for $ext_if
antispoof for $int_if

block in quick on $ext_if from <martians> to any
block return out quick on $ext_if from any to <martians>

#################
# DEFAULT BLOCK
#################

block log all
pass from self

block drop in on ! pppoe0 inet from 87.157.XX.XX to any
block drop in inet from 87.157.XX.XX to any
block drop in on ! em0 inet from 192.168.176.0/24 to any
block drop in inet from 192.168.176.2 to any
block drop in on ! vlan200 inet from 10.0.200.0/24 to any
block drop in inet from 10.0.200.1 to any

pass inet from 127.0.0.1 to any flags S/SA
pass inet from 192.168.176.2 to any flags S/SA
pass inet from 87.157.XX.XX to any flags S/SA
pass inet from 10.0.200.1 to any flags S/SA
 
Das Keyword antispoof ist halt nur ein Hilfsmechanismus, der zu einem Satz Regeln ausgefaltet wird. Du musst dir einfach nur die erzeugten Regeln schnappen, an den richtigen Stellen statt Adressen geklammerte Interfacenamen schreiben und die antispoof-Regeln durch sie ersetzen.
 
antispoof sollte man nut im wan nutzen, ansonsten funktioniert dieses "keyword" gut

scrub ist auch nicht mehr nötig , wenn man den kernel pppoe nutzt siehe man page in kombination mit mtu

zum testen mal alles nach den nat regeln auskommentieren / loeschen

holger
 
Zurück
Oben