I have two servers and server_1 is connected to INTERNET port (of server farm) at eth0. No switch. They connected with cable from (server_1)eth1 -> (server_2)eth0 :
ifconfig of (server_1):
eth0 inet addr:199.203.51.24,
eth0:1 inet addr:212.235.19.200,
eth1 inet addr:10.0.0.1
ifconfig of (server_2):
eth0 inet addr:10.0.0.2
I want to connect server_2 to the internet with server_1, and get for him a static IP address from gatway at (server_1)eth0 .
tried using iptables at (server_2) like this:
iptables -t nat -A POSTROUTING -j MASQUERADE
iptables -t nat -A POSTROUTING -s 10.0.0.2 -j SNAT --to-source 212.235.19.203
iptables -t nat -A PREROUTING -d 212.235.19.203 -j DNAT --to-destination 10.0.0.2
while the masking IP is 212.235.19.203 . that's works fine only for the world, but!! inside server_2 trying to ping 212.235.19.203 don't work!