LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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-23-2008, 01:09 PM   #1
soliberus
LQ Newbie
 
Registered: Feb 2008
Posts: 6

Rep: Reputation: 0
Need to solve complex network problem


I have a Red Hat linux server X on a x.x.0.0 network. This machine also has to communicate with another server Y on a network called y.y.0.0

Server X has two network interfaces.

eth0 is configured on the x.x.0.0 network and has a default gateway on the x.x.0.0 network.

In order to communicate server Y on the y.y.0.0 network I'm planning on configuring eth1 with a y.y.0.0 IP address and gateway. I then want to add a static route on eth0 that uses eth1's IP address as a gateway.

Example (using fictional IP addresses):

SERVER X -> eth0 192.168.0.1 (add static route 20.10.0.0 gw 20.10.0.1)
-> eth1 20.10.0.1

SERVER Y -> 20.10.0.10

My logic tells me that if I then request to talk to server Y the request will go to eth1 via the static routed on eth0. eth1 is on the same network as server Y, so the request should then be able to reach server Y

Could someone please confirm that his is correct (or incorrect for that matter).

Cheers
 
Old 02-23-2008, 01:42 PM   #2
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
If eth0 is on network A and eth1 is on network B, you don't need a static routes to communicate with either of those two networks.
 
Old 02-23-2008, 02:01 PM   #3
soliberus
LQ Newbie
 
Registered: Feb 2008
Posts: 6

Original Poster
Rep: Reputation: 0
Right, so are you saying the following?

If I have server X with eth0 on network A with and eth1 on network B and I ping the server Z on network B it will go directly to server Z and not to the default gateway of server X.
 
Old 02-23-2008, 02:36 PM   #4
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
of course it will. you will still have routes in your routing table for all networks you are directly connected to. it's possible to override them if you want to really screw things up, but by default there's nothing at all interesting or complex about what you're asking. you just have two nic's on two networks. there is no primary or secondary interface or anything notional like that.
 
Old 02-23-2008, 03:46 PM   #5
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
Yes, the action of configuring an interface automatically adds a route for its directly-connected network. Furthermore, that route is the only piece of information needed to communicate with a machine on that network; i.e. gateways are irrelevant.
 
  


Reply


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
Connecting Linux to a Complex Windows wifi network tfm1 Linux - Wireless Networking 2 09-28-2006 01:34 PM
For Linux GURU's: route configuration in complex network netguy2000 Linux - Networking 1 09-06-2004 09:00 AM
Complex home network xblade2003 Linux - Networking 3 07-08-2003 11:16 AM

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

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