Skip to content

Instantly share code, notes, and snippets.

@volure
Last active October 6, 2017 21:36
Show Gist options
  • Save volure/95e506b61cf874f92677 to your computer and use it in GitHub Desktop.
Save volure/95e506b61cf874f92677 to your computer and use it in GitHub Desktop.
BASH: iptables router over openvpn
iptables -t nat -A POSTROUTING -j MASQUERADE
iptables -I INPUT -s 10.0.0.0/8 -j ACCEPT
iptables -I FORWARD -s 10.0.0.0/8 -j ACCEPT
iptables -I FORWARD -d 10.0.0.0/8 -j ACCEPT
#sysctl -w net.ipv4.ip_forward=1
iptables -I INPUT -i tun+ -j ACCEPT
iptables -I FORWARD -i tun+ -j ACCEPT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment