Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have a server with 3 NICs running RHEL6.

eth0 is connected to the intranet.

eth1 is connected to the Operations and Maintenance Network

eth2 is connected to an automated backup network (doesnt need a default gateway)

NICs

I defined my default gateway in /etc/sysconfig/network and I have connectivity. The problem is that I have to define another default gateway for eth1 (which is different from eth0). I tried assigning the gateway directly for eth0/eth1 (and adding them into its respective ifcfg-ethX file) but I lost connectivity to the server. And here its easier to handshake the President than to get physical access to the server farm.

How can I do this? Preferably without losing connectivity.

share|improve this question

3 Answers 3

up vote 10 down vote accepted

A "default" gateway is just one that is used when there isn't a more specific route defined. You don't want to have a default route on two different interfaces (unless you're doing it for redundancy). What you want is to have a default route on your "main" interface that most of the traffic uses and then you want to create a persistent static route for each other interface for the subnets that they connect to.

share|improve this answer
1  
So basically I leave the default gateway defined where it is right now and then using the route command I add a static route for eth1? –  Rhyuk Oct 17 '12 at 16:04
1  
Yep, that's right. –  MDMarra Oct 17 '12 at 16:12

What is the sense of having two DEFAULT gateway in diferent networks with different addresses? Note that "default" implies that basically there is one only.

Neither your intranet nor ops+maintenance include the world, so they should not have set default gateways, only routes for the addreses reachable by them.

share|improve this answer

System should have only one route. If you have multiple interfaces connected to different networks and want to access your system through all interfaces then you can use static routes as explained above.

  • eth1 --- default gateway and your system will always contact it, for unknown network in it's route table.

  • eth2 --- Non default. Let's take an example. Lease line connected with this interface. Front device is lease line route and has same subnet ip. Now systems which are available behind this router try to access server, request comes till server but due to default router on eth1, it route reply packets there. So instead of route on eth1 (default) you can apply static route so the kernel will route return packets through the same interface and it will reach to destination through same lease line router.

share|improve this answer
    
"System should have only one route" - what? That's completely wrong. –  MDMarra Oct 18 '12 at 12:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.