pf - Herrgottkruzifixnochamal osä

Chefkoch

Active Member
Hallo,

ich kriegs nicht hin. Was ist falsch an dieser pf.conf :confused: :
Code:
#pf.conf
#

#Abkuerzungen
ext_if="vr0"
int_if="rl0"
lan="192.168.0.0/16"

#Optionen
set loginterface $ext_if
set block-policy drop

#scrub fuer alle
scrub in all

#NAT 
nat on $ext_if from $lan to any -> ($ext_if) static-port

#erstmal wird alles geblockt
block in all
block out all

#Loopbackinterface darf immer und ueberall
pass quick on lo0 all

#spoofing Schutz
antispoof quick for $int_if inet

#Local Network
pass in on $int_if from $lan to any
pass out on $int_if from any to $lan

#tcp, udp und icmp durch das externe (internet) interface rauslassen
pass out on $ext_if proto tcp from $int_if to any modulate state flags S/SA
pass out on $ext_if proto { udp, icmp } all keep state

Wenn pf damit aktiv ist, geht nix mehr.
Das ganze passiert auf einer FBSD6 Installation die als Router über ppp ins www geht.

Machen soll er erstmal nur alles blocken was rein will aber Surfen und pingen bitte schön ermöglichen. Zum Ports für mldonkey öffnen kommen wir dann später.
Und btw, ich hatte vorher nen Fli4l, der hat in der Standard Konfiguration die Ports 53 und 113, also DNS und auth, geöffnet. Tut sowas Not?

Was ist also falsch an der Datei. Und ja, die pf faq kenne ich, aus der ist das ja abgetippt. Gesucht habe ich auch schon. Und probieren tu ich schon seit Freitag abend.:mad:

Chefkoch
 
Und wo wir gerade dabei sind:

Wenn du den PF direkt beim booten startest und ein Regelwerk mit tun0 hast wird das wohl nicht klappen. Der Aufbau der Internetverbindung dauert "länger".

Ich würde sagen, du hast zwei Möglichkeiten:
1. Du startest den PF beim booten mit einem Regelwerk ohne tun0 und lädst eine pf.conf mit tun0, mit /etc/ppp/ppp.linkup

2. Du startest den PF nicht beim booten (rc.conf bzw. rc.conf.local) sondern du startest ihn mit /etc/ppp/ppp.linkup (dann mußt du aber ggf. noch zusätzlich den pflogd mit der ppp.linkkup starten, der wird beim rc.conf start automatisch mit gestartet)

Zitiert aus http://www.bsdforen.de/showthread.php?t=9631&highlight=pf.conf

Hat sich da was geändert? Also gibt es inzwischen noch eine dritte Möglichkeit?
 
das erfuellt deine anforderungen:



ext_if="vr0"
int_if="rl0"

scrub in
block in
pass out keep state
antispoof quick for { lo $ext_if $int_if }
pass on lo0 all
pass on enc0 all
pass in on $int_if proto tcp to ($int_if) port ssh keep state
 
rogx schrieb:
das erfuellt deine anforderungen:
ext_if="vr0"
int_if="rl0"

scrub in
block in
pass out keep state
antispoof quick for { lo $ext_if $int_if }
pass on lo0 all
pass on enc0 all
pass in on $int_if proto tcp to ($int_if) port ssh keep state

Nach einem man enc, weiß ich jetzt, dass das was mit Verschlüsselung zu tun hat. Braucht man(n) soetwas, weil in /dev hab ich des net.

SSH? Die Kiste steht nen Meter neben mir, brauch ich derzeit nicht!
NAT? Wäre glaub ich hilfreich, sonst habe ich die ganze Netzwerkgeschichte immer noch nicht gerafft und ich werde mir umgehend ein CB Abo besorgen...

Und btw funktioniert mit der Konfiguration auch nix!


Wenn Du ppp machst - wieso ist Dein $ext_if NICHT tun0 ???

Macht das einen Unterschied? Bei meiner derzeitigen conf nicht!

Aber was ist denn jetzt an meiner derzeitigen conf falsch?
Kann es sein dass ich an irgendeiner anderen Stelle außer der pf.conf einen Fehler drin habe?
Zum Beispiel im Kernel was vergessen habe?

Dort habe ich zusätzlich für pf folgendes reingetan:
Code:
options NETGRAPH
options NETGRAPH_SOCKET
options NETGRAPH_PPPOE
options NETGRAPH_ETHER
options INET6

In der rc.conf sieht es so aus:
Code:
gateway_enable="YES"
inetd_enable="YES"
keymap="german.cp850"
usbd_enable="YES"
ifconfig_vr0="up"
ifconfig_rl0="inet 192.168.16.254  netmask 255.255.255.0"
defaultrouter="127.0.0.1"
hostname="BSDBox.herkendorf.lan"

#-----DNS---------
named_enable="YES"
named_flags="-u bind"
#--------------------

#----PPPoE-------
#ifconfig_vr0="up"
ppp_enable="YES"
ppp_mode="ddial"
ppp_profile="default"
#--------------------

#Firewall PF
pf_enable="YES"
pf_rules="/etc/pf.conf"
pf_flags=""
pflog_enable="YES"
pflog_logfile="/var/log/pflog"
pflog_flags=""
#-------------

Muss ich sonst noch in irgendeiner anderen .conf Datei was aktivieren?
 
Code:
rl0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
	options=8<VLAN_MTU>
	inet6 fe80::230:84ff:fe2d:5e77%rl0 prefixlen 64 scopeid 0x1 
	inet 192.168.16.254 netmask 0xffffff00 broadcast 192.168.16.255
	ether 00:30:84:2d:5e:77
	media: Ethernet autoselect (100baseTX <full-duplex>)
	status: active
vr0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
	inet6 fe80::205:5dff:fea2:203a%vr0 prefixlen 64 scopeid 0x2 
	ether 00:05:5d:a2:20:3a
	media: Ethernet autoselect (100baseTX <full-duplex>)
	status: active
plip0: flags=108810<POINTOPOINT,SIMPLEX,MULTICAST,NEEDSGIANT> mtu 1500
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
	inet6 ::1 prefixlen 128 
	inet6 fe80::1%lo0 prefixlen 64 scopeid 0x4 
	inet 127.0.0.1 netmask 0xff000000 
tun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1492
	inet 84.131.244.18 --> 217.0.116.121 netmask 0xffffffff 
	Opened by PID 214
pflog0: flags=141<UP,RUNNING,PROMISC> mtu 33208
 
ext_if="tun0"

Das setzt Du in die pf.conf von rogx ein (statt ext_if="vr0") und Du bist online!
 
hab leider gerade keine zeit, das ganze detailliert durchzuschauen, aber teste doch mal, ob du wenigstens vom router aus nach draußen kommst oder ob einfach das nat nicht funktioniert.
versuche auch mal, ($ext_if) durch ($ext_if:0) zu ersetzen
edit: natürlich muss das ext_if tun0 sein, wie mein vorredner richtig erkannt hat
 
Code:
pf.conf
#

#Abkuerzungen
ext_if="tun0"
int_if="rl0"
lan="192.168.16.0/16"

#Optionen
set loginterface $ext_if
set block-policy drop

#scrub fuer alle
scrub in all

#NAT 
nat on $ext_if from $lan to any -> ($ext_if)

#erstmal wird alles geblockt
block in log all
#block out all

#Loopbackinterface darf immer und ueberall
pass quick on lo0 all

#spoofing Schutz
antispoof quick for { lo $ext_if $int_if } inet

#Local Network
pass in on $int_if from $lan to any
pass out on $int_if from any to $lan

#ping aktzeptieren
pass in quick on $ext_if inet proto icmp all icmp-type 8 code 0 keep state

#tcp, udp und icmp durch das externe (internet) interface rauslassen
pass out on $ext_if proto tcp from $int_if to any modulate state flags S/SA
pass out on $ext_if proto { udp, icmp } all keep state

#mldonkey on localhost
pass in on $ext_if inet proto tcp from any to any port 7854 keep state
pass in on $ext_if inet proto udp from any to any port 7858 keep state

Das funktioniert jetzt, nachdem ich mal den Onboard Sound von der Kiste in den Kernel kompiliert habe. Hat bestimmt nichts miteinander zu tun aber...

Jetzt möchte der blöde Esel zwar noch nicht zu einem Server verbinden, störrisches Vieh ;), aber auch das wird schon noch.

Ist bei den oben genannten Regeln viel Schwachsinn enthalten?

Erstmal Danke an alle die geholfen haben...

Chefkoch
 
Zurück
Oben