[ale] Odd network setup w/ iptables NAT routing

Michael B. Trausch mike at trausch.us
Tue Jul 13 13:53:20 EDT 2010


Okay, so I am stuck on this.

I have a (private) network that is 172.16.3.0/24.  It is connected to a
Linux box running iptables, which handles the NAT routing for this
private network.  Of course, getting this setup with a single connection
to an ISP is easy stuff, and that's the way that the network is
currently running.

However, what we want to do is have this system setup with two
connections to two ISPs.  Well, it is currently, but I have to do a lot
of manual work to switch it over from the primary to secondary
connection when the primary connection goes down.  I don't want to do
that (obviously).

What I don't really know how to do is make this happen automatically.
I'd like it such that if the default route appears to be down, the
system automatically tries to use a second default route.  However, if I
add two default routes to the routing table (with the secondary route
having a higher "metric" setting), nothing seems to work at all in terms
of connectivity beyond the firewall system.

Of course, the ideal thing here would be to have an IP that could be
moved between ISPs, but I cannot do that.  Oh, and to complicate matters
a bit, this network has two /29 allocations, one from each ISP.
Updating DNS is trivial when the network switchover has to happen, so
I'm not worried about that problem.  The real issue is to try to figure
out when the currently active connection goes down, how to detect this
automatically and switch over to the other connection and then run a
script that will trigger all of the other necessary things like DNS
updates to point new requests to the new IP addresses on the other
connection for the few services that are run on the network.

Any ideas?  Am I missing something blatantly stupid and obvious?  :)

	--- Mike



More information about the Ale mailing list