I have a setup, consisting of 3 linux (CentOS) machines:
All machines the that are directly connected can ping each other.
I am trying to setup iptable rules to enable VM3 to ping VM1 and vice versa, and then connect VM1 to the internet and have all 3 machines able to access the internet.
I have enabled ip forwarding
net.ipv4.ip_forward = 1
I have added two iptables rules in VM2
-A FORWARD -i eth1 -o eth2 -j ACCEPT -A FORWARD -i eth2 -o eth1 -j ACCEPT
I have set the default in gateway /etc/sysconfig/network
VM3 - 172.16.61.1 VM2 - 172.16.60.1
In VM3 I have run the command
> ip route get 172.16.60.1 172.16.60.1 via 172.16.61.1 dev eth1 src 172.16.61.2
However, this did not make it work. Can you help me?