I have a client application, that needs 5 9's availability. To provide redundancy at the NIC level, it sounds good in theory if the linux host can have 2 NIC cards, both configured to use different gateways. Thus in a diagram it would look like

Client A->NIC1------------->Gateway1------------> Server

Client A->NIC2------------->Gateway2------------->Server

This would ensure that if Gateway 1 crashes, client A can still reach Server via Gateway 2

My questions are:-

Can the 2 NICs on the same host be configured with different gateways? Can NIC1 in the above diagram be configured with a backup gateway2, so that if gateway 1 crashes, NIC1 can use backup gateway2. If above are possible, what would the configuration within linux files look like?


Nope, bad idea. Provide redundancy at each level. Use LACP/Aggregation at the NIC level. Use HSRP or CARP at the gateway. Each gateway should have it's own set of redundant NICs. The network in between should have redudant segments (switches or whatever your network is composed of). Each piece along the way should have redundancy, not just two redundant paths.

High availability like you're requesting is extremely difficult. Get someone who knows this stuff inside and out or you'll never hit 5 nines. That's ~5 minutes of downtime per year. It's much harder than it sounds.

  • Can you please answer if the above configuration is possible? Can a dual homed linux machine be configured such that each NIC has a different gateway to reach the same server IP? – Jimm Feb 24 '12 at 17:24
  • 2
    No, not possible. You can setup different network views for different applications, but not by physical interface. Seriously though, you didn't seem to get the message that what you're proposing is a Bad Idea™. There are ways to achieve HA, your proposal is not one of them. If you have technical limitations preventing you from doing what I outlines, please share, we may be able to work around them. HA like 5 nines is not cheap though. – Chris S Feb 24 '12 at 17:51
  • Based on client's empirical evidence, they hate any kind of automated failover. So any kind of LACP, HSRP or VRRP is out of question. They strongly believe that automated failover does more damage than benefit. Thus, when a service fails, they want client to be acutely aware of it and manually choose the next best alternative. Thus if the switch fails, the client application will be impacted and can choose to route traffic through secondary router. – Jimm Feb 24 '12 at 22:22
  • Additionally, the client and the service are within same subnet connected by a pair of redundant switch. I have already accounted the possibilities of switch failure, cable failure, NIC failure, I/O bus failure with the above manual failover model – Jimm Feb 24 '12 at 22:25
  • Sorry to put it bluntly: your client is dumb. It's now your job to do one of two things. 1. Gently tell them why what they're asking for is silly (there's no way a human response protocol is going to keep downtime to less than 5 minutes per year) and if they insist disclaim liability for the coming failures (see Vortaq's lawyer comment). 2. Beat them over the head (gently) until they come to some sense and install proper systems that have some prayer of living up to 5 nines of uptime, including correctly installed and maintained automated redundancy systems. – Chris S Feb 25 '12 at 3:20

Your design is fundamentally flawed for your stated purpose. Do not implement it.
If you implement it, do not promise 5 nines availability.
If you implement it and promise 5 nines availability, have an EXCELLENT lawyer. You'll need one.

As ChrisS said, you need to **provide redundancy at every level*. At a bare minimum this means:

  • Redundant upstream connections to the internet [provided by your ISP]
  • Redundant UPS and generator-backed power [provided by your ISP]
  • Redundant gateways/virtual routers [provided by your ISP]
  • Redundant, physically separate paths from your ISP's core to your servers [provided by your ISP]
  • Redundant firewalls and load balancing equipment [provided by YOU, though your ISP may provide it too]
  • Redundant switching equipment [provided by YOU, though your ISP my provide it too]
  • Redundant servers [provided by YOU, ideally with redundant subsystems: ECC RAM, RAID, dual power supplies].

Note that this list is not exhaustive (for example I've made no mention of cooling).

You also need to clearly define what your uptime is measured against - Five Nines 24x7x365 is nearly impossible to achieve. Five Nines excluding scheduled maintenance is much more reasonable. The specificity of your contract will mean the difference between making massive profit and being sued out of existence.

To directly answer your questions:

Can the 2 NICs on the same host be configured with different gateways?
Yes. This is called a multi-homed host and is one of several possible implementations. Actually making this work the way you want requires more than just throwing two "default" ( routes into your routing table though.

Can NIC1 in the above diagram be configured with a backup gateway2, so that if gateway 1 crashes, NIC1 can use backup gateway2?
No. NIC1 has no connection to gateway2

  • gateway 2 will publish routes via RIP, so will NIC1 not be able to use gateway 2 in case of gateway 1 failure? – Jimm Feb 24 '12 at 22:27
  • +1 for AT LEAST answering OP's question – HidekiAI Nov 20 '15 at 14:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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