Skip to content

Instantly share code, notes, and snippets.

@wmhaynes
Created September 16, 2014 15:13
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 wmhaynes/17990fa06493ae634dc5 to your computer and use it in GitHub Desktop.
Save wmhaynes/17990fa06493ae634dc5 to your computer and use it in GitHub Desktop.
Line that allows snat of all traffic through the openvpn tunnel
/usr/sbin/iptables -t nat -A POSTROUTING -o tun+ -j SNAT --to-source $(ifconfig tun0 | grep "inet addr" | awk -F: '{print $2}' | awk '{print $1}')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment