Network sharing

From MyWiki
Revision as of 15:42, 24 July 2014 by George2 (Talk | contribs)

Jump to: navigation, search
Configure iptables for NAT translation so that packets can be correctly routed through the Ubuntu gateway
https://help.ubuntu.com/community/Internet/ConnectionSharing
sudo iptables -A FORWARD -o eth2 -i eth1 -s 192.168.32.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 eth2 -j MASQUERADE