Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Oct 2014 15:29:48 +0000
From:      Matt Churchyard <matt.churchyard@userve.net>
To:        "freebsd-net@freebsd.org" <freebsd-net@freebsd.org>
Subject:   Carp stuck in INIT
Message-ID:  <102a877d8483473bbd4a5c701c23aaa7@SERVER.ad.usd-group.com>

next in thread | raw e-mail | index | archive | help

Hello,

I've just been providing help on the forums to a user trying to get carp to work with a /30 network, where only 1 address is available.
Two FreeBSD routers with one of the addresses in the /30 taken by the upstream ISP.

Looking through the carp manpage, which seems to show an example of carp addresses being used as the primary address on an interface (whereas I believe it had to be an alias before), I came up with the following example (with preempt enabled in /etc/sysctl.conf):

ifconfig_em0="vhid 10 pass mypass 192.168.0.100/24"
defaultrouter="192.168.0.10"

However, on boot, I got the following messages, and carp would stick forever in INIT mode.
(May not be word for word, written from memory)

em0: promiscuous mode enabled
carp: demoted by 240 to 240 (interface down)

I had to down/up the interface to get it to correctly jump into master or backup mode

This seems to have been fixed by changing rc.conf as follows (note the up keyword)
With this on master and backup, everything seems to work perfectly

ifconfig_em0="vhid 10 pass mypass 192.168.0.100/24 up"

In comparison to the above messages, which were from the master booting up, I now see the following:

em0: promiscuous mode enabled
carp: VHID 10@em0: INIT -> BACKUP
carp: VHID 10@em0: BACKUP -> MASTER (preempting a slower master)

Is this something that's known to be required, is there a problem, or is it just because I'm testing with virtualbox?
The examples on the carp man page don't use the up keyword.

(By the way I realise my tests don't use a /30 network like the one I was originally trying the help with, I was more interested in testing the use of carp as the only address on a machine. If it works with a single /24 carp address, I'd expect it to work with a single /30 carp address)

Regards,
Matt Churchyard



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?102a877d8483473bbd4a5c701c23aaa7>