Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
02-23-2008, 01:09 PM
|
#1
|
LQ Newbie
Registered: Feb 2008
Posts: 6
Rep:
|
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
|
|
|
02-23-2008, 01:42 PM
|
#2
|
Senior Member
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625
Rep: 
|
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.
|
|
|
02-23-2008, 02:01 PM
|
#3
|
LQ Newbie
Registered: Feb 2008
Posts: 6
Original Poster
Rep:
|
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.
|
|
|
02-23-2008, 02:36 PM
|
#4
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
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.
|
|
|
02-23-2008, 03:46 PM
|
#5
|
Senior Member
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625
Rep: 
|
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.
|
|
|
All times are GMT -5. The time now is 08:06 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|