diff options
author | Viacheslav Hletenko <v.gletenko@vyos.io> | 2022-04-05 11:20:54 +0000 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2022-04-06 10:08:34 +0200 |
commit | 409a2e1239e66cdac0cb244281ee725a16180dcf (patch) | |
tree | 4d3b3a97d8c92fd3620483dea1057e263be00c97 /python/vyos/ifconfig/interface.py | |
parent | af2563589b79539fd771c167aee0ab531a8f0fba (diff) | |
download | vyos-1x-409a2e1239e66cdac0cb244281ee725a16180dcf.tar.gz vyos-1x-409a2e1239e66cdac0cb244281ee725a16180dcf.zip |
interfaces: T4331: Fix assign link-local static IPv6 addr to vrf
If we have link-local static address and vrf, for example:
set interfaces ethernet eth2 address 'fe80::5200:ff:fe55:222/64'
set interfaces ethernet eth2 vrf 'foo'
This IPv6 address was assigned before vrf, as result after
attaching the intreface to vrf we lose this static linklocal
address
DEBUG/IFCONFIG cmd 'ip addr add fe80::5200:ff:fe55:222/64 dev eth2'
DEBUG/IFCONFIG cmd 'ip link set dev eth2 master foo'
DEBUG/IFCONFIG cmd 'ip addr add fe80::5208:ff:fe13:2/64 dev eth2'
This commit fixes this, the address is assigned after vrf assign
(cherry picked from commit d6e22b28887c7a3f7d2f8b955c2e90bcadaeeeba)
Diffstat (limited to 'python/vyos/ifconfig/interface.py')
-rw-r--r-- | python/vyos/ifconfig/interface.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/python/vyos/ifconfig/interface.py b/python/vyos/ifconfig/interface.py index a2fa96d82..73c602cf9 100644 --- a/python/vyos/ifconfig/interface.py +++ b/python/vyos/ifconfig/interface.py @@ -1296,9 +1296,6 @@ class Interface(Control): else: self.del_addr(addr) - for addr in new_addr: - self.add_addr(addr) - # start DHCPv6 client when only PD was configured if dhcpv6pd: self.set_dhcpv6(True) @@ -1313,6 +1310,10 @@ class Interface(Control): # checked before self.set_vrf(config.get('vrf', '')) + # Add this section after vrf T4331 + for addr in new_addr: + self.add_addr(addr) + # Configure ARP cache timeout in milliseconds - has default value tmp = dict_search('ip.arp_cache_timeout', config) value = tmp if (tmp != None) else '30' |