# CARP PREEMPT Problem



## kristoferus75 (Feb 22, 2020)

Hi !

Wy does carp preempt disable not work ?

HOST A

ifconfig_lagg1_alias0="inet vhid 1 pass test alias 172.31.99.100/32"

sysctl -a | grep carp.preempt
net.inet.carp.preempt: 0


HOST B

ifconfig_lagg1_alias0="inet vhid 1 advskew 10 pass test alias 172.31.99.100/32"

sysctl -a | grep carp.preempt
net.inet.carp.preempt: 0

If both hosts are online HOST A is the master !
If Host A is away Host B is the master !
If Host A is back Host A will be master and Host B is Backup even if preempt disabled  !
I need a setup that Host B remains master even if Host A would be online

If I change net.inet.carp.preempt: to 1 nothing changes

Both hosts uses 12.1-RELEASE-p2

ifconfig HOST A:

lagg1: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=e507bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,TSO4,TSO6,LRO,VLAN_HWFILTER,VLAN_HWTSO,RXCSUM_IPV6,TXCSUM_IPV6>
    ether 48:df:37:b7:df:b0
    inet 172.31.99.5 netmask 0xffffff00 broadcast 172.31.99.255
    inet 172.31.99.100 netmask 0xffffffff broadcast 172.31.99.100 vhid 1
    laggproto lacp lagghash l2,l3,l4
    laggport: ixl0 flags=1c<ACTIVE,COLLECTING,DISTRIBUTING>
    laggport: ixl1 flags=0<>
    groups: lagg
    carp: MASTER vhid 1 advbase 1 advskew 0
    media: Ethernet autoselect
    status: active
    nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
lo1: flags=8008<LOOPBACK,MULTICAST> metric 0 mtu 16384
    options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
    groups: lo
    nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>

ifconfig HOST B:

lagg1: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=e507bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,TSO4,TSO6,LRO,VLAN_HWFILTER,VLAN_HWTSO,RXCSUM_IPV6,TXCSUM_IPV6>
    ether 48:df:37:b7:e5:80
    inet 172.31.99.6 netmask 0xffffff00 broadcast 172.31.99.255
    inet 172.31.99.100 netmask 0xffffffff broadcast 172.31.99.100 vhid 1
    laggproto lacp lagghash l2,l3,l4
    laggport: ixl0 flags=1c<ACTIVE,COLLECTING,DISTRIBUTING>
    laggport: ixl1 flags=0<>
    groups: lagg
    carp: BACKUP vhid 1 advbase 1 advskew 10
    media: Ethernet autoselect
    status: active
    nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
lo1: flags=8008<LOOPBACK,MULTICAST> metric 0 mtu 16384
    options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
    groups: lo
    nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>

Both hosts:

sysctl -a | grep carp
net.inet.carp.ifdown_demotion_factor: 240
net.inet.carp.senderr_demotion_factor: 240
net.inet.carp.demotion: 0
net.inet.carp.log: 1
net.inet.carp.preempt: 0
net.inet.carp.dscp: 56
net.inet.carp.allow: 1


Thanks !


----------



## kristoferus75 (Feb 24, 2020)

Additional Info :

If i set on both machines

net.inet.carp.preempt: 1

I can see that if i set the with sysctl the net.inet.carp.demotion on the master to 240 the other host is immidiantly the master and the current the backup !

But this only works if i set the carp.preempt to 1

Also if i set the  interface on the host A down this host have immediantly have carp.demotion 240 if i look with sysctl -a | grep carp (net.inet.carp.ifdown_demotion_factor: 240)


----------



## kristoferus75 (Feb 27, 2020)

Problem is solved the german translation is misleading !

In both hosts:

You need to set net.inet.carp.preempt: 1
and
ifconfig_lagg1_alias0="inet vhid 1 pass test alias 172.31.99.100/32"

Then the setup work as expected !

Its solved !


----------

