Send ICMPv6:NDP Unsolicited Advertisement for floating addresses

Floating IPv6 addresses are configured with "preferred_lft 0," which
designates them as deprecated. As a result, when the host initiates
traffic, the static network address is selected as the source.

This can lead to situations where the upstream switch does not
observe packets originating from the floating address. Consequently,
the switch may lack the necessary MAC address mapping to deliver
traffic destined for the floating address. While switches are expected
to perform NDP Neighbor Solicitations to discover the floating
address's MAC, this process is not always reliable, especially when
relying solely on external traffic directed towards the host.

To accelerate the network's learning of the floating address's MAC,
the Unsolicited Advertisement (analogous to gratuitous ARP in IPv4) is
transmitted.

This behavior is primarily observed during the initial unlock of
controller-0, before the Service-Manager (SM) takes over the
management of the floating addresses. Subsequent unlocks do not
exhibit this issue.

Test Plan
=========
[PASS] install controller-0 on a AIO-DX configuration (IPv6), execute
       network configuration and perform the fist unlock, upon system
       return observe from external devices connected to controller-0
       interfaces that "Unsolicited Advertisement" are sent related
       to the floating addresses.

Closes-Bug: 2101145

Change-Id: If2a446ec5a8668b4dbb3e583aa8cb06cb49da0ff
Signed-off-by: Andre Kantek <andrefernandozanella.kantek@windriver.com>
This commit is contained in:
Andre Kantek 2025-03-06 14:54:04 -03:00
parent 889ec6a5cb
commit 3784edafe7

View File

@ -459,10 +459,13 @@ define platform::network::network_address (
# floating ips so that they are not used
if $ifname == 'lo' {
$options = 'scope host'
$protocol = ''
} elsif $address =~ Stdlib::IP::Address::V6 {
$options = 'preferred_lft 0'
$protocol = 'ipv6'
} else {
$options = ''
$protocol = 'ipv4'
}
# Remove the subnet prefix if present ( e.g: 1.1.1.1/24 fd001::1/64)
@ -471,6 +474,12 @@ define platform::network::network_address (
default => $address, # Otherwise, keep it as is
}
# save subnet prefix if present ( e.g: 1.1.1.1/24 fd001::1/64)
$ip_prefix = $address ? {
/.+\// => $address.split('/')[1], # If there's a '/', take the part after it
default => '',
}
# addresses should only be configured if running in simplex, otherwise SM
# will configure them on the active controller.
# Force a gratuitous ARP for IPv4 floating IPs, for fresh installs the
@ -481,14 +490,24 @@ define platform::network::network_address (
onlyif => ['test -f /etc/platform/simplex',
'test ! -f /var/run/.network_upgrade_bootstrap'],
}
-> exec { "Send Gratuitous ARP for IP: ${ip_address} on interface: ${name}":
-> exec { "Send Gratuitous ARP for IPv4: ${ip_address}/${ip_prefix} on interface: ${name},${ifname}":
command => "arping -c 3 -U -I ${ifname} ${ip_address}",
logoutput => true,
logoutput => 'on_failure',
onlyif => ["test ${ifname} != 'lo'",
"echo ${ip_address} | grep -qE '^([0-9]{1,3}\\.){3}[0-9]{1,3}$'",
'test -f /etc/platform/simplex',
'test ! -f /var/run/.network_upgrade_bootstrap'],
}
-> exec { "Send Unsolicited Advertisement for IPv6: ${ip_address}/${ip_prefix} on interface: ${name},${ifname}":
command => "/usr/lib/heartbeat/send_ua ${ip_address} ${ip_prefix} ${ifname}",
logoutput => 'on_failure',
onlyif => ["test ${ifname} != 'lo'",
"test ${ip_prefix} != ''",
"test ${protocol} == 'ipv6'",
'test -x /usr/lib/heartbeat/send_ua',
'test -f /etc/platform/simplex',
'test ! -f /var/run/.network_upgrade_bootstrap'],
}
}
}