1
0
mirror of https://github.com/CumulusNetworks/ifupdown2.git synced 2024-05-06 15:54:50 +00:00

addons: set addrgenmode to none for vrrp macvlan

A VRRP macvlan interface should only have addresses matching the
VIP defined by the user.  This change ensures we set ipv6 addrgenmode
to none, that way there won't be any unexpected (from user standpoint)
ipv6 link-local addresses to cause confusion or erroneous Type-2 EVPN
routes (in the case of advertise-default-gw with VRRP instead of VRR)
that advertise IP addresses that don't represent a VIP.

Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
This commit is contained in:
Trey Aspelund
2021-10-15 12:53:20 -04:00
committed by Julien Fortin
parent 63155c61d3
commit 46579015f5

View File

@ -462,17 +462,18 @@ class addressvirtual(AddonWithIpBlackList, moduleBase):
if vrf_ifname:
self.iproute2.link_set_master(macvlan_ifname, vrf_ifname)
# if we are dealing with a VRRP macvlan we need to set addrgenmode
# to RANDOM, and protodown on
# If we are dealing with a VRRP macvlan we need to set protodown on
# and addrgenmode to NONE. A VRRP user only needs the VIP (which is
# explicitly configured) so addrgenmode should be NONE.
if vrrp:
try:
self.iproute2.link_set_ipv6_addrgen(
macvlan_ifname,
Link.IN6_ADDR_GEN_MODE_RANDOM,
Link.IN6_ADDR_GEN_MODE_NONE,
link_created
)
except Exception as e:
self.logger.warning("%s: %s: ip link set dev %s addrgenmode random: "
self.logger.warning("%s: %s: ip link set dev %s addrgenmode none: "
"operation not supported: %s" % (ifname, macvlan_ifname, macvlan_ifname, str(e)))
try:
if link_created: