Skip to content

Instantly share code, notes, and snippets.

@lexfrl
Created July 27, 2015 10:24
Show Gist options
  • Save lexfrl/ec5f8f3c5b41341b0128 to your computer and use it in GitHub Desktop.
Save lexfrl/ec5f8f3c5b41341b0128 to your computer and use it in GitHub Desktop.
Open /etc/sysctl.conf with:
sudo nano /etc/sysctl.conf
Scroll down to the last line of the file and add the line:
net.ipv4.ip_forward=1
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
sudo iptables -A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment