LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-05-2007, 04:22 AM   #1
Laurkin
LQ Newbie
 
Registered: Jun 2007
Posts: 15

Rep: Reputation: 0
Exclamation multiple gateways


I run Centos 4.5 and our network is laying new servers down my problem is that i need to change default gateways each time i need to access the new servers and back again to access the old ones if i keep it on the new gateway i can't get mail is there help out there i use one network interface
 
Old 07-05-2007, 04:33 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
please explain your topology more effectively, how are we supposed to know what "old servers" and "new servers" mean in terms of a network architecture??
 
Old 07-05-2007, 06:12 AM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
I'm guessing that the two sets of servers are on different subnets, and both subnets are different from your own. A default gateway is for IP addresses that don't match any route. Setup a route for each subnet.

So, imagine that the old servers are on the 192.168.1.0 subnet, and the new ones are on the 192.168.2.0 subnet.
Code:
Destination     Gateway         Genmask         Flags 
192.168.0.0     *               255.255.255.0   U     
192.168.1.0     192.168.1.1     255.255.255.0   UG     
192.168.2.0     192.168.2.1     255.255.255.0   UG                      
loopback        *               255.0.0.0       U     
default         192.168.0.1     0.0.0.0         UG
 
Old 07-06-2007, 08:01 AM   #4
Laurkin
LQ Newbie
 
Registered: Jun 2007
Posts: 15

Original Poster
Rep: Reputation: 0
we run a network with a certain IP range ie: 10.98.1.1 (old)
we have started to rename our servers to 10.9.1.1(new)
now for me to ping 10.98.1.1 i use one gateway to ping the other i need to change my gateway
until we reach a point where all are the same
 
Old 07-06-2007, 08:14 AM   #5
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
please help us to help you... how do these two networks relate to the client machine here?? what does your LAN look like?? please provide info you think is useful, not just short answer to each specific question that is asked.
 
Old 07-06-2007, 08:20 AM   #6
Laurkin
LQ Newbie
 
Registered: Jun 2007
Posts: 15

Original Poster
Rep: Reputation: 0
I work in our headoffice
we have +- 30 branches
so if we work in the "old servers" our gateway must be 10.98.1.1
but to work in our "new servers"we must change our gateways to 10.9.1.1 and visa versa which at this point in time takes time and we have more than one situation where two branches contact us with the same problem and to sort them out we need to change our gateways and people can understand but it looks like i have sorted it out
 
Old 07-06-2007, 08:48 AM   #7
Laurkin
LQ Newbie
 
Registered: Jun 2007
Posts: 15

Original Poster
Rep: Reputation: 0
ok not working
 
Old 07-07-2007, 04:40 PM   #8
tjyorkshire
Member
 
Registered: Jun 2007
Location: UK
Distribution: openSUSE 10.2
Posts: 138

Rep: Reputation: 15
i'm confused here, is it working or not now?
 
Old 07-09-2007, 12:50 AM   #9
Laurkin
LQ Newbie
 
Registered: Jun 2007
Posts: 15

Original Poster
Rep: Reputation: 0
not working the way in need it to work
i can get into our servers like i want but then my email is not connecting
 
Old 07-09-2007, 02:09 AM   #10
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
yeah you still seem to be refusing to give useful information about how these machines work,. why can't you just explain the topology? is it a secret? you can't just say "the gateway needs to be xyz" you need to explain why it needs to be that, is there a different router going against the default route towards the internet or what??

in general you should be able to just put in a more specfic route for a given subnet e.g. "route add -net 192.168.1.0/24 gw 192.168.2.3" i.e. to get to network 192.168.0.1/24 your netxt hop is actually 192.168.2.3
 
Old 07-10-2007, 07:10 AM   #11
tjyorkshire
Member
 
Registered: Jun 2007
Location: UK
Distribution: openSUSE 10.2
Posts: 138

Rep: Reputation: 15
from what i can see at the moment, it should just be a case of changing the routing table . . . but like acid_kewpie said, a little more info on the topology would help a lot!

How about you give us your routing table when you're connected to each gateway? Then maybe we can figure out a new one for you to use that might work
 
Old 07-11-2007, 12:29 AM   #12
Laurkin
LQ Newbie
 
Registered: Jun 2007
Posts: 15

Original Poster
Rep: Reputation: 0
Thanks guys got it sorted finally just added a new directory did a bit of fine tuning and she is now working
 
Old 07-11-2007, 02:47 AM   #13
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
a new directory?? wtf?
 
Old 07-11-2007, 11:38 AM   #14
tjyorkshire
Member
 
Registered: Jun 2007
Location: UK
Distribution: openSUSE 10.2
Posts: 138

Rep: Reputation: 15
what like a folder directory....???? i agree - wtf!
 
Old 07-12-2007, 12:36 AM   #15
Laurkin
LQ Newbie
 
Registered: Jun 2007
Posts: 15

Original Poster
Rep: Reputation: 0
first i had to create the directory as it was not there by:
touch /etc/sysconfig/network-scripts/route-eth0
then i edited by defining which gateway must be used for which ip range
and then she works very very nicely
and now i can work faster than before as i now don't need to change my gateways at all
 
  


Reply

Tags
makes, perfect



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 Jon Doe Linux - Networking 9 03-07-2005 03:26 PM
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 gateways john8675309 Linux - Software 0 05-24-2004 06:27 PM
multiple ips, multiple gateways, one interface drpixel Linux - Networking 6 12-04-2002 12:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 09:11 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