Skip to content

Instantly share code, notes, and snippets.

@oldsharp
Created January 16, 2014 02:48
Show Gist options
  • Save oldsharp/8449021 to your computer and use it in GitHub Desktop.
Save oldsharp/8449021 to your computer and use it in GitHub Desktop.
iptables rules
#!/bin/sh
sudo iptables -A FORWARD -o eth0 -i wlan0 -s 192.168.0.0/24 -m conntrack --ctstate NEW -j ACCEPT
sudo iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
sudo iptables -t nat -F POSTROUTING
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
sudo sh -c "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