Skip to content

Instantly share code, notes, and snippets.

@basnijholt
Forked from vsefer/firewall.user
Created February 14, 2017 14:09
Show Gist options
  • Save basnijholt/cd31a9dd7353934ef053818277434c88 to your computer and use it in GitHub Desktop.
Save basnijholt/cd31a9dd7353934ef053818277434c88 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