-   Linux - Networking (
-   -   multiple gateways on a server. (

Gil@LQ 02-19-2013 09:26 AM

multiple gateways on a server.

i'm running CentOS 6.3, pc has 2 nic, --nic 1 connected to my lan --nic 2 connectedt wifi router (internet)

Linux router ---nic 1 ---nic 2 ---nic 3 ---nic 4

my situation is , i'm running squid on it so working fine, i have to add a hdd to this pc and turn in to NAS for my lan every thing seems fine. Bad luck is i have i have to provide NAS connectivity to network..

in my network we use a linux gateway server with 4 lan cards for each network. if a pc from has to ping network , traffic has to go via (linux router)

Since i have to use as default gw for internet which is wifi routers ip, i can't use as gateway and this NAS server can't communicate 90 series network,

so please tel me how to use two gateways ( and ) in one system

can iptables help sending traffic to 90 series network via (my network gateway)...

Thank you very much in advance.

acid_kewpie 02-19-2013 09:44 AM

Can't quite get my head around what you're LAN looks like (where id thie subnet come from?) but I doubt it matters. You can easily add a route to

route add -net netmask gw

Job done. You can also set up a routing file to persistently store this

Gil@LQ 02-20-2013 06:34 AM

1 Attachment(s)
hi acid_kewpie,

you really rock, yesterday i've gone throug IP ROUTE, seen route add also, but i added around 10-15 time, so messed up entirely and working fine, now.

sorry fo, it supposed to be (one nic out of four attached to linux router)
, i added rest of the three networks to it.


route add -net netmask gw
route add -net netmask gw
route add -net netmask gw
And also to make them persistant, i gone through your link but found little confused ,so followed




but when i searched to know more aboue route add, some of them mentioned dev eth0 / eth1 etc...

if you don't mind, can you tell me what exactly thig command does, because they given workaround not the real descritpion.

attached pic gives you clear picutre, please find it and let me know any other best way there to do it.

thank you very much....

All times are GMT -5. The time now is 07:39 PM.