Page MenuHomeVyOS Platform

IPv6 link-local address is lost after an interface down/up outside a commit and is not restored
Open, NormalPublicBUG

Description

When an interface goes down and up outside a VyOS commit, it loses its IPv6 link-local (fe80) address and does not get it back until a later commit touches that interface. Global IPv6 addresses stay. VRRP addresses on the interface are lost too. Anything that needs the link-local is affected; for example bgpd then logs that the interface "does not have a v6 LL address".

Steps to reproduce

set interfaces dummy dum0 address 2001:db8::1/64
commit
ip -6 addr show dev dum0          # fe80::... present
sudo ip link set dev dum0 down
sudo ip link set dev dum0 up
ip -6 addr show dev dum0          # only 2001:db8::1/64, no fe80

A commit that touches the interface (for example a description change) adds the fe80 back.

Measured

  • Rolling (7216e748b): a plain dum0 and a VLAN on a VPP interface (eth1.100) behave the same.
  • 1.5.1: VLANs on a VPP bond and on a plain kernel bond behave the same. The VRRP addresses on those VLANs (virtual IPv6 address and VRRP link-local) were also lost and came back only after a commit.
  • ip link set up does not restore the link-local.

Cause

  • VyOS sets net.ipv6.conf.{all,default}.addr_gen_mode = 1 (src/etc/sysctl.d/31-vyos-addr_gen_mode.conf), so the kernel never creates a link-local address itself. VyOS adds it in Interface.update() (python/vyos/ifconfig/interface.py, "Manage IPv6 link-local addresses"), which runs only during a commit.
  • VyOS also sets keep_addr_on_down = 1 (src/etc/sysctl.d/30-vyos-router.conf, T669). The kernel then keeps global addresses on down, but still removes link-local addresses.
  • So any admin down/up that does not go through a commit leaves the interface without a link-local. T5769 hit the same for VTI tunnels; its fix (vyos-1x #2566) re-applies the interface settings on down/up in the VTI up/down script only.

How it happens in practice
Any admin down/up outside a commit: a manual ip link set, a script, or another component taking a link down. One such path: VPP linux-cp pushing a VLAN down during a netlink resync (T9481).

Suggested change
Restore the link-local address (and the other per-interface settings) when an interface comes back up outside a commit, for all interface types, as T5769 did for VTI. For example a link-up hook that re-applies the link-local the configuration asks for.

Details

Version
1.5.1, 1.5-rolling-20261018
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Bug (incorrect behavior)

Event Timeline

Reproduced on a VM (rolling, kernel 6.18.55-vyos) with the steps from the description:

  • After the commit dum0 has 2001:db8::1/64 and its fe80 address.
  • After ip link set dev dum0 down and up only 2001:db8::1/64 is left, the link-local address is gone.
  • A commit that touches the interface (I changed the description) brings the fe80 address back.

That matches the cause in the description: addr_gen_mode = 1 (31-vyos-addr_gen_mode.conf) keeps the kernel from creating link-local addresses, and VyOS adds them in Interface.update(), which only runs during a commit.

A link-up handler for all interface types would have to live somewhere that sees the event. vyos-netlinkd already listens for RTM_NEWLINK for DHCP and QoS, so it could be the place. Is that the direction the maintainers prefer, or a different mechanism (for example VTI-style up/down scripts like T5769)? I only reproduced the problem on a dummy interface and did not test VRRP or other interface types.

Viacheslav triaged this task as Normal priority.Tue, Oct 20, 6:53 AM