Skip to content

Instantly share code, notes, and snippets.

@zvakanaka
Last active June 17, 2016 14:17
Show Gist options
  • Save zvakanaka/e88bde8f5a4432be36d28130c1dd09ad to your computer and use it in GitHub Desktop.
Save zvakanaka/e88bde8f5a4432be36d28130c1dd09ad to your computer and use it in GitHub Desktop.
Script to run at reboot for Pi3 Access Point
sudo iptables --flush
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
sudo sh -c "iptables-save > /etc/iptables.ipv4.nat"
sudo service dnsmasq restart
sleep 15
sudo service dnsmasq restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment