CARP demotion counter

Julien Cigar jcigar at ulb.ac.be
Fri Dec 11 09:45:50 UTC 2015


On Thu, Dec 10, 2015 at 08:40:38PM +0100, Julien Cigar wrote:
> On Thu, Dec 10, 2015 at 08:00:48PM +0100, Emmanuel Vadot wrote:
> > On 2015-12-10 19:28, Julien Cigar wrote:
> > > Hello,
> > > 
> > > I'm busy to setup a redundant router/firewall with two Soekris 6501, 
> > > PF,
> > > CARP and PFSync.
> > > 
> > > I wondered if it was normal that the CARP demotion counter
> > > (net.inet.carp.demotion) is greater than 0 at boot?
> > > 
> > > I'm asking this because it seems that the MASTER never returns from a
> > > BACKUP state, and it seems that's because the demotion counter is
> > > greater than 0 on both boxes (480) ..
> > > 
> > > Any idea .. ?
> > > 
> > > Thanks,
> > > Julien
> > 
> >   You need net.inet.carp.preempt=1 for MASTER returning to MASTER after a 
> > BACKUP state.
> >   Otherwise as long as another machine have the carp ip, it will stay to 
> > BACKUP.
> 
> Both machines have net.inet.carp.preempt=1
> 
> To sum up, with "A" the original MASTER, "B" the BACKUP:
> - At first boot net.inet.carp.demotion is > 0 on A and B (which is not
>   expected)
> - A is in MASTER state and B is in BACKUP state (which is expected)
> - If I unplug the cable from A, the state changes from BACKUP -> MASTER
>   on B (which is expected)
> - When I re-plug the cable in A, the state remains the same (A is in
>   BACKUP and B is in MASTER, which is *not* expexted)
> - As soon as set net.inet.carp.demotion to "0" the states change as
>   expected (A in MASTER and B in BACKUP)
> 
> Is it normal and expected that the demotion counter is > 0 at first 
> boot? Could this be related to the order of the interfaces?

so.. I'm looking further at this and it seems that the pfsync interface is
causing this, this is what I have in the logs when I boot the two boxes:

(soekris1 is the MASTER and soekris2 is the BACKUP, em1 is the CARP alias
and em3 the pfsync)

as a test I powered on the soekris2 box first:

carp: VHID 192 at em1: INIT -> BACKUP
carp: demoted by -240 to 720 (interface up)
em1: link state changed to UP
carp: VHID 192 at em1: BACKUP -> MASTER (master down)

some seconds later I powered on soekris1:

carp: demoted by -240 to 720 (pfsync bulk done)
carp: VHID 192 at em1: INIT -> BACKUP
carp: demoted by -240 to 480 (interface up)
em1: link state changed to UP

once soekris1 and soekris2 finished to boot this is what I get on 
soekris2:

em3: link state changed to DOWN
em3: link state changed to UP
em3: link state changed to DOWN
em3: link state changed to UP
carp: demoted by -240 to 480 (pfsync bulk done)

> 
> Thanks!
> 
> Julien
> 
> > 
> > -- 
> > Emmanuel Vadot
> > _______________________________________________
> > freebsd-questions at freebsd.org mailing list
> > https://lists.freebsd.org/mailman/listinfo/freebsd-questions
> > To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"
> 
> -- 
> Julien Cigar
> Belgian Biodiversity Platform (http://www.biodiversity.be)
> PGP fingerprint: EEF9 F697 4B68 D275 7B11  6A25 B2BB 3710 A204 23C0
> No trees were killed in the creation of this message.
> However, many electrons were terribly inconvenienced.



-- 
Julien Cigar
Belgian Biodiversity Platform (http://www.biodiversity.be)
PGP fingerprint: EEF9 F697 4B68 D275 7B11  6A25 B2BB 3710 A204 23C0
No trees were killed in the creation of this message.
However, many electrons were terribly inconvenienced.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20151211/626f81ad/attachment.sig>


More information about the freebsd-questions mailing list