CARP + multiple addresses

Oliver Fromme olli at lurza.secnetix.de
Thu Jun 19 14:35:08 UTC 2008


Peter Jeremy wrote:
 > On 2008-Jun-12 17:26:25 +0200, Oliver Fromme <olli at lurza.secnetix.de> wrote:
 > > So far it seems to work fine with CARP, but now it turned
 > > out that I need another address from a different subnet
 > > which also needs to access the database.  What's the best
 > > way to do that?  Add a second IP address to the existing
 > > carp interface, or create a new carp interface?  Are there
 > > any pros and cons?
 > 
 > I'm currently working towards something like this and intending to
 > have one CARP interface for each VLAN.

What's the advantage of doing that, compared to putting
all addresses on the same CARP interface?

Meanwhile, in another thread on the -net list someone
reported that there seems to be a bug when you put
multiple VLANs on the same CARP inetrface.  So that
would be a good reason not to do it.

 > > And now I need to add an IP address from vlan202 which
 > > also needs to access the same database.  I'm inclined to
 > > add 10.1.202.40/32 vhid 1 to the existing carp0 on both
 > > servers.  I assume that the CARP interface goes to BACKUP
 > > when *any* of its IP addresses fail, right?  Can anybody
 > > confirm this, please?
 > 
 > My reading of the various documentation says that you are on the right
 > track but, by default, each CARP interface will fail over
 > independently.  If you want them all to fail over together then you
 > should set net.inet.carp.preempt (see carp(4) and its first example)

I've read it, but the problem is that I do not want the
hosts to preempt each other.  That's why I need to run
with that sysctl off.

However, if there are two CARP interfaces, and their
VLANs are configured on the same physical interface
(e.g. bge0), then they should always fail at the same
time anyway, right?  i.e. when bge0 goes down, both
VLAN interfaces go down, so both CARP interfaces
should switch to the other host.

Best regards
   Oliver

-- 
Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M.
Handelsregister: Registergericht Muenchen, HRA 74606,  Geschäftsfuehrung:
secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün-
chen, HRB 125758,  Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart

FreeBSD-Dienstleistungen, -Produkte und mehr:  http://www.secnetix.de/bsd

"I have stopped reading Stephen King novels.
Now I just read C code instead."
        -- Richard A. O'Keefe


More information about the freebsd-net mailing list