3

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.

3 Answers 3

11

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.

2
  • 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, 2012 at 16:04
  • 1
    Yep, that's right.
    – MDMarra
    Oct 17, 2012 at 16:12
4

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.

0

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.

1
  • "System should have only one route" - what? That's completely wrong.
    – MDMarra
    Oct 18, 2012 at 12:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .