fix: allow bi-directional traffic initiation

This commit is contained in:
2021-10-21 19:05:36 +01:00
parent 5c7a14da17
commit 90cf5b1684
2 changed files with 5 additions and 4 deletions

View File

@@ -7,8 +7,8 @@ services:
context: . context: .
dockerfile: Dockerfile dockerfile: Dockerfile
args: args:
ARCH: arm64 ARCH: amd64
VERSION: 1.6.5 VERSION: 1.6.6
restart: always restart: always
privileged: true privileged: true
volumes: volumes:

View File

@@ -31,11 +31,12 @@ do
if [ "$ZT_BRIDGE" = "true" ] if [ "$ZT_BRIDGE" = "true" ]
then then
echo "iptables on $(zerotier-cli get $n portDeviceName)" echo "Configuring iptables on $(zerotier-cli get $n portDeviceName)"
PHY_IFACE=eth0; ZT_IFACE=$(zerotier-cli get $n portDeviceName) PHY_IFACE=eth0; ZT_IFACE=$(zerotier-cli get $n portDeviceName)
iptables -t nat -A POSTROUTING -o $PHY_IFACE -j MASQUERADE iptables -t nat -A POSTROUTING -o $PHY_IFACE -j MASQUERADE
iptables -A FORWARD -i $PHY_IFACE -o $ZT_IFACE -m state --state RELATED,ESTABLISHED -j ACCEPT iptables -t nat -A POSTROUTING -o $ZT_IFACE -j MASQUERADE
iptables -A FORWARD -i $PHY_IFACE -o $ZT_IFACE -j ACCEPT
iptables -A FORWARD -i $ZT_IFACE -o $PHY_IFACE -j ACCEPT iptables -A FORWARD -i $ZT_IFACE -o $PHY_IFACE -j ACCEPT
fi fi
done done