I'm looking for software to manage redundant Internet connections before writing my own. I'm sure a lot of people have written quick hacks to do this, but there are a lot of weird corner cases…
We have two Internet connections at work, and (unfortunately) not enough address space to run BGP, so unfortunately we're stuck with second-best solutions. One of the connections is substantially faster than the other anyway, so we use them as a primary and backup.
Currently, they're manually switched by running, e.g.,
ip rule del pref 2500 (to use the backup) or
ip rule add pref 2500 from all lookup comcast (to add it back).
Unfortunately, the only way to determine if a connection is down is via ping or similar—both use an external modem-bridge or modem-router, so the Ethernet link stays up. The external devices sometimes know it's down, but not always (and I don't think they expose this in any useful way, like sending an ICMP unreachable or via SNMP.
- Just needs to add/remove the
ip rule. NAT, fwmark, etc., is already set up and works well. (And there are other complexities, including VPNs and dynamic routing internally via OSPF, that make letting something else control the firewall or routing tables problematic).
- Needs to set a configured source (local) IP for ping, etc. connection checks—that'll make it go out the right ISP.
- Would be nice if it could ping a couple IPs, some more frequently than others. E.g., frequently ping a host we control to check for any connectivity, infrequently ping some other hosts to eventually catch partial connectivity.
- Would be nice if a configurable packet loss % also counted as down. Especially if it could compare the two links (so, e.g., loss near the remote end is canceled out).
- Someday we may get a third link (we had a third in the past). It'd be nice if works with two backup links, too.
I'm aware of Net-ISP-Balance, but it appears to want control of the firewall and only support one ping IP per ISP.