try
iptables -t nat -A POSTROUTING -o eth1 -s 192.168.57.0/24 -d <whateverpublicipblockyouhave> -j ACCEPT
iptables -t nat -A POSTROUTING -o eth1 -s 192.168.57.0/24 -j SNAT --to 203.131.4.1
so that connections to your other public ips dont get SNATed
whats your routing table look like?
on gw1 you should have a route that says connections to 203.177.3.1 and 203.177.3.2(?) should be routed to 192.168.57.2
and something similar on gw2 so that connections can get back
HTH
Sandy T. Santos wrote:
need help about static routing and nat. when i apply static routing rules on my linux gateway, packets destined for my public servers which is connected to my other linux gateway are going fine however when i turned on nat on my first gateway, packets destined to my public servers would have to go around my first gateway->internet->public servers. here's my iptables rule on my first gw:
iptables -t nat -A POSTROUTING -o eth1 -s 192.168.57.0/24 -d ! 203.177.3.2 -j SNAT --to 203.131.4.1
203.177.3.2 - public servers ip 203.177.3.1 - ip add of gw2 connected to isp2 192.168.57.2 - 2nd ip add of gw2 203.131.4.1 - ip add of gw1 connected to isp1 192.168.57.1 - 2nd ip add of gw1
-- Philippine Linux Users' Group (PLUG) Mailing List [EMAIL PROTECTED] (#PLUG @ irc.free.net.ph) Official Website: http://plug.linux.org.ph Searchable Archives: http://marc.free.net.ph . To leave, go to http://lists.q-linux.com/mailman/listinfo/plug . Are you a Linux newbie? To join the newbie list, go to http://lists.q-linux.com/mailman/listinfo/ph-linux-newbie
