--- /etc/inc/interfaces.inc.orig 2023-07-18 12:41:19.190233000 +0800 +++ /etc/inc/interfaces.inc 2023-07-18 13:00:23.373239000 +0800 @@ -3050,13 +3050,19 @@ } $iface = $vip['interface']; $vhid = ''; + $mode = ''; if (substr($vip['interface'], 0, 4) == "_vip") { $carpvip = get_configured_vip($vip['interface']); $iface = $carpvip['interface']; $vhid = "vhid {$carpvip['vhid']}"; + if (is_ipaddrv4($carpvip['subnet'])) { + $mode = ($carpvip['carp_mode'] == 'ucast' ? "peer ". escapeshellarg($carpvip['carp_peer']) : " mcast"); + } else { + $mode = ($carpvip['carp_mode'] == 'ucast' ? "peer6 ". escapeshellarg($carpvip['carp_peer']) : " mcast6"); + } } - mwexec("/sbin/ifconfig " . escapeshellarg($realif) ." {$af} ". escapeshellarg($vip['subnet']) ."/" . escapeshellarg($vip['subnet_bits']) . " alias {$gateway} {$vhid}"); - unset($iface, $af, $realif, $carpvip, $vhid, $gateway); + mwexec("/sbin/ifconfig " . escapeshellarg($realif) ." {$af} ". escapeshellarg($vip['subnet']) ."/" . escapeshellarg($vip['subnet_bits']) . " alias {$gateway} {$vhid} {$mode}"); + unset($iface, $af, $realif, $carpvip, $vhid, $gateway, $mode); } function interface_carp_configure(&$vip, $ipalias_reload = false) {