Skip to content

Instantly share code, notes, and snippets.

@vsefer
Created September 17, 2014 01:40
Show Gist options
  • Save vsefer/52355d1f0b868274847a to your computer and use it in GitHub Desktop.
Save vsefer/52355d1f0b868274847a to your computer and use it in GitHub Desktop.
Firewall config for OpenWrt to tunnel all traffic to VPN with OpenVPN
iptables -I OUTPUT -o tun+ -j ACCEPT
iptables -I INPUT -i tun+ -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -I FORWARD -o tun+ -j ACCEPT
iptables -I FORWARD -i tun+ -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -t nat -I POSTROUTING -o tun+ -j MASQUERADE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment