I am building a local network with 4 nodes behind a switch and 1 node connect with two network interfaces.
Following this instruction, I still can not ping the ip outside from the nodes behind the switch.
My local network is 192.168.1.x, the server has two network interfaces,
eth0 pointed to switch to other nodes
eth1 pointed to the internet
From the frond node connect to internet directly
Code:
:~$ sudo iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy DROP)
target prot opt source destination
ACCEPT all -- 192.168.1.0/24 anywhere ctstate NEW
ACCEPT all -- anywhere anywhere ctstate RELATED,ESTABLISHED
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
And
Code:
~$ route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
localnet * 255.255.255.0 U 0 0 0 eth1
192.168.1.0 * 255.255.255.0 U 0 0 0 eth0
link-local * 255.255.0.0 U 1000 0 0 eth0
default 129.78.142.254 0.0.0.0 UG 100 0 0 eth1
Any one can help me on solving this problem? Thanks!
Added 18.10:
This is solved.
At Front Node, edit file /etc/rc.local by adding one line
Code:
/sbin/iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -o eth1 -j MASQUERADE
Bookmarks