Difference between revisions of "Network sharing"

From MyWiki
Jump to: navigation, search
(Created page with " '''Configure iptables for NAT translation so that packets can be correctly routed through the Ubuntu gateway. ''' sudo iptables -A FORWARD -o eth0 -i eth1 -s 192.168.0.0/24...")
 
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
 
  sudo iptables -A FORWARD -o eth0 -i eth1 -s 192.168.0.0/24 -m conntrack --ctstate NEW -j ACCEPT
 
  sudo iptables -A FORWARD -o eth0 -i eth1 -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 -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 12:06, 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 eth0 -i eth1 -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