hello,
I have 2 Routers in 4 computer LAN and setup 3 networks among them and
when i ping from HostA to HostB through Router1 and Router2,Router1 has
to SNAT and it did and sends a ping to HostB with HostB receiving src
ip of ping packet as that Router1 but reverse pong packet from HostB to
HostA does not changes src ip at Router2. why?
I added following to iptables
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
on both Routers as both have eth0 directly connected.
My configuration is
HostA
eth0=> 192.168.1.100
Router1
eth0=>10.1.1.1
eth1=>192.168.1.1
Router2
eth0=>10.1.1.100
eth1=>172.16.1.1
HostB
eth0=>172.16.1.100
What i observe that ping from HostA(192.168.1.100) to
HostB(172.16.1.100) goes to Router1 which does Snat and change src ip
from 192.168.1.100 to 10.1.1.1 and same will appear on Router2 to
HostB.
Then Pong(response) packet has srcip 172.16.1.100 and dst
192.168.1.100 as its not changed but same packet appear on
Router2->Router1->HostA
|