commit 124480c8af13a9cb82d64f9103c55ae64f36ceda parent 2b146d5ec020636d48e23daf300589f41cc25839 Author: Martin Schanzenbach <schanzen@gnunet.org> Date: Fri, 2 Dec 2022 23:04:47 +0900 -we need ip forwarding on bridges Diffstat:
| M | contrib/netjail/netjail_core.sh | | | 7 | ++++--- |
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/contrib/netjail/netjail_core.sh b/contrib/netjail/netjail_core.sh @@ -188,9 +188,10 @@ netjail_node_add_nat() { local ADDRESS=$2 local MASK=$3 - ip netns exec $NODE nft add table nat - ip netns exec $NODE nft add chain nat postrouting { type nat hook postrouting priority 0 \; } - ip netns exec $NODE nft add rule ip nat postrouting ip saddr "$ADDRESS/$MASK" counter masquerade + ip netns exec $NODE sysctl -w net.ipv4.ip_forward=1 + ip netns exec $NODE nft add table nat + ip netns exec $NODE nft add chain nat postrouting { type nat hook postrouting priority 0 \; } + ip netns exec $NODE nft add rule ip nat postrouting ip saddr "$ADDRESS/$MASK" counter masquerade # ip netns exec $NODE iptables -t nat -A POSTROUTING -s "$ADDRESS/$MASK" -j MASQUERADE }