Page MenuHomeVyOS Platform

The number of symbols for iproute2 kernel interface name is limited
Open, NormalPublicBUG

Description

If we try to add this interface, we'll get an error

set interfaces bonding bond250 vif-s 1000 vif-c 1234
commit

commit:

Traceback (most recent call last):
  File "/usr/libexec/vyos/conf_mode/interfaces_bonding.py", line 289, in <module>
    apply(c)
  File "/usr/libexec/vyos/conf_mode/interfaces_bonding.py", line 262, in apply
    b.update(bond)
  File "/usr/lib/python3/dist-packages/vyos/ifconfig/bond.py", line 476, in update
    super().update(config)
  File "/usr/lib/python3/dist-packages/vyos/ifconfig/interface.py", line 1762, in update
    c_vlan = VLANIf(vif_c_ifname, **tmp)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/vyos/ifconfig/interface.py", line 339, in __init__
    self._create()
  File "/usr/lib/python3/dist-packages/vyos/ifconfig/interface.py", line 1847, in _create
    self._cmd(cmd.format(**self.config))
  File "/usr/lib/python3/dist-packages/vyos/ifconfig/control.py", line 64, in _cmd
    return cmd(command, self.debug)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/vyos/utils/process.py", line 155, in cmd
    raise OSError(code, feedback)
OSError: [Errno 255] failed to run command: ip link add link bond250.1000 name bond250.1000.1234 type vlan id 1234
returned: 
exit code: 255

noteworthy:
cmd 'nft --check delete element inet vrf_zones ct_iface_map { "bond250" }'
returned (out):

returned (err):
Error: Could not process rule: No such file or directory
delete element inet vrf_zones ct_iface_map { bond250 }
                                             ^^^^^^^
cmd 'nft --check delete element inet vrf_zones ct_iface_map { "bond250.1000" }'
returned (out):

returned (err):
Error: Could not process rule: No such file or directory
delete element inet vrf_zones ct_iface_map { bond250.1000 }
                                             ^^^^^^^^^^^^
cmd 'ip link show dev bond250.1000.1234'
returned (out):

returned (err):
Device "bond250.1000.1234" does not exist.
cmd 'ip link show dev bond250.1000.1234'
returned (out):

returned (err):
Device "bond250.1000.1234" does not exist.
cmd 'ip link add link bond250.1000 name bond250.1000.1234 type vlan id 1234'
returned (out):

returned (err):
Error: argument "bond250.1000.1234" is wrong: "name" not a valid ifname

[[interfaces bonding bond250]] failed
Commit failed
[edit]
vyos@r4#

https://manpages.debian.org/bookworm/udev/systemd.link.5.en.html

Interface names must have a minimum length of 1 character and a maximum length of 15 characters

https://github.com/torvalds/linux/blob/2c71fdf02a95b3dd425b42f28fd47fb2b1d22702/include/uapi/linux/if.h#L33

Details

Difficulty level
Unknown (require assessment)
Version
VyOS 1.5-rolling-202404090019
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Bug (incorrect behavior)

Event Timeline

Viacheslav renamed this task from Number of symbols for iproute2 kernel interfaces are limited to Number of symbols for iproute2 kernel interface name are limited.Wed, Apr 10, 2:26 PM
Viacheslav renamed this task from Number of symbols for iproute2 kernel interface name are limited to The number of symbols for iproute2 kernel interface name is limited.Wed, Apr 10, 2:47 PM
Viacheslav triaged this task as Normal priority.Wed, Apr 10, 2:59 PM

An additional found old dhcp-client issue, does not properly support interface names with length > 13
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=858580
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=704072

Not sure about the current state, but could be the same

Propose to add names for the interfaces:

set interfaces ethernet eth2 vif-s 100 vif-c 300 name if9999
dmbaturin added a subscriber: dmbaturin.

The idea so far is to try to increase the IFNAMSIZ constant in the kernel and see if it works or blows up with applications we use.