Page MenuHomeVyOS Platform

IPv6 link local addresses are not configured when an interface is in a VRF
Closed, ResolvedPublicBUG

Description

When an interface is configured with a VRF and link local address, the link local address is not configured (ip a show eth0). This happens right after configuring the VRF on the interface (the previously configured link local address is removed) and on boot.

This also occurs on VyOS 1.3 built on 2022-03-11.

Details

Difficulty level
Easy (less than an hour)
Version
1.4-rolling-202203300217
Why the issue appeared?
Design mistake
Is it a breaking change?
Perfectly compatible
Issue type
Bug (incorrect behavior)

Related Objects

Mentioned In
1.3.2
1.3.2

Event Timeline

devon updated the task description. (Show Details)

Bug confirmed on 1.3.1-S1 and on 1.4-rolling-202203180317

To reproduce on fresh install:

Assign new ip address and validate:

vyos@vyos# set interfaces ethernet eth0 address 'fe80::5200:ff:fe55:5/64'
[edit]
vyos@vyos# commit
[edit]
vyos@vyos# sudo ifconfig eth0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::5200:ff:fe55:5  prefixlen 64  scopeid 0x20<link>
        inet6 fe80::5200:ff:fe06:0  prefixlen 64  scopeid 0x20<link>
        ether 50:00:00:06:00:00  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 18  bytes 2268 (2.2 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Then create vrf and validate that configrued ipv6 link local is no longer assgined to interface:

vyos@vyos# set vrf name TEST table '111'
[edit]
vyos@vyos# set interfaces ethernet eth0 vrf 'TEST'
[edit]
vyos@vyos# commit
[edit]
vyos@vyos# sudo ifconfig eth0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::5200:ff:fe06:0  prefixlen 64  scopeid 0x20<link>
        ether 50:00:00:06:00:00  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 26  bytes 3304 (3.2 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

But also, if new IPv6 address (any type) is assigned to interface, original ipv6 link local address is assigned correctly to interface:

vyos@vyos# set int eth eth0 address fe80::5200:ff:fe88:88/64
[edit]
vyos@vyos# commit
[edit]
vyos@vyos# sudo ifconfig eth0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::5200:ff:fe55:5  prefixlen 64  scopeid 0x20<link>
        inet6 fe80::5200:ff:fe06:0  prefixlen 64  scopeid 0x20<link>
        inet6 fe80::5200:ff:fe88:88  prefixlen 64  scopeid 0x20<link>
        ether 50:00:00:06:00:00  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 30  bytes 3856 (3.7 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

And finally, after reboot configured addresses are gone from interface.

From debug static address is assigned before vrf changes:
fe80::5208:ff:fe13:2 - autogenerated linklocal
fe80::5200:ff:fe55:222 - static linklocal

set interfaces ethernet eth2 address 'fe80::5200:ff:fe55:222/64'
set interfaces ethernet eth2 vrf 'foo'

Debug:

...
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'
...

expected address assign after vrf changes

Native linux doesn't move link-local addresses after attaching interface to vrf:

set interfaces ethernet eth2 address 'fe80::5200:ff:fe55:222/64'
set interfaces ethernet eth2 address '192.0.2.5/32'

Before vrf:

4: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 50:08:00:13:00:02 brd ff:ff:ff:ff:ff:ff
    inet 192.0.2.5/32 scope global eth2
       valid_lft forever preferred_lft forever
    inet6 fe80::5208:ff:fe13:2/64 scope link tentative 
       valid_lft forever preferred_lft forever
    inet6 fe80::5200:ff:fe55:222/64 scope link tentative 
       valid_lft forever preferred_lft forever

After vrf:

vyos@testrouter# sudo ip link set dev eth2 master foo

4: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master foo state UP group default qlen 1000
    link/ether 50:08:00:13:00:02 brd ff:ff:ff:ff:ff:ff
    inet 192.0.2.5/32 scope global eth2
       valid_lft forever preferred_lft forever
Viacheslav changed the task status from Open to In progress.Apr 5 2022, 10:16 AM
Viacheslav claimed this task.

PR https://github.com/vyos/vyos-1x/pull/1270

set interfaces ethernet eth2 address 'fe80::5200:ff:fe55:222/64'
set interfaces ethernet eth2 address '192.0.2.5/32'
set interfaces ethernet eth2 address '2002:2::2/120'
set interfaces ethernet eth2 vrf 'foo'

Check addresses:

vyos@testrouter# ip a show dev  eth2
4: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master foo state UP group default qlen 1000
    link/ether 50:08:00:13:00:02 brd ff:ff:ff:ff:ff:ff
    inet 192.0.2.5/32 scope global eth2
       valid_lft forever preferred_lft forever
    inet6 2002:2::2/120 scope global 
       valid_lft forever preferred_lft forever
    inet6 fe80::5208:ff:fe13:2/64 scope link 
       valid_lft forever preferred_lft forever
    inet6 fe80::5200:ff:fe55:222/64 scope link 
       valid_lft forever preferred_lft forever

Applying patch from the PR I could not reproduce issue anymore

@devon Will be fixed in the next rolling release, could you check it?

c-po edited projects, added VyOS 1.3 Equuleus (1.3.2); removed VyOS 1.3 Equuleus.
c-po changed Difficulty level from Unknown (require assessment) to Easy (less than an hour).
c-po changed Why the issue appeared? from Will be filled on close to Design mistake.
c-po changed Is it a breaking change? from Unspecified (possibly destroys the router) to Perfectly compatible.

@Viacheslav fix verified - also the new smoketest detected the bug prior to your fix and no longer seen the bug after your fix.

@Viacheslav Link local addresses were added successfully on boot on 1.4-rolling-202204060217.

c-po moved this task from In Progress to Finished on the VyOS 1.3 Equuleus (1.3.2) board.