pf.conf um Erreichbarkeit per IPv6 erweitern

chbus.ch

New Member
Hallo,

ich habe in den letzten Wochen viel zum Thema pf, NAT, Routine und Firewall gelesen und mir eine zumindest für IPv4 funktionierende pf.conf zusammen geschraubt.

Ich habe eine IPv4-Adresse und ein /64-v6-Netz. Das System läuft auf 9.2 und ich habe verschiedene Jails laufen. Die v4-Adresse wird an ein Internes Netz auf lo0 weitergeNATed. Das funktioniert auch alles tadellos.

Jede Jail hat eine öffentliche v6-Adresse. Meine spannende Frage ist jetzt folgende. Was muss ich in meiner pf.conf ändern, damit die Ports entsprechenden Ports per v6 erreichbar werden?

Ich habe in den vergangenen Tage viel rumprobiert, aber nichts hat wirklich funktioniert. Die Informationen im Netz sind von unterschiedlichsten Versionsständen und IPv6 und v4 habe ich irgendwie nirgends gefunden.

Habt Ihr Tipps, wo ich anfangen könnte?

Anbei meine pf.conf.

Code:
ext_if = "re0"

table <rfc1918> persist { 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 224.0.0.0/5 }
table <bruteforce> persist

icmp_types = "{ echoreq, unreach }"
open_tcp = "{ 22, 25, 80, 110, 143, 443, 64738, 60000, 5222, 5269, 4190 }"
open_udp = "{ 22, 80 }"

jails = "{ 10.0.0.0/8 }"

ext_ip = 148.251.3.226

db = 10.0.0.3
db_ports = "{ }"
db6 = 2a01:4f8:201:53e1::3

www = 10.0.0.4
www_ports = "{ 80, 443, 21 , 30000:50000 }"
www6 = 2a01:4f8:201:53e1::4

mumble = 10.0.0.7
mumble_ports = "{ 64738}"
mumble6 = 2a01:4f8:201:53e1::7

mail = 10.0.0.5
mail_ports = "{ 25, 110, 143, 60000, 5222, 5269, 4190 }"
mail6 = 2a01:4f8:201:53e1::5

set block-policy return
set skip on lo0
set timeout { interval 10, frag 30 }
set timeout { tcp.first 120, tcp.opening 30, tcp.established 86400 }
set timeout { tcp.closing 900, tcp.finwait 45, tcp.closed 90 }
set timeout { udp.first 60, udp.single 30, udp.multiple 60 }
set timeout { icmp.first 20, icmp.error 10 }
set timeout { other.first 60, other.single 30, other.multiple 60 }
set timeout { adaptive.start 0, adaptive.end 0 }
set limit { states 10000, frags 5000 }
set loginterface re0
set optimization normal
set require-order yes
set fingerprints "/etc/pf.os"
set ruleset-optimization basic

scrub in all fragment reassemble random-id

rdr on $ext_if proto tcp from any to $ext_if port { 80, 443 } -> $www
rdr on $ext_if proto udp from any to $ext_if port { 80 } -> $www
rdr on $ext_if proto tcp from any to $ext_if port { 25, 110, 143, 60000, 5222, 5269, 4190 } -> $mail
rdr on $ext_if proto tcp from any to $ext_if port { 64738 } -> $mumble

nat on $ext_if proto {tcp udp icmp} from $jails to any -> $ext_ip

block log all
block return
block in quick on $ext_if inet from <rfc1918> to any
antispoof quick for $ext_if


pass quick proto { tcp, udp } from any to any port ssh \
        flags S/SA keep state \
        (max-src-conn 15, max-src-conn-rate 5/3, \
        overload <bruteforce> flush global)

pass inet proto tcp from any to $www port $www_ports \
  flags S/SA synproxy state

pass inet6 proto tcp from any to $www6 port $www_ports \
  flags S/SA synproxy state

pass in on $ext_if proto tcp from any to any port $open_tcp keep state
pass in on $ext_if proto udp from any to any port $open_udp keep state
pass out log on $ext_if inet proto tcp from $mail to any port 25 flags S/SA synproxy state
pass out quick all keep state
pass in on $ext_if inet proto icmp all icmp-type $icmp_types keep state
pass in on $ext_if inet proto udp from any to any port 33433 >< 33626 keep state

Vielen Dank und liebe Grüße
Chris
 
Zurück
Oben