Skip to content

Instantly share code, notes, and snippets.

@pacmac
Last active June 26, 2023 01:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pacmac/6b0d05a22fd328fbb907683968f6651c to your computer and use it in GitHub Desktop.
Save pacmac/6b0d05a22fd328fbb907683968f6651c to your computer and use it in GitHub Desktop.
Create IP Tables for Zeroteir Gateway
sysctl -w net.ipv4.ip_forward=1
nano /etc/sysctl.conf
## Uncomment net.ipv4.ip_forward
PHY_IFACE=eth0; ZT_IFACE=zt3jnrnpfe;
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 -A FORWARD -i $ZT_IFACE -o $PHY_IFACE -j ACCEPT;
apt install iptables-persistent
bash -c iptables-save > /etc/iptables/rules.v4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment