iptables masquerading for freerunner

I find myself constantly going to the OpenMoko USB Networking page to find the commands to enable iptables masquerading – it’s the only part of the process I can’t remember.

It’s a bit obscure to find on the USB Networking page, so now it’s here, too:

sudo iptables -I INPUT 1 -s 192.168.0.202 -j ACCEPT
sudo iptables -I OUTPUT 1 -s 192.168.0.200 -j ACCEPT
sudo iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24
sudo bash -c 'echo 1 > /proc/sys/net/ipv4/ip_forward'

Leave a Reply