Using carp in unicast, changing any other attribute than "peer" switch back to unicast : root@testvip1:~ # ifconfig epair0b epair0b: flags=1008943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 9000 options=8<VLAN_MTU> ether 2c:44:fd:19:94:db hwaddr 02:03:7f:1f:e6:0b inet 192.168.1.83 netmask 0xffffff00 broadcast 192.168.1.255 inet 192.168.1.85 netmask 0xffffff00 broadcast 192.168.1.255 vhid 99 groups: epair carp: BACKUP vhid 99 advbase 1 advskew 150 peer 192.168.1.84 peer6 ff02::12 media: Ethernet 10Gbase-T (10Gbase-T <full-duplex>) status: active nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL> root@testvip1:~ # ifconfig epair0b vhid 99 advskew 50 root@testvip1:~ # ifconfig epair0b epair0b: flags=1008943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 9000 options=8<VLAN_MTU> ether 2c:44:fd:19:94:db hwaddr 02:03:7f:1f:e6:0b inet 192.168.1.83 netmask 0xffffff00 broadcast 192.168.1.255 inet 192.168.1.85 netmask 0xffffff00 broadcast 192.168.1.255 vhid 99 groups: epair carp: MASTER vhid 99 advbase 1 advskew 50 peer 224.0.0.18 peer6 ff02::12 media: Ethernet 10Gbase-T (10Gbase-T <full-duplex>) status: active nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL> This is caused by multicast set as default in carp_ctor in sbin/ifconfig/carp.c, so when setcarp_callback run it sets carpr.carpr_addr back to 224.0.0.18. On my setup, commenting default values works like assumed, and first initialization also correctly set peer to 224.0.0.18 if not specified by ifconfig. Maybe these default values could be removed ? iff --git a/sbin/ifconfig/carp.c b/sbin/ifconfig/carp.c index dd09838b5d8b..ef24b0899fe7 100644 --- a/sbin/ifconfig/carp.c +++ b/sbin/ifconfig/carp.c @@ -246,10 +264,6 @@ static struct afswtch af_carp = { static __constructor void carp_ctor(void) { - /* Default to multicast. */ - setcarp_mcast(NULL, NULL, 0); - setcarp_mcast6(NULL, NULL, 0); - for (size_t i = 0; i < nitems(carp_cmds); i++) cmd_register(&carp_cmds[i]); af_register(&af_carp);
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=af33f86e6aef6b15c8aa3da615167272aa7a3ee3 commit af33f86e6aef6b15c8aa3da615167272aa7a3ee3 Author: Kristof Provost <kp@FreeBSD.org> AuthorDate: 2025-01-21 09:49:55 +0000 Commit: Kristof Provost <kp@FreeBSD.org> CommitDate: 2025-01-24 10:20:30 +0000 carp: don't unintentionally revert to multicast mode PR: 284140 MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") sbin/ifconfig/carp.c | 4 ---- tests/sys/netinet/carp.sh | 7 +++++-- 2 files changed, 5 insertions(+), 6 deletions(-)