Skip to content

Instantly share code, notes, and snippets.

@wulfgarpro
Created December 4, 2012 11:28
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 wulfgarpro/4202874 to your computer and use it in GitHub Desktop.
Save wulfgarpro/4202874 to your computer and use it in GitHub Desktop.
Shell script to route my wlan0 via eth0
#!/bin/bash
iptables --flush
iptables --table nat --flush
iptables --delete-chain
iptables --table nat --delete-chain
iptables --table nat --append POSTROUTING --out-interface wlan0 -j MASQUERADE
iptables --append FORWARD --in-interface eth0 -j ACCEPT
echo 1 > /proc/sys/net/ipv4/ip_forward
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment