Difference between revisions of "Network sharing"
From MyWiki
Line 1: | Line 1: | ||
'''Configure iptables for NAT translation so that packets can be correctly routed through the Ubuntu gateway''' | '''Configure iptables for NAT translation so that packets can be correctly routed through the Ubuntu gateway''' | ||
https://help.ubuntu.com/community/Internet/ConnectionSharing | https://help.ubuntu.com/community/Internet/ConnectionSharing | ||
− | sudo iptables -A FORWARD -o | + | 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 -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT | ||
sudo iptables -t nat -F POSTROUTING | sudo iptables -t nat -F POSTROUTING | ||
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE | sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE |
Revision as of 15:39, 24 July 2014
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 eth0 -j MASQUERADE