Page MenuHomeVyOS Platform

Trying to configure a non-existent physical interface causes an unhandled exception
Open, NormalPublicBUG

Description

If you try to configure something on a physical interface your system doesn't have, the result is an unhandled exception.

For example, if you try to configure eth1 on a system that only has eth0:

vyos@vyos# set interfaces ethernet eth1 address 10.0.0.1/24
[edit]
vyos@vyos# commit
[ interfaces ethernet eth1 ]
Traceback (most recent call last):
  File "/usr/libexec/vyos/services/vyos-configd", line 146, in run_script
    script.verify(c)
  File "/usr/libexec/vyos/conf_mode/interfaces_ethernet.py", line 377, in verify
    verify_ethernet(ethernet)
  File "/usr/libexec/vyos/conf_mode/interfaces_ethernet.py", line 405, in verify_ethernet
    verify_mtu(ethernet)
  File "/usr/lib/python3/dist-packages/vyos/configverify.py", line 39, in verify_mtu
    tmp = Interface(config['ifname'])
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/vyos/ifconfig/interface.py", line 351, in __init__
    self._create()
  File "/usr/lib/python3/dist-packages/vyos/ifconfig/interface.py", line 372, in _create
    self._cmd(cmd)
  File "/usr/lib/python3/dist-packages/vyos/ifconfig/control.py", line 66, in _cmd
    return cmd(command, self.debug, env=env)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/vyos/utils/process.py", line 189, in cmd
    raise OSError(code, feedback)
PermissionError: [Errno 1] failed to run command: None ip link add dev eth1
returned: 
exit code: 1

A proper error message about non-existent interface would be much better.

Details

Version
2025.11
Is it a breaking change?
Perfectly compatible
Issue type
Bug (incorrect behavior)