luci-app-zerotier: fix iptables bug

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
Eason 2021-04-06 10:55:51 +08:00 committed by Tianling Shen
parent 07267d373a
commit 552d33e65c
No known key found for this signature in database
GPG Key ID: 6850B6345C862176

View File

@ -22,7 +22,7 @@ echo "${zt0}" > "/tmp/zt.nif"
iptables -I FORWARD -i "$i" -j ACCEPT
iptables -I FORWARD -o "$i" -j ACCEPT
iptables -t nat -I POSTROUTING -o "$i" -j MASQUERADE
ip_segment="$(ip route | grep "dev $i proto" | awk '{print $1}')"
ip_segment="$(ip route | grep "dev $i proto kernel" | awk '{print $1}')"
iptables -t nat -I POSTROUTING -s "${ip_segment}" -j MASQUERADE
done
}