CARP on top of LAGG failover interface - is it possible?

Hello everyone,

I am wondering if this is supposed to work:
Code:
ifconfig_bce0="up"
ifconfig_bce1="up"
# lagg configuration with DHCP, bridge for jails
cloned_interfaces="lagg0 bridge0"
ifconfig_lagg0="laggproto failover laggport bce0 laggport bce1 DHCP"
# end of lagg configuration with DHCP
ifconfig_lagg0_alias0="inet vhid 1 advskew 100 pass laggy alias 192.168.60.90/32"

The jails and VMs connected to bridge0 are fine, so is the host itself, and LAGG is working ok.

This is what happens during boot:
Code:
bridge0: Ethernet address: 58:9c:fc:10:ff:f8
lo0: link state changed to UP
lagg0: link state changed to DOWN
bce0: promiscuous mode enabled
bce1: promiscuous mode enabled
lagg0: promiscuous mode enabled
carp: demoted by 240 to 240 (interface down)
bridge0: link state changed to DOWN
bce1: Gigabit link up!
bce1: link state changed to UP
carp: 1@lagg0: INIT -> BACKUP (initialization complete)
carp: demoted by -240 to 0 (interface up)
lagg0: link state changed to UP
bridge0: link state changed to UP
bce0: Gigabit link up!
bce0: link state changed to UP
bce0: Gigabit link up!
bce0: Gigabit link up!
carp: 1@lagg0: BACKUP -> MASTER (master timed out)
carp: 1@lagg0: MASTER -> INIT (hardware interface up)
Security policy loaded: MAC/ntpd (mac_ntpd)
tap0: Ethernet address: 58:9c:fc:10:98:00
tap0: promiscuous mode enabled
epair0a: Ethernet address: 02:30:9d:b6:fa:0a
epair0b: Ethernet address: 02:30:9d:b6:fa:0b
epair0a: link state changed to UP
epair0b: link state changed to UP
epair0a: changing name to 'vnet0.1'
vnet0.1: promiscuous mode enabled
lo0: link state changed to UP
tap0: link state changed to UP
epair1a: Ethernet address: 02:98:f6:b2:5b:0a
epair1b: Ethernet address: 02:98:f6:b2:5b:0b
epair1a: link state changed to UP
epair1b: link state changed to UP
epair1a: changing name to 'vnet0.2'
epair1b: changing name to 'epair0b'
vnet0.2: promiscuous mode enabled
lo0: link state changed to UP
epair2a: Ethernet address: 02:cf:3d:1b:fd:0a
epair2b: Ethernet address: 02:cf:3d:1b:fd:0b
epair2a: link state changed to UP
epair2b: link state changed to UP
epair2a: changing name to 'vnet0.3'
epair2b: changing name to 'epair0b'
vnet0.3: promiscuous mode enabled
lo0: link state changed to UP
epair3a: Ethernet address: 02:06:d0:44:13:0a
epair3b: Ethernet address: 02:06:d0:44:13:0b
epair3a: link state changed to UP
epair3b: link state changed to UP
epair3a: changing name to 'vnet0.4'
epair3b: changing name to 'epair0b'
vnet0.4: promiscuous mode enabled
lo0: link state changed to UP

The reason why I am asking is because I saw some other thread someone not sure about whether CARP would only work in LACP, and I couldn't find anything online (google gone to poop, forum search not successful).

Thanks, as always.
 
If I set it manually after boot via ifconfig, it works.
ifconfig lagg0 vhid 2 pass password advbase 5 alias 192.168.60.94/32
 
Well, who would believe that chatgpt (partially) helped. Putting it in an rc script!
The script chatgpt suggested was awful, and didn't work, but then I just put a sleep timer and enabled it in /etc/rc.conf

/usr/local/etc/rc.d/my_carp_lagg.sh:
#!/bin/sh # # PROVIDE: my_carp_lagg # REQUIRE: NETWORKING # BEFORE: DAEMON . /etc/rc.subr name="my_carp_lagg" rcvar="my_carp_lagg_enable" start_cmd="${name}_start" my_carp_lagg_start() { sleep 15 ifconfig lagg0 vhid 1 pass MYPASS advbase 1 alias x.y.z.a/32 } load_rc_config $name run_rc_command "$1"

I will add it to the second box and monitor it for a few days.
 
I haven’t done this kind of setup before ( carp on top of Link Aggregation), but I would expect the lagg0 interface to be online before carp is brought online. There is rcorder which allows rc to honor dependencies, hence that LAGG needs to be online before carp.
 
Yes, you are probably right, based on what the logs show. It seems to start fine and go to master, and then as other interfaces get configured, it poops and does not recover.

Thanks for the suggestion, I will look into it. It is basically what my script is doing. When I add the sleep timer, I give time for the interfaces to settle before bringing carp up.
 
Back
Top