From f19d161abc06053d0d7c692b8fd2676b66558e5a Mon Sep 17 00:00:00 2001 From: Jack Ivanov Date: Sat, 18 Apr 2020 19:51:33 +0300 Subject: [PATCH] ipv6 nat fix --- roles/common/templates/rules.v6.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/common/templates/rules.v6.j2 b/roles/common/templates/rules.v6.j2 index 3753d60..41e45d7 100644 --- a/roles/common/templates/rules.v6.j2 +++ b/roles/common/templates/rules.v6.j2 @@ -35,7 +35,7 @@ COMMIT -A PREROUTING --in-interface {{ ansible_default_ipv6['interface'] }} -p udp --dport {{ wireguard_port_avoid }} -j REDIRECT --to-port {{ wireguard_port_actual }} {% endif %} # Allow traffic from the VPN network to the outside world, and replies --A POSTROUTING -s {{ subnets|join(',') }} -m policy --pol none --dir out -j SNAT --to {{ ipv6_egress_ip | ipaddr('address') }} +-A POSTROUTING -s {{ subnets|join(',') }} -m policy --pol none --dir out {{ '-j SNAT --to ' + ipv6_egress_ip | ipaddr('address') if alternative_ingress_ip else '-j MASQUERADE' }} COMMIT