----- Original Message -----
From: "Sandy T. Santos" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, June 05, 2003 12:05 PM
Subject: [plug] nat/routing


> 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

all you need is a static route... add route for 203.177.3.0/netmask network
address and point it to 203.177.3.1 as its gateway address so that the flow
will be gateway->public servers instead of gateway->internet->public servers
as what you described above... this flow is coming from the 203.131.4.1
going to your 203.177.3.0 network sgement... upon returning coming from
203.177.3.0 network sgement  going to 203.131.4.1... in case your public
servers default gateway is not 203.177.3.1, then add static route for every
servers that you have with 203.131.4.0/netmask network address and point it
to 203.177.3.1 as its gateway address...

fooler.


--
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

Reply via email to