LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-19-2013, 08:26 AM   #1
Gil@LQ
Member
 
Registered: Apr 2010
Location: India /Hyderabad
Distribution: RedHat, CentOS
Posts: 273

Rep: Reputation: 1
multiple gateways on a server.


hi,

i'm running CentOS 6.3, pc has 2 nic,

192.168.80.10 --nic 1 connected to my lan
192.168.1.10 --nic 2 connectedt wifi router (internet)

Linux router
192.168.60.254 ---nic 1
192.168.70.254 ---nic 2
192.168.80.254 ---nic 3
192.168.90.254 ---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 192.168.80.0/24. every thing seems fine. Bad luck is i have i have to provide NAS connectivity to 192.168.90.0/24 network..

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

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

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

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

Thank you very much in advance.
 
Old 02-19-2013, 08:44 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

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

route add -net 192.168.90.0 netmask 255.255.255.0 gw 192.168.80.254

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

http://www.centos.org/docs/5/html/5....ic-routes.html
 
Old 02-20-2013, 05:34 AM   #3
Gil@LQ
Member
 
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.
Quote:
sorry fo 192.168.20.0, it supposed to be 192.168.80.254 (one nic out of four attached to linux router)
, i added rest of the three networks to it.

Quote:
route add -net 192.168.90.0 netmask 255.255.255.0 gw 192.168.80.254
route add -net 192.168.60.0 netmask 255.255.255.0 gw 192.168.80.254
route add -net 192.168.70.0 netmask 255.255.255.0 gw 192.168.80.254
And also to make them persistant, i gone through your link but found little confused ,so followed

http://unixfoo.blogspot.in/2009/05/c...-route-in.html

Quote:
GATEWAY0=192.168.80.254
NETMASK0=255.255.255.0
ADDRESS0=192.168.60.0

GATEWAY1=192.168.80.254
NETMASK1= 255.255.255.0
ADDRESS1=192.168.70.0

GATEWAY2=192.168.80.254
NETMASK2= 255.255.255.0
ADDRESS3=192.168.90.0
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:	22
Size:	66.6 KB
ID:	11898  

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


Reply



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 08:50 AM
Multiple Gateways inforlinx Linux - Networking 1 02-22-2005 08:28 PM
Red Hat 7.3 and multiple gateways on multiple interfaces bluefmc Linux - Networking 2 11-19-2004 05:01 PM
multiple ips, multiple gateways, one interface drpixel Linux - Networking 6 12-04-2002 12:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:23 PM.

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