Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

A small LAN (15-20 users) has 3-4 internet connections on a mix of DSL / Cable / EVDO modems. All internet connections are connected to a unique interface on a linux box, which is in turn connected to all the devices on the LAN. I need to setup a proxy server solution such that the proxy binds its outgoing connections to whichever internet interface is currently available.

Availability needs to be checked in semi-real time, I was thinking a small app that pings each of the interface's respective DNS servers through that interface to determine connectivity would work fine.

What sort of proxy solution would allow dynamic routing through different interfaces - depending on whichever one is available at any given time? I suppose it's ok if existing connections are dropped when the proxy switches to a different interface, but the required behaviour is that each new connection established through the proxy should be through an interface that is working at the time.

As an added bonus, is there a solution that would allow the proxy server to round robin its outgoing connections through all the available interfaces (if more than one is available), or do any smarter form of load balancing.

share|improve this question
Wouldn't it be easier to provision a single, reliable internet connection? – joeqwerty Dec 23 '09 at 2:45
normally, yes, but this setup is in a third world country with notoriously unreliable and expensive internet access. – Asad R. Dec 23 '09 at 8:21
up vote 1 down vote accepted

use linux advanced routing and traffic control.

look here. you'll have to set up one table for each isp, add special rules so pings to their dns'es are always routed via those tables.

with separate script run few times per minute you'll have to do health check on each of uplinks and decide which default route to choose.

share|improve this answer
thanks, that looks like exactly what i need. – Asad R. Dec 23 '09 at 8:22

You could also look into interface bonding - there is a lot of documentation out there (e.g.,, or if you have the documentation package for your installed kernel, you can find bonding.txt.

share|improve this answer

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.