Page MenuHomeVyOS Platform

Failure to commit an IPv6 address on a tunnel interface
Closed, ResolvedPublicBUG


This was reported by @kroy on slack

vyos@vyos# commit
[ interfaces tunnel tun0 ]
Traceback (most recent call last):
  File "/usr/libexec/vyos/conf_mode/", line 489, in <module>
  File "/usr/libexec/vyos/conf_mode/", line 478, in apply
  File "/usr/lib/python3/dist-packages/vyos/ifconfig/", line 657, in add_addr
    return self._cmd(cmd)
  File "/usr/lib/python3/dist-packages/vyos/ifconfig/", line 44, in _cmd
    raise OSError(code, f'{command}\nreturned: {decoded}')
FileNotFoundError: [Errno 2] ip addr add "2a01:04f9:002b:f800::2/64" dev "tun0"
returned: RTNETLINK answers: File exists

VyOS attempted to add an IP address to an interface which already had it set up. This problem was previously harmless as the return code of the ip addr add command was not checked for success. This changed during the 1.3 dev cycle, and errors to run ip commands are now systematically reported to the user.

The code is already checking the IP address, and will only add IPs if not already present.
Unfortunately, IPv6 addresses are not sufficiently normalised when compared, which can lead to issues if users have added the IP themselves using ip addr add and not used the same IPv6 format.


def is_intf_addr_assigned(intf, addr)

Here we can see that trailing zero present the IP differently, but expending :: would lead to the same issue.

-> if addr == tmp:
(Pdb) addr
(Pdb) tmp


Difficulty level
Normal (likely a few hours)
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Bug (incorrect behavior)