Skip to content

Instantly share code, notes, and snippets.

@h0ffy
Last active June 23, 2025 21:09
Show Gist options
  • Save h0ffy/cbb0d4781cd7a5254e20b223b030c76e to your computer and use it in GitHub Desktop.
Save h0ffy/cbb0d4781cd7a5254e20b223b030c76e to your computer and use it in GitHub Desktop.
sudo iptables -t nat -F
sudo iptables -A FORWARD -i tun0 -o tun1 -j ACCEPT
sudo iptables -A FORWARD -i tun1 -o tun0 -j ACCEPT
sudo iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o tun1 -j MASQUERADE
sudo iptables -t nat -A POSTROUTING -s 10.9.0.0/24 -o tun0 -j MASQUERADE
sudo iptables-save > /etc/iptables/rules.v4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment