Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 02-19-2013, 09:26 AM   #1
Registered: Apr 2010
Location: India /Hyderabad
Distribution: RedHat, CentOS
Posts: 273

Rep: Reputation: 1
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.
Old 02-19-2013, 09:44 AM   #2
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1971Reputation: 1971Reputation: 1971Reputation: 1971Reputation: 1971Reputation: 1971Reputation: 1971Reputation: 1971Reputation: 1971Reputation: 1971Reputation: 1971
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
Old 02-20-2013, 06:34 AM   #3
Registered: Apr 2010
Location: India /Hyderabad
Distribution: RedHat, CentOS
Posts: 273

Original Poster
Rep: Reputation: 1
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....
Attached Thumbnails
Click image for larger version

Name:	network.jpg
Views:	13
Size:	66.6 KB
ID:	11898  

Last edited by Gil@LQ; 02-20-2013 at 07:22 AM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
multiple gateways efm Linux - Newbie 4 06-10-2005 09:50 AM
Multiple Gateways inforlinx Linux - Networking 1 02-22-2005 09:28 PM
Red Hat 7.3 and multiple gateways on multiple interfaces bluefmc Linux - Networking 2 11-19-2004 06:01 PM
multiple ips, multiple gateways, one interface drpixel Linux - Networking 6 12-04-2002 01:56 AM

All times are GMT -5. The time now is 12:27 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration