4

Here is my scenario: i have this server with 2 nics, each one with different IPs, connected to differents routers.

Almost everything is configured whe way i need. Traffic coming from eth0 exits using eth0, traffic coming from eth1 exits using eth1. And there is a default gateway configured.

$route: default IP 0.0.0.0 UG 0 0 0 eth0

With this configuration, the traffic generated in the server is going out using eth0 (lynx www.google.com for example).

The problem is: the Internet link from eth0 went down today. The traffic coming from eth1 was ok...no problem. But the traffic generated in the server was a problem...the default gateway was out...no access do the Internet anymore (no more lynx www.google.com)

So i added a new default gateway configuration, pointing to eth1. For 30 minutes i kept that way...2 default gateways, but just one was "working"...and everything was working just fine. But then i removed de eth0 gateway entry because, well, 2 default gateways is kind of weird.

My question: is there any problem on keeping these 2 default gateways, one for each? So i donĀ“t need to do nothing when one link go down again?

$route: default IP1 0.0.0.0 UG 0 0 0 eth0 default IP2 0.0.0.0 UG 0 0 0 eth1

andre.dias
  • 49
  • 1

2 Answers2

3

You'd be better suited with weighted routing, bonding, or some similar redundancy-based setup - such that you only use one default gateway at a time.

Having two default routes basically leads to asymmetrical routing:

That can cause a lot of issues which are fiddly and annoying.

-1

I fear this could lead to very unpredictable network behaviour and even to connection problems. You might look into bonding your network devices for ourgoing conenctions and using it in hot spare mode. This can prevent further failures.

Christopher Perrin
  • 4,741
  • 17
  • 32