From b6aeee483f45f5e69f050b2d287d06c8eaf0ca40 Mon Sep 17 00:00:00 2001 From: Ahmed AbdelHalim Date: Thu, 9 Jul 2026 15:38:15 +0200 Subject: Fix IPv6 direct mode routing for LAN clients - Remove static network_ipv6_gateway from LAN hosts so they pick up Pi's radvd RA (pref high) instead of FritzBox (pref low) - Add missing ip6tables FORWARD ACCEPT rule for new connections in direct mode (only ESTABLISHED was present, blocking new flows) - Flush ip6tables nat POSTROUTING table on clear instead of fragile per-rule -D deletion to prevent stale rule accumulation --- host_vars/desktop.local.yml | Bin 868 -> 818 bytes host_vars/laptop.local.yml | Bin 899 -> 849 bytes host_vars/macbook.local.yml | Bin 903 -> 853 bytes host_vars/pve.local.yml | Bin 517 -> 467 bytes roles/gateway/templates/gateway-apply-rules.sh.j2 | 4 ++-- 5 files changed, 2 insertions(+), 2 deletions(-) diff --git a/host_vars/desktop.local.yml b/host_vars/desktop.local.yml index 7670b16c..9abcecf7 100644 Binary files a/host_vars/desktop.local.yml and b/host_vars/desktop.local.yml differ diff --git a/host_vars/laptop.local.yml b/host_vars/laptop.local.yml index d41000db..18eabeb7 100644 Binary files a/host_vars/laptop.local.yml and b/host_vars/laptop.local.yml differ diff --git a/host_vars/macbook.local.yml b/host_vars/macbook.local.yml index 84de35b2..0d1f1561 100644 Binary files a/host_vars/macbook.local.yml and b/host_vars/macbook.local.yml differ diff --git a/host_vars/pve.local.yml b/host_vars/pve.local.yml index cba94054..6b2e4ba1 100644 Binary files a/host_vars/pve.local.yml and b/host_vars/pve.local.yml differ diff --git a/roles/gateway/templates/gateway-apply-rules.sh.j2 b/roles/gateway/templates/gateway-apply-rules.sh.j2 index daddb180..0cbdd67a 100644 --- a/roles/gateway/templates/gateway-apply-rules.sh.j2 +++ b/roles/gateway/templates/gateway-apply-rules.sh.j2 @@ -27,8 +27,7 @@ clear_rules() { iptables -D OUTPUT -o "$GATEWAY_INTERFACE" -j ACCEPT 2>/dev/null || true if [ -n "$GATEWAY_SUBNET_V6" ]; then ip6tables -F FORWARD 2>/dev/null || true - ip6tables -t nat -D POSTROUTING -o wg+ -j MASQUERADE 2>/dev/null || true - ip6tables -t nat -D POSTROUTING -o "$GATEWAY_INTERFACE" -j MASQUERADE 2>/dev/null || true + ip6tables -t nat -F POSTROUTING 2>/dev/null || true ip6tables -D OUTPUT -o wg+ -j ACCEPT 2>/dev/null || true ip6tables -D OUTPUT -o "$GATEWAY_INTERFACE" -j ACCEPT 2>/dev/null || true fi @@ -59,6 +58,7 @@ apply_direct_rules() { if [ -n "$GATEWAY_SUBNET_V6" ]; then ip6tables -t nat -A POSTROUTING -o "$GATEWAY_INTERFACE" -j MASQUERADE ip6tables -A OUTPUT -o "$GATEWAY_INTERFACE" -j ACCEPT + ip6tables -A FORWARD -s "$GATEWAY_SUBNET_V6" -i "$GATEWAY_INTERFACE" -o "$GATEWAY_INTERFACE" -j ACCEPT ip6tables -A FORWARD -i "$GATEWAY_INTERFACE" -o "$GATEWAY_INTERFACE" -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT fi log_message "Direct mode rules applied - normal routing active" -- cgit v1.2.3