OpenBSD PF Internal Interface blocks

Hallo zusammen,

mein erster Post und ich habe folgendes Problem (Heim Router):

es gibt blocks am internen Interface die ich mir nicht ganz erklären kann und bei Online Games treten Probleme auf (IP .154) und bei Win 7 (IP .100) kann ich es nicht verifizieren:

z.B.:

rule 15/(match) block in on bge0: 192.168.1.154.60919 > xxx.xxx.xxx.xxx.443: F 0:0(0) ack 1 win 1040 <nop,nop,timestamp 775541 1159405279> (DF)
rule 15/(match) block in on bge0: 192.168.1.154.53772 > xxx.xxx.xxx.xxx.443: FP 0:138(138) ack 1 win 1040 <nop,nop,timestamp 776749 1876330> (DF)
rule 15/(match) block in on bge0: 192.168.1.154.53770 > xxx.xxx.xxx.xxx.443: F 0:0(0) ack 1 win 1040 <nop,nop,timestamp 777636 1563003619> (DF)
rule 15/(match) block in on bge0: 192.168.1.154.52693 > xxx.xxx.xxx.xxx.443: R 1:1(0) ack 1 win 1040 <nop,nop,timestamp 788500 1563000284> (DF)
rule 15/(match) block in on bge0: 192.168.1.154.55705 > xxx.xxx.xxx.xxx.443: FP 0:53(53) ack 1 win 1040 <nop,nop,timestamp 791223 264936333> (DF)
rule 15/(match) block in on bge0: 192.168.1.154.60919 > xxx.xxx.xxx.xxx.443: R 1:1(0) ack 1 win 1040 <nop,nop,timestamp 791613 1159405279> (DF)
rule 15/(match) block in on bge0: 192.168.1.154.58307 > xxx.xxx.xxx.xxx.443: P 0:698(698) ack 1 win 2048 <nop,nop,timestamp 794561 1562915403> (DF)
rule 15/(match) block in on bge0: 192.168.1.154.53770 > xxx.xxx.xxx.xxx.443: F 0:0(0) ack 1 win 1040 <nop,nop,timestamp 799852 1563003619> (DF)
rule 15/(match) block in on bge0: 192.168.1.154.53772 > xxx.xxx.xxx.xxx.443: R 139:139(0) ack 1 win 1040 <nop,nop,timestamp 809205 1876330> (DF)
rule 15/(match) block in on bge0: 192.168.1.154.53770 > xxx.xxx.xxx.xxx.443: R 1:1(0) ack 1 win 1040 <nop,nop,timestamp 822068 1563003619> (DF)
rule 15/(match) block in on bge0: 192.168.1.154.55705 > xxx.xxx.xxx.xxx.443: FP 0:53(53) ack 1 win 1040 <nop,nop,timestamp 837503 264936333> (DF)
rule 15/(match) block in on bge0: 192.168.1.100.1172 > xxx.xxx.xxx.xxx.993: P 2472746706:2472746780(74) ack 3656043747 win 63662 (DF)
rule 15/(match) block in on bge0: 192.168.1.100.1171 > xxx.xxx.xxx.xxx.993: P 2355912857:2355912931(74) ack 2859586904 win 16324 (DF)
rule 15/(match) block in on bge0: 192.168.1.100.1172 > xxx.xxx.xxx.xxx.993: P 0:74(74) ack 1 win 63662 (DF)
rule 15/(match) block in on bge0: 192.168.1.100.1171 > xxx.xxx.xxx.xxx.993: P 0:74(74) ack 1 win 16324 (DF)
rule 15/(match) block in on bge0: 192.168.1.100.1172 > xxx.xxx.xxx.xxx.993: P 0:74(74) ack 1 win 63662 (DF)
rule 15/(match) block in on bge0: 192.168.1.100.1171 > xxx.xxx.xxx.xxx.993: P 0:74(74) ack 1 win 16324 (DF)
rule 15/(match) block in on bge0: 192.168.1.100.1172 > xxx.xxx.xxx.xxx.993: P 0:74(74) ack 1 win 63662
rule 15/(match) block in on bge0: 192.168.1.100.1171 > xxx.xxx.xxx.xxx.993: P 0:74(74) ack 1 win 16324
rule 15/(match) block in on bge0: 192.168.1.100.1172 > xxx.xxx.xxx.xxx.993: P 0:74(74) ack 1 win 63662
rule 15/(match) block in on bge0: 192.168.1.100.1171 > xxx.xxx.xxx.xxx.993: P 0:74(74) ack 1 win 16324
rule 15/(match) block in on bge0: 192.168.1.100.1172 > xxx.xxx.xxx.xxx.993: P 0:74(74) ack 1 win 63662 (DF)
rule 15/(match) block in on bge0: 192.168.1.100.1171 > xxx.xxx.xxx.xxx.993: P 0:74(74) ack 1 win 16324 (DF)
rule 15/(match) block in on bge0: 192.168.1.100.1172 > xxx.xxx.xxx.xxx.993: P 0:74(74) ack 1 win 63662 (DF)
rule 15/(match) block in on bge0: 192.168.1.100.1171 > xxx.xxx.xxx.xxx.993: P 0:74(74) ack 1 win 16324 (DF)
rule 15/(match) block in on bge0: 192.168.1.100.1053 > xxx.xxx.xxx.xxx.993: P 1970024029:1970024066(37) ack 3830708196 win 64340 (DF)
rule 15/(match) block in on bge0: 192.168.1.100.1053 > xxx.xxx.xxx.xxx.993: F 37:37(0) ack 1 win 64340 (DF)
rule 15/(match) block in on bge0: 192.168.1.100.1053 > xxx.xxx.xxx.xxx.993: FP 0:37(37) ack 1 win 64340 (DF)
rule 15/(match) block in on bge0: 192.168.1.100.1172 > xxx.xxx.xxx.xxx.993: P 0:74(74) ack 1 win 63662 (DF)
rule 15/(match) block in on bge0: 192.168.1.100.1171 > xxx.xxx.xxx.xxx.993: P 0:74(74) ack 1 win 16324 (DF)
rule 15/(match) block in on bge0: 192.168.1.100.1053 > xxx.xxx.xxx.xxx.993: FP 0:37(37) ack 1 win 64340 (DF)


.154 Gaming Console, .100 Windows PC, Diese blocks treten auch bei port 80 auf (nicht nur SSL/HTTPS)

pf.conf:


int_if="bge0"
icmp_types = "{ echoreq, unreach }"


table <static> { 192.168.1.154 }
table <nonstatic> { 192.168.1.0/24, !192.168.1.154 }
table <martians> { 255.255.255.255/32 0.0.0.0/8 10.0.0.0/8 127.0.0.0/8 169.254.0.0/16 172.16.0.0/12 192.0.0.0/24 192.0.2.0/24 224.0.0.0/3 192.168.0.0/16 198.18.0.0/15 198.51.100.0/24 203.0.113.0/24 }

set block-policy drop
set loginterface egress
set skip on lo0

match in all scrub (no-df random-id max-mss 1440)
match out on egress inet from <static> to any nat-to egress static-port
match out on egress inet from <nonstatic> to any nat-to egress

antispoof log for { egress $int_if }
block in log quick on egress from urpf-failed
block in log quick on egress from { <martians> no-route } to any
block in log quick inet6 all
block return out log quick inet6 all
block return out log quick on egress from any to { <martians> no-route }
pass in quick on $int_if inet proto tcp to port 21 divert-to 127.0.0.1 port 8021

block log all
#block in log on egress
pass out quick inet
pass in on $int_if inet
#pass log inet proto icmp all icmp-type $icmp_types # ICMP MTU Path discover
anchor "ftp-proxy/*"
anchor "miniupnpd"


/etc/sysctl.conf

net.inet.ip.forwarding=1 # 1=Permit forwarding (routing) of IPv4 packets
net.inet.tcp.mssdflt=1440 # MSS MTU



pfctl -sr
match in all scrub (no-df random-id max-mss 1440)
match out on egress inet from <static> to any nat-to xxx.xxx.xxx.xxx static-port
match out on egress inet from <nonstatic> to any nat-to xxx.xxx.xxx.xxx
block drop in log on ! egress inet from xxx.xxx.xxx.xxx/xx to any
block drop in log inet from xxx.xxx.xxx.xxx to any
block drop in log on ! bge0 inet from 192.168.1.0/24 to any
block drop in log inet from 192.168.1.1 to any
block drop in log quick on egress from urpf-failed to any
block drop in log quick on egress from <martians> to any
block drop in log quick on egress from no-route to any
block drop in log quick inet6 all
block return out log quick inet6 all
block return out log quick on egress from any to <martians>
block return out log quick on egress from any to no-route
pass in quick on bge0 inet proto tcp from any to any port = 21 flags S/SA divert-to 127.0.0.1 port 8021
block drop log all
pass out quick inet all flags S/SA
pass in on bge0 inet all flags S/SA
anchor "ftp-proxy/*" all
anchor "miniupnpd" all


Ich weis wenn ich "block log all" in "block in log on egress" umforme verschwinden diese blocks, nur bricht das nicht allgemeine Firewall regeln (Immer als erster block all egal von welchen Device und Richtung) ? Am anfang war meine Vermutung das Traffic shaping nicht correct verläuft, das war aber nicht das Problem bzw. MTU Path discover.

Ich habe eine vermutung das dies Keep Alive Messages sind und pf diese blockiert ...

Wie kann ich diese Problem lösen ? ohne die block all regel zu verlieren ...

Danke für Eure Hilfe im Vorraus

Wie gesagt das ist mein erstes Forum, ich versuche mal Hilfestellungen zu Themen zu geben mein Hauptgebiet sind Databases, TCP/IP und Firewalls bin ich eher noch nicht so fit. und wie ich sehe ist es gerade sehr spät von der Zeit her...

PS: eine weiter Frage: Weiß jemand was genau im no-route darin steht oder wie man diesen listen kann ?
 
In den gezeigten blocks ist nicht ein S/SA packet, was mich annehmen laesst, dass Du direkt nach einem reload (pfctl -f) schaust.
Zu dem Moment gibt es keine state-table und so "Nachzuegler" (F, FP, ..) werden geblockt, weil sie nicht auf die rule mit 'flags S/SA' matchen.

In 'no-route' steht das, was in dem Moment nicht geroutet werden kann (netstat -rn) -- da Du sehr wahrscheinlich eine default-route hast, wird Dir diese rule nichts bringen.
Das gilt in dem Fall auch fuer den URPF check (auf egress); jedwege source-ip-address matched eine default route.
 
hi

du mach ein "block log all" ohne angabe der interfaces somit block er traffic auf allen interfaces !

erweitere die

set skip on lo0 auf

set skip on { lo0 , bge0 }

dann sollte nicht mehr geblockt werden auf dem interen interface .

holger
 
Danke für Hilfe,

double-p du hast recht wegen pfctl -f nur das ganze ist auch nach dem frischen einschalten aller Geräte, ....

werde dies mittels set skip ... exkludieren , weiters was ich nicht ganz verstehe ist folgendes:

xxx.xxx.xxx.xxx WAN IP

rule 10/(match) block out on em0: xxx.xxx.xxx.xxx.9306 > 192.168.0.10.9306: udp 94
rule 10/(match) block out on em0: xxx.xxx.xxx.xxx.9306 > 192.168.0.10.9306: udp 94
rule 10/(match) block out on em0: xxx.xxx.xxx.xxx.9306 > 192.168.0.10.9306: udp 94
rule 10/(match) block out on em0: xxx.xxx.xxx.xxx.9306 > 192.168.0.10.9306: udp 94
rule 10/(match) block out on em0: xxx.xxx.xxx.xxx.9305 > 192.168.2.105.9305: udp 94
rule 10/(match) block out on em0: xxx.xxx.xxx.xxx.9305 > 192.168.2.106.9305: udp 94
rule 10/(match) block out on em0: xxx.xxx.xxx.xxx.9305 > 192.168.2.105.9305: udp 94
rule 10/(match) block out on em0: xxx.xxx.xxx.xxx.9305 > 192.168.2.106.9305: udp 94
rule 10/(match) block out on em0: xxx.xxx.xxx.xxx.9305 > 192.168.2.105.9305: udp 94
rule 10/(match) block out on em0: xxx.xxx.xxx.xxx.9305 > 192.168.2.106.9305: udp 94
rule 10/(match) block out on em0: xxx.xxx.xxx.xxx.9305 > 192.168.178.20.59603: udp 94
rule 10/(match) block out on em0: xxx.xxx.xxx.xxx.9305 > 192.168.178.20.59603: udp 94
rule 10/(match) block out on em0: xxx.xxx.xxx.xxx.9305 > 192.168.178.20.59603: udp 94
rule 10/(match) block out on em0: xxx.xxx.xxx.xxx.9305 > 192.168.178.20.59603: udp 94
rule 10/(match) block out on em0: xxx.xxx.xxx.xxx.9305 > 192.168.178.20.59603: udp 94
rule 10/(match) block out on em0: xxx.xxx.xxx.xxx.9305 > 192.168.178.20.59603: udp 94
rule 10/(match) block out on em0: xxx.xxx.xxx.xxx.9305 > 192.168.178.20.59603: udp 94
rule 10/(match) block out on em0: xxx.xxx.xxx.xxx.9305 > 192.168.178.20.59603: udp 94
rule 10/(match) block out on em0: xxx.xxx.xxx.xxx.9305 > 192.168.178.20.59603: udp 94


pass in quick on egress inet proto udp from any to any port = 9308 label "192.168.1.154:9308 to 9308 (UDP)" rdr-to 192.168.1.154 port 9308
pass in quick on egress inet proto udp from any to any port = 9306 label "192.168.1.154:9306 to 9306 (UDP)" rdr-to 192.168.1.154 port 9306
pass in quick on egress inet proto udp from any to any port = 9305 label "192.168.1.154:9305 to 9305 (UDP)" rdr-to 192.168.1.154 port 9305


Diese Rule Blockiert
block return out log quick on egress from any to <martians>

.154 gaming console

Ich kann nur vermuten das dies eine Art Tunnel ist ...

Danke für eure Hilfe.

Mit freundlichen Grüßen
 
weiters ist mir aufgefallen wenn ich set skip on { lo0 , bge0 }, verliere ich den ftp proxy bzw auch miniupnpd ... es bleibt anscheinend nichts mehr übrig als statt block log all
block in log on egress
zu verwenden, außerdem hatte ich noch einen fehler ftp-proxy und miniupnpd müssen/sollten nach der NAT Regel stehen.

int_if="bge0"
localnet = $int_if:network
icmp_types = "{ echoreq, unreach }"


table <static> { 192.168.1.154 }
table <nonstatic> { 192.168.1.0/24, !192.168.1.154 }
table <martians> { 255.255.255.255/32 0.0.0.0/8 10.0.0.0/8 127.0.0.0/8 169.254.0.0/16 172.16.0.0/12 192.0.0.0/24 192.0.2.0/24 224.0.0.0/3 192.168.0.0/16 198.18.0.0/15 198.51.100.0/24 203.0.113.0/24 }


set block-policy drop
set loginterface egress
#set skip on { lo0, bge0 }
set skip on lo0


match in all scrub (no-df random-id max-mss 1440)
match out on egress inet from <static> to any nat-to egress static-port
match out on egress inet from <nonstatic> to any nat-to egress


anchor "ftp-proxy/*"
pass in quick on $int_if inet proto tcp to port 21 divert-to 127.0.0.1 port 8021

anchor "miniupnpd"


antispoof log quick for { egress $int_if }
#block in log quick on egress from urpf-failed


block in log quick on egress from { <martians> } to any
block in log quick inet6 all
block return out log quick inet6 all
#block return out log quick on egress from any to { <martians> }


#block log all
block in log on egress
pass out quick inet
pass in on $int_if inet


#pass log inet proto icmp all icmp-type $icmp_types # ICMP MTU Path discover


ich habe schon leichte Kopfschmerzen bei dem Thema ...

Mit freundlichen Grüßen

Bitte um Überprüfung ob ich hier etwas falsch mache ...

Ich bin gewohnt das bei einer FW, alles zuerst blockiert (block log all) wird und nicht explizit block in log on egress .
 
Wenn du ein Firewall-Anfänger bist, dann solltest du definitiv deine Regeln überdenken. Lass mal die ganzen Optionen weg und geh das Thema nochmal so einfach wie möglich an. Bau was einfaches, das funktioniert und dann kannst du das Feintuning machen. Deine tables sind mir irgendwie schleierhaft. Was bezweckst du damit? Warum machst du statisches Mapping auf dem NAT? (Mit Spielkonsolen kenne ich mich nicht aus)
Ich würde an deiner Stelle so vorgehen.
1. Interface definieren
2. Scrub in all ( ohne Optionen )
3. match-Regel für NAT ohne Schnickschnack
4. blog in all
5. pass in quick on $int_if all
6. pass out on $ext_if all modulate state
 
Hi,

ohne static-port bekommen leider die gameing konsolen nur NAT TYPE 3 zustande, warum auch immer, Sie wollen keine Random Ports. (habe dies auch mit und ohne static Probiert, kein erfolg). Mir kommt es vor als ob TCP Keepalive messages irgendwann geblockt werden ..., kann dies nicht verifizieren.

Thx for help will try ...and give you answer
 
ext_if = "em0"
int_if = "bge0"
localnet = $int_if:network
match out on $ext_if inet from $localnet nat-to $ext_if
block log all
pass from { self, $localnet }


tauchte bei dieser Regel auch auf ...

Simpler geht es glaube ich nicht mehr ...

pflog
block in on bge0 .....
 
hat leider auch nichts gebracht. alle Netzwerk Komponenten ca. 10 min ausgeschaltet ( ich weis modular-state ist sehr genau ...)

z.B. win 7 pc Mail Client Thunderbird ...

block in on bge0: 192.168.1.100.1055 > xxx.xxx.xxx.xxx.993: P 397893483:397893520(37) ack 155381307 win 64340 (DF)
block in on bge0: 192.168.1.100.1055 > xxx.xxx.xxx.xxx.993: F 37:37(0) ack 1 win 64340 (DF)
block in on bge0: 192.168.1.100.1056 > xxx.xxx.xxx.xxx.993: P 1288281441:1288281478(37) ack 742179898 win 16440 (DF)
block in on bge0: 192.168.1.100.1056 > xxx.xxx.xxx.xxx.993: F 37:37(0) ack 1 win 16440 (DF)
block in on bge0: 192.168.1.100.1055 > xxx.xxx.xxx.xxx.993: FP 0:37(37) ack 1 win 64340 (DF)
block in on bge0: 192.168.1.100.1056 > xxx.xxx.xxx.xxx.993: FP 0:37(37) ack 1 win 16440 (DF)
block in on bge0: 192.168.1.100.1055 > xxx.xxx.xxx.xxx.993: FP 0:37(37) ack 1 win 64340 (DF)
block in on bge0: 192.168.1.100.1056 > xxx.xxx.xxx.xxx.993: FP 0:37(37) ack 1 win 16440 (DF)
block in on bge0: 192.168.1.100.1056 > xxx.xxx.xxx.xxx.993: FP 0:37(37) ack 1 win 16440
block in on bge0: 192.168.1.100.1055 > xxx.xxx.xxx.xxx.993: FP 0:37(37) ack 1 win 64340
block in on bge0: 192.168.1.100.1055 > xxx.xxx.xxx.xxx.993: FP 0:37(37) ack 1 win 64340
block in on bge0: 192.168.1.100.1056 > xxx.xxx.xxx.xxx.993: FP 0:37(37) ack 1 win 16440
block in on bge0: 192.168.1.100.1055 > xxx.xxx.xxx.xxx.993: FP 0:37(37) ack 1 win 64340 (DF)
block in on bge0: 192.168.1.100.1056 > xxx.xxx.xxx.xxx.993: FP 0:37(37) ack 1 win 16440 (DF)
block in on bge0: 192.168.1.100.1055 > xxx.xxx.xxx.xxx.993: FP 0:37(37) ack 1 win 64340 (DF)
block in on bge0: 192.168.1.100.1056 > xxx.xxx.xxx.xxx.993: FP 0:37(37) ack 1 win 16440 (DF)
block in on bge0: 192.168.1.100.1055 > xxx.xxx.xxx.xxx.993: FP 0:37(37) ack 1 win 64340 (DF)
block in on bge0: 192.168.1.100.1056 > xxx.xxx.xxx.xxx.993: FP 0:37(37) ack 1 win 16440 (DF)
block in on bge0: 192.168.1.100.1055 > xxx.xxx.xxx.xxx.993: R 38:38(0) ack 1 win 0 (DF)
block in on bge0: 192.168.1.100.1056 > xxx.xxx.xxx.xxx.993: R 38:38(0) ack 1 win 0 (DF)


PS4:
block in on bge0: 192.168.1.154.61180 > xxx.xxx.xxx.xxx.443: P 2537433887:2537433940(53) ack 2878875527 win 1025 <nop,nop,timestamp 3212052 308760991> (DF)
block in on bge0: 192.168.1.154.61180 > xxx.xxx.xxx.xxx.443: F 53:53(0) ack 1 win 1026 <nop,nop,timestamp 3212052 308760991> (DF)
block in on bge0: 192.168.1.154.61180 > xxx.xxx.xxx.xxx.443: FP 0:53(53) ack 1 win 1026 <nop,nop,timestamp 3212475 308760991> (DF)
block in on bge0: 192.168.1.154.61180 > xxx.xxx.xxx.xxx.443: FP 0:53(53) ack 1 win 1026 <nop,nop,timestamp 3213121 308760991> (DF)
block in on bge0: 192.168.1.154.61180 > xxx.xxx.xxx.xxx.443: FP 0:53(53) ack 1 win 1026 <nop,nop,timestamp 3214213 308760991> (DF)
block in on bge0: 192.168.1.154.61180 > xxx.xxx.xxx.xxx.443: FP 0:53(53) ack 1 win 1026 <nop,nop,timestamp 3216197 308760991> (DF)
block in on bge0: 192.168.1.154.61180 > xxx.xxx.xxx.xxx.443: FP 0:53(53) ack 1 win 1026 <nop,nop,timestamp 3219965 308760991> (DF)
block in on bge0: 192.168.1.154.61180 > xxx.xxx.xxx.xxx.443: FP 0:53(53) ack 1 win 1026 <nop,nop,timestamp 3223013 308760991> (DF)
block in on bge0: 192.168.1.154.61180 > xxx.xxx.xxx.xxx.443: FP 0:53(53) ack 1 win 1026 <nop,nop,timestamp 3228909 308760991> (DF)
block in on bge0: 192.168.1.154.61180 > xxx.xxx.xxx.xxx.443: FP 0:53(53) ack 1 win 1026 <nop,nop,timestamp 3240501 308760991> (DF)
block in on bge0: 192.168.1.154.61180 > xxx.xxx.xxx.xxx.443: FP 0:53(53) ack 1 win 1026 <nop,nop,timestamp 3263485 308760991> (DF)
block in on bge0: 192.168.1.154.61180 > xxx.xxx.xxx.xxx.443: FP 0:53(53) ack 1 win 1026 <nop,nop,timestamp 3309253 308760991> (DF)
block in on bge0: 192.168.1.154.61180 > xxx.xxx.xxx.xxx.443: FP 0:53(53) ack 1 win 1026 <nop,nop,timestamp 3355021 308760991> (DF)
block in on bge0: 192.168.1.154.61180 > xxx.xxx.xxx.xxx.443: FP 0:53(53) ack 1 win 1026 <nop,nop,timestamp 3400789 308760991> (DF)
block in on bge0: 192.168.1.154.61180 > xxx.xxx.xxx.xxx.443: R 54:54(0) ack 1 win 1026 <nop,nop,timestamp 3446557 308760991> (DF)


es ist immer die block all regel die zuschlägt

mir fällt es nur beim online zocken von der Playstation aus (3 oder 4 macht keinen unterschied, bin kein COD Player, bei Dark Souls und Konsorten merkt man das was nicht stimmt )

ich weiß nur das eine Art Faustregel bei Firewalls gibt nämlich block all und wenn dies auf block in on egress gesetzt kommt mir das sehr komisch vor.

ich mag keinen billig Router mehr verwenden da man kein log sieht ... usw... ich glaube das ist jedem klar.

Deto gilt das für die billigste Fortigate (diese macht aber block all). ich zahl mich da blöde für privat Nutzung und fürs echte log da muss zusätzliches Paket kaufen, ... wozu ?

interessant wäre ob diese Sachen auch bei einem anderen auftauchen ...

ich benutze deswegen 2 Tables weil ich oft zocker Besuch habe ... sprich mehrere Konsolen online ... deswegen eigener NAT mittells match out und mit strict-port (nur nat type 2); ohne strict-port NAT Type 3


ich hab es schon mit der simpelsten Rule probiert

ist aus dem PF Book:

ext_if = "em0"
int_if = "bge0"
localnet = $int_if:network
match out on $ext_if inet from $localnet nat-to $ext_if
block log all
pass from { self, $localnet }


oder der aus dem Wiki https://en.wikipedia.org/wiki/PF_(firewall)

## Macros

# The internal interface (connected to the local network).
int_if="xl0"

## Options

# Set the default policy to return RSTs or ICMPs for blocked traffic.
set block-policy return

# Ignore the loopback interface entirely.
set skip on lo0

## Translation rules

# NAT traffic on the interface in the default egress interface group (to
# which the interface out of which the default route goes is assigned) from the
# local network.
match out on egress from $int_if:network to any nat-to (egress)

## Filtering rules

# Default deny rule, with all blocked packets logged.
block log all

# Pass all traffic to and from the local network, using quick so that later
# rules are not evaluated if a packet matches this. Some rulesets would restrict
# local traffic much further.
pass quick on $int_if all

# Permit all traffic going out, keep state so that replies are automatically passed;
# many rulesets would have many rules here, restricting traffic in and out on the
# external (egress) interface. (keep state is not needed in the newest version of pf)
pass out keep state


das ganze passiert nicht sofort sondern nach ca 10 min. Als ob irgendwas auslaufen würde. ich vermute noch immer dass TCP keep alive hinter dem ganzen steckt.

Nur kann ich noch nicht einen fully TCPDump lesen dazu fehlt mir noch das hirnschmalz ... (lesen schon mittels Wireshark ... nur interpretieren was da genau passiert ...)
bin gerade dabei dies aufzubessern nur ... dieses Thema ist big.

ich bin schon ganz auf eine simple PF Conf (siehe oben) bei der sache, nur werden immer wieder Packete verworfen die meiner Meinung nach wichtig sind, man merkts beim online zocken extrem ... und zwar wenn diese TCP packete geblockt werden

mir kommen die squenz numbern komisch vor ... es sind immer deselben als ob pro verschiedene Server eigene Sequenz number als TCP keepalive akzeptiert werden ....

set optimization

brachte auch nichts ...

entweder schließt eine TCP idle connection und deswegen gibts die blocks (wäre logisch), da sie nicht mehr im state vorhanden sind für pf oder es handelt sich um TCP keepalive (ich denke mal in 10 min wird da öfters Keep Alive gemacht ...)

Ich probiers mal mit komplett Satelit betrieb aber davon rate ich ab, da hier wirklich alle tcp channel up beiben, wahrscheinlich bis alles voll ist ...

net.inet.tcp.always_keepalive=1

set optimization high-latency

modulate state hab ich auchg schon probiert bei pass in und bei pass out ...

THX for your Help again ...

Ich komme da nicht weiter ...


kann dies jemand bei seiner FW überprüfen ! Nach vollziehbar ist es am einfachsten mittels EMail-Client (Thunderbird), WLAN Handy/Tablet oder einer PS3/PS4.

dachte am Anfang ist es nur auf 443 oder 993 (HTTPS/SSL) bezogen, war auch schon bei port 80. Dies tritt bei den oben anführten simpelst pf Konfigs auch auf.

Das muss doch schon wem aufgefallen sein ? die Logs müssten voll sein damit ... Bin da schon seit dem OpenBSD 5 Releases auf der Spur.

Bin froh dass ich mit Leuten darüber reden kann, denn die Windows Server Leute kucken dich nur blöd an bei solchen fragen (was soll ich zum Windows Server DNS Dienst noch sagen so etwas hat man noch nicht gesehen ... Simpelst, gegenüber bind9 ist das ja ein Scherz was da Win an Einstellmöglichkeiten anbietet )

THX Nochmal für eure Hilfe

Schon wieder mal 3 Uhr früh ...
 
hi

du solltes keine gruppen nutzen !
schau mal welche interfaces bei ifconfig egress auftauchen.
arbeite explizit

z..b
pass in on $lan_if from $local_net to any nat-to ($pppoe_if)

deine
pass quick on $lan_if ist das gleiche als wenn du das if in set skip packst.
nutze erstmal nur ein
block log on $pppoe_if

das musst du dich nicht um soviel andere blocks kümmern.

nutze pass statt match , es ist einfacher .... mit first match , statt last match zu arbeiten.

holger
 
Wenn so blocks im log auftauchen mal einen 'pfctl -vv -ss' (und das log). Beim anonymisieren bitte die ip-addr unterscheiden, mit "allem" auf XXX ist das nicht so prall.
 
Code:
############
## Macros ##
############

ext_if  = "em0"
int_if  = "bge0"
lan_net = "192.168.1.0/24"
icmp_types = "{ echoreq, unreach }"


############
## Tables ##
############

# Gameing Consoles, wich need static-port NAT translation
table <static> { 192.168.1.150, 192.168.1.151 192.168.1.152 192.168.1.153 192.168.1.154 192.168.1.155 }

# Non Gameing Consoles, rest needs normal NAT Translation
table <nonstatic> { 192.168.1.0/24, !192.168.1.150 !192.168.1.151 !192.168.1.152 !192.168.1.153 !192.168.1.154, !192.168.1.155 }


#####################
## Runtime Options ##
#####################

set block-policy return
set loginterface egress

# don't filter on the loopback interface
set skip on lo0


################################
## NAT / Packet Normalization ##
################################

# Packet Normalization
match in all scrub (no-df random-id max-mss 1440)

# NAT for Gameing Consoles
match out on egress inet from <static> to any nat-to egress static-port

# NAT for Non Gameing Consoles
match out on egress inet from <nonstatic> to any nat-to egress


##############################################################
## Important Rules for Services (FTP Proxy, Miniupnpd, ...) ##
##############################################################

# BOOTTP
pass in quick on $int_if inet proto udp to port 67

# FTP Proxy (Client)
anchor "ftp-proxy/*"
pass in quick on $int_if inet proto tcp to port 21 divert-to 127.0.0.1 port 8021

#MINIUPNPD Broadcast
pass out quick on $int_if inet to 224.0.0.2
pass out quick on $int_if inet to 239.255.255.250
pass out quick on $int_if inet proto udp from 192.168.1.1 to 239.255.255.250 port 1900

# MINIUPNPD
anchor "miniupnpd"


###########################################
## MAIN: Important rule block log all !! ##
###########################################

# setup a default deny policy
block log all

# activate spoofing protection for all interfaces
block in log quick from urpf-failed
antispoof log quick for any


#############################################
## Important, pass in and pass out pair !! ##
#############################################

# pass all traffic to and from the local network.
# these rules will create state entries due to the default
# "keep state" option which will automatically be applied.
# allow-opts for BOOTTP, IGMP and multicast
pass in  on $int_if inet from $lan_net
pass out on $int_if inet to $lan_net

############################
## Important, pass out !! ##
############################

# pass tcp, udp, and icmp out on the external (Internet) interface.
# tcp connections will be modulated, udp/icmp will be tracked
# statefully.
pass out on $ext_if inet proto { tcp udp icmp } all modulate state

# ICMP MTU Path discover
#pass in log on $ext_if inet proto icmp all icmp-type $icmp_types

Die Vermutung war schon richtig das pf den state nicht hat ...

Wichtig sind diese 3 pass regeln nach block log all

Code:
block log all
pass in  on $int_if inet from $lan_net
pass out on $int_if inet to $lan_net
pass out on $ext_if inet proto { tcp udp icmp } all modulate state

jetzt funktioniert es wie geschmiert

Folgendes ist noch zu beachten:

Code:
# BOOTTP
pass in quick on $int_if inet proto udp to port 67

#MINIUPNPD Broadcast
pass out quick on $int_if inet to 224.0.0.2
pass out quick on $int_if inet to 239.255.255.250
pass out quick on $int_if inet proto udp from 192.168.1.1 to 239.255.255.250 port 1900

da BOOTTP (DHCPD Daemon) von 0.0.0.0 zu 255.255.255.255 (da die pass regeln strickt nur localnet erlauben) muss eine Regel gemacht werden um diese zuzulassen.

Dasselbe gilt auch für Miniupnpd

werde das mal weiter austesten ... sieht aber besser aus als alles andere ... läuft schon seit längerem. normalerweise ging das log schon über von int_if blocks
 
bin schon drauf gekommen: mittels
Code:
 systat state
oder
Code:
 pftop
sieht man wunderbar FIN_WAIT_2:FIN_WAIT_2.
a ich den icmp total abgedreht habe und mit
Code:
 set block policy drop
auch keinen "Rückantwort" generiere, haben sich Connections nicht schließen können.
Dummer Anfänger Fehler.

Mit freundlichen Grüßen

Danke double-p mit
Code:
 pfctl -vv -ss

Das merke ich mir mein leben lang ....
 
Hi,

hab es schon raus gefunden, und zwar macht pf genau das wozu er da ist.

folgenden des passiert: der block passiert wenn tcp connection auf FIN_WAIT_2:FIN_WAIT_2 steht, da im diesem zustand soundso nichts mehr durchkommt ..., ist klar dass pf das Packet blockiert.

bitte um Bestätigung ob ich damit richtig liege
 
Hi hab raus gefunden was hier los war ...

2 mal nat auf eine ip geht nicht ...

match out on egress inet from <static> to any nat-to egress static-port
match out on egress inet from <nonstatic> to any nat-to egress

ist ja klar ...

Mfg
 
pfctl -vvnf /etc/pf.conf
Gibt einen sehr schön sortierten Output, wie deine Regeln der Reihe nach abgearbeitet werden, nur so als Tipp
 
Zurück
Oben