Skip to content

Instantly share code, notes, and snippets.

@icedraco
Created August 9, 2016 23:29
Show Gist options
  • Save icedraco/4081a266d306cbdd6cdab092dd99aba5 to your computer and use it in GitHub Desktop.
Save icedraco/4081a266d306cbdd6cdab092dd99aba5 to your computer and use it in GitHub Desktop.
DD-WRT Firewall Script - Bridring local network to remote Internet-enabled network via WiFi (Client Mode)
# NOTE: Follow the bridge separation guide here first:
# https://www.dd-wrt.com/wiki/index.php/Separate_LAN_and_WLAN
iptables -I FORWARD -i br0 -m state --state NEW -j ACCEPT
iptables -I FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
iptables -I FORWARD -i br1 -o br0 -m state --state NEW -j DROP
iptables -i FORWARD -i br1 -d `nvram get lan_ipaddr`/`nvram get lan_netmask` -m state --state NEW -j DROP
iptables -t nat -I POSTROUTING -o br1 -j SNAT --to 10.0.0.254
iptables -I INPUT -i br1 -m state --state NEW -j DROP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment