Hallo Liste,
ich hab da ein merkwürdiges Problem mit ppp.linkup und pf-Regeln.
Zu Hause hab ich ein kleines LAN welches ich mit einem
OpenBSD-Router/Firewall ins Internet bringe. Der Router wählt sich beim
Hochfahren automatisch per ppp ins Internet ein. Anschliessend soll er
per ppp.linkup den Packetfilter aktivieren. In meiner ppp.linkup Datei
steht folgendes:
MYADDR:
! sh -c "/sbin/ifconfig pflog0 up"
! sh -c "/sbin/pflogd"
! sh -c "/sbin/pfctl -e"
! sh -c "/sbin/pfctl -F all"
! sh -c "/sbin/pfctl -f /etc/pf.conf"
Das hat bisher auch immer funktioniert. Jetzt wollte ich noch ein paar
altq Regeln in meine pf.conf aufnehmen und seit dem werden die Regeln
(siehe weiter unten) nicht mehr eingelesen. /var/log/daemon.log zeigt
an, dass alle Befehle in ppp.linkup ausgeführt werden. Ich erhalte auch
nirgends eine Fehlermeldung. :( Nehme ich alles betreffs altq aus
pf.conf funktioniert es wieder.
Ausserdem kann ich die Regeln manuell laden, d.h. ich tippe 'pfctl
-f /etc/pf.conf' selbst ein.
Was mache ich falsch?
Dankbar für jede Antwort
Holger
Ach ja meine pf.conf:
######################################################
# Variablen/Makros
######################################################
intranet="192.168.100.0/24"
extdev="tun0"
intdev="dc0"
loop="lo0"
TCPservices="{pop3,pop3s,http,https,smtp,ftp,>1024,pop3s,ssh,ntp,rsync,nntp,whois,imaps,imap2}"
UDPservices="{domain,>1024,ntp,imaps,imap2}"
TCPin="{http,ident}"
GameDest="{27015}"
GameSrc="{27000:27050}"
######################################################
# options
######################################################
set loginterface tun0
set optimization aggressive
######################################################
#normalization
######################################################
scrub in all no-df
scrub out all random-id no-df
scrub reassemble tcp
######################################################
# Bandwidth control
######################################################
altq on $extdev priq queue { pri_high, pri_low }
queue pri_high priority 15
queue pri_low priq(default)
######################################################
# nat from dc0 to tun0
######################################################
nat on tun0 from 192.168.100.0/24 to any -> tun0
rdr on tun0 proto { tcp, udp } from any to any port 8436 ->
192.168.100.5 port 8436
rdr on tun0 proto { tcp, udp } from any to any port 6346 ->
192.168.100.5 port 6436
######################################################
# filter
######################################################
# standardmaessig alles blocken
block in log on $extdev all
block out log on $extdev all
block return-rst out on $extdev proto tcp all
block return-rst in log on $extdev proto tcp all
block return-icmp out on $extdev proto udp all
block return-icmp in log on $extdev proto udp all
# IPv6 blocken
block in quick inet6 all
block out quick inet6 all
# alles !192.168.100.xxx blocken
block out log quick on rl0 from !192.168.100.0/24 to any
# loopback
pass in quick on $loop all
pass out quick on $loop all
# ip spoofing ausblocken
block in log quick on $extdev from no-route to any
block in log quick on $extdev from any to no-route
# Falsche FLAGS blocken
block in log quick on $extdev inet proto tcp from any to any flags
FUP/FUP
block in log quick on $extdev inet proto tcp from any to any flags
SF/SFRA
block in log quick on $extdev inet proto tcp from any to any
flags /SFRA
# ICMP
pass out log quick on $extdev inet proto icmp all icmp-type 8 code 0
keep state pass in log quick on $extdev inet proto icmp all icmp-type 8
code 0 keep state
# Services inbound
pass in log quick on $extdev inet proto tcp from any to any port $TCPin
keep state
# Games bevorzugen
pass out log quick on $extdev proto tcp from any to any port $GameDest
modulate state queue pri_high label "Game"
pass out log quick on $extdev proto udp from any to any port $GameDest
keep state label "Game"
pass out log quick on $extdev proto tcp from any port $GameSrc to any
modulate state queue pri_high label "Game"
pass out log quick on $extdev proto udp from any port $GameSrc to any
keep state queue pri_high label "Game"
# der Rest
pass out log quick on $extdev proto tcp from any to any port
$TCPservices flags S/SA modulate state queue pri_low label "Normal TCP"
pass out log quick on $extdev proto udp from any to any port
$UDPservices \
keep state queue pri_low label "Normal UDP"
To Unsubscribe: send mail to majordomo(at)de.FreeBSD.org
with "unsubscribe de-bsd-questions" in the body of the message
Received on Sat 27 Nov 2004 - 13:44:43 CET