dual homing a freebsd server

Lowell Gilbert freebsd-questions-local at be-well.ilk.org
Fri Oct 27 14:11:39 UTC 2006

"Mark Sellers" <mark.sellers at hamiltontel.com> writes:

> I want to put two nic cards in a server, and have two separate gateways
> assigned to each nic.  I want one to master and the other slave.  When the
> primary network dies I want it to failover to the other card on the fly.
> Any help would be greatly appreciated.

Technically, that isn't multi-homing, because you aren't planning to
use both links at the same time.  You might have gotten more responses
if you had referred to "failover" in your subject line.

There are a number of ways to do what you're looking for, but they
will break existing connections when the failover occurs.  That may or
may not be a problem, depending on how long-lived the critical
connections are for your server (and whether it can re-establish them
on its own when they fail).

There are some programs in ports that claim to do this sort of thing
(e.g., net/balance), but I haven't used any.  In general, the
difficult part is detecting the failure -- if that problem is solved,
scripting the failover is trivial.  Note that the failure will
typically not be on your physical link, so you can just watch the
local interface.  In the worst case, you use some kind of heartbeat
protocol with a carefully-chosen router on your primary network, but
there may be a better way depending on the precise configuration of
that network.

Good luck.
Lowell Gilbert, embedded/networking software engineer, Boston area

More information about the freebsd-questions mailing list