pbtraveller
Well-Known Member
Hi,
ich habe eine APU2 mit Freebsd 14.1 als router. Die Kiste ist über pppoe mit dem Internet verbunden, d.h. tun0 ist das Wan interface. Die übrigen sind per bridge0 für das LAN zusammengefasst. An dem LAN hängt ein anderer Rechner (ebenfalls freebsd 14.1) auf dem eine Jail mit meiner Nextcloud läuft.
Leider habe ich irgend ein Fehler in der Firewall und stehe gerade auf dem Schlauch.
Das portforwarding (rdr) funktioniert. Wenn ich das "block all" rausnehme, komme ich von außen auf Nextcloud. Gleiches gilt, wenn ich ein pass in on $wan ganz am Ende hinzufüge, d.h. alles auf $wan reinlasse. Es muss also mit meiner section "Allow incoming WAN traffic for port-forwarded services (SSH, HTTPS, HTTP)" zu tun haben. Was mache ich falsch? Hier der Auszug der pf.conf
wan = "tun0" # WAN interface (PPPoE)
lan = "bridge0" # LAN interface (bridge)
ssh_port = "22" # Port for SSH
jail_ip = "192.168.1.28" # Jail IP address
server_big = "192.168.1.2" # Big server IP
# --- Normalization and State Keeping ---
set skip on lo0 # Skip filtering on loopback interface
scrub in all
# --- NAT ---
# Enable NAT for LAN devices going out on WAN interface
nat on $wan from $lan:network to any -> ($wan)
# SSH Port Forwarding (Forward SSH traffic to server_big)
rdr on $wan proto tcp from any to $wan port $ssh_port -> $server_big port $ssh_port
# HTTPS and HTTP Port Forwarding (Forward to jail)
rdr on $wan proto tcp from any to $wan port 443 -> $jail_ip port 443
rdr on $wan proto tcp from any to $wan port 80 -> $jail_ip port 80
# --- Rules ---
# Block all by default
block all
# Allow traffic on the loopback interface (already skipped)
pass quick on lo0
# Allow outgoing traffic from LAN to any
pass out on $lan from $lan:network to any keep state
# Allow incoming WAN traffic for port-forwarded services (SSH, HTTPS, HTTP)
pass in on $wan proto tcp from any to $wan port $ssh_port keep state
pass in on $wan proto tcp from any to $wan port 443 keep state
pass in on $wan proto tcp from any to $wan port 80 keep state
# --- Allow Port-Forwarded Traffic to Reach Internal Jail ---
# Allow forwarded traffic on LAN to reach jail IP on port 443 and 80
pass in on $lan proto tcp from any to $jail_ip port {80, 443} keep state
# --- FaceTime Related Rules ---
# Allow Apple Push Notification (APNs) for FaceTime signaling
pass in on $wan proto tcp from any to $wan port 5223 keep state
# Allow STUN/TURN for FaceTime (UDP 3478-3497)
pass in on $wan proto udp from any to $wan port 3478:3497 keep state
# Allow RTP media streaming for FaceTime (UDP 16384-16387 and 16393-16402)
pass in on $wan proto udp from any to $wan port 16384:16387 keep state
pass in on $wan proto udp from any to $wan port 16393:16402 keep state
# Allow incoming traffic on LAN
pass in on $lan keep state
# --- Pass out ---
# Allow established and related connections for outgoing traffic
pass out on $wan proto { tcp, udp, icmp } all keep state
Vielen Dank und viele Grüße
pbtraveller
ich habe eine APU2 mit Freebsd 14.1 als router. Die Kiste ist über pppoe mit dem Internet verbunden, d.h. tun0 ist das Wan interface. Die übrigen sind per bridge0 für das LAN zusammengefasst. An dem LAN hängt ein anderer Rechner (ebenfalls freebsd 14.1) auf dem eine Jail mit meiner Nextcloud läuft.
Leider habe ich irgend ein Fehler in der Firewall und stehe gerade auf dem Schlauch.
Das portforwarding (rdr) funktioniert. Wenn ich das "block all" rausnehme, komme ich von außen auf Nextcloud. Gleiches gilt, wenn ich ein pass in on $wan ganz am Ende hinzufüge, d.h. alles auf $wan reinlasse. Es muss also mit meiner section "Allow incoming WAN traffic for port-forwarded services (SSH, HTTPS, HTTP)" zu tun haben. Was mache ich falsch? Hier der Auszug der pf.conf
wan = "tun0" # WAN interface (PPPoE)
lan = "bridge0" # LAN interface (bridge)
ssh_port = "22" # Port for SSH
jail_ip = "192.168.1.28" # Jail IP address
server_big = "192.168.1.2" # Big server IP
# --- Normalization and State Keeping ---
set skip on lo0 # Skip filtering on loopback interface
scrub in all
# --- NAT ---
# Enable NAT for LAN devices going out on WAN interface
nat on $wan from $lan:network to any -> ($wan)
# SSH Port Forwarding (Forward SSH traffic to server_big)
rdr on $wan proto tcp from any to $wan port $ssh_port -> $server_big port $ssh_port
# HTTPS and HTTP Port Forwarding (Forward to jail)
rdr on $wan proto tcp from any to $wan port 443 -> $jail_ip port 443
rdr on $wan proto tcp from any to $wan port 80 -> $jail_ip port 80
# --- Rules ---
# Block all by default
block all
# Allow traffic on the loopback interface (already skipped)
pass quick on lo0
# Allow outgoing traffic from LAN to any
pass out on $lan from $lan:network to any keep state
# Allow incoming WAN traffic for port-forwarded services (SSH, HTTPS, HTTP)
pass in on $wan proto tcp from any to $wan port $ssh_port keep state
pass in on $wan proto tcp from any to $wan port 443 keep state
pass in on $wan proto tcp from any to $wan port 80 keep state
# --- Allow Port-Forwarded Traffic to Reach Internal Jail ---
# Allow forwarded traffic on LAN to reach jail IP on port 443 and 80
pass in on $lan proto tcp from any to $jail_ip port {80, 443} keep state
# --- FaceTime Related Rules ---
# Allow Apple Push Notification (APNs) for FaceTime signaling
pass in on $wan proto tcp from any to $wan port 5223 keep state
# Allow STUN/TURN for FaceTime (UDP 3478-3497)
pass in on $wan proto udp from any to $wan port 3478:3497 keep state
# Allow RTP media streaming for FaceTime (UDP 16384-16387 and 16393-16402)
pass in on $wan proto udp from any to $wan port 16384:16387 keep state
pass in on $wan proto udp from any to $wan port 16393:16402 keep state
# Allow incoming traffic on LAN
pass in on $lan keep state
# --- Pass out ---
# Allow established and related connections for outgoing traffic
pass out on $wan proto { tcp, udp, icmp } all keep state
Vielen Dank und viele Grüße
pbtraveller