Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm configuring a gateway/router linux box. It is performing masquerading/NAT. The primary Internet interface is a 3G modem, but if that goes down, I would like it to try a different interface automatically. How would I go about doing this? Can the routing rules automatically cater for this, or should I get it to periodically check if the 3G connection is up, and if not, try the other?



share|improve this question
up vote 2 down vote accepted

This blog entry explains how to setup multiple routes for Linux in some detail.

share|improve this answer

Just set a second default gateway, linux will do the failover by itself.

share|improve this answer
You can't have two default gateways, by definition of default. You can set multiple routes however, and weight them. – dunxd Jan 25 '11 at 11:48
@dunxd: that's semantics. It's a route for the entire internet, and it's set in exactly the same manner as a default gateway. – Joris Jan 25 '11 at 20:12
Not semantics at all. Default routes and default gateways are configured differently. If you used the right terms, or linked to some useful information then your answer would be more helpful. By the way, I didn't down vote your answer. – dunxd Jan 27 '11 at 8:57

Your Answer


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.