It is not possible to delete an interface in vm which was removed/detached from the hypervisor.
Add 3 interface
Configure eth2 interface
Remove from vm hardware eth2 nic
vyos@r2-roll:~$ show int Codes: S - State, L - Link, u - Up, D - Down, A - Admin Down Interface IP Address S/L Description --------- ---------- --- ----------- eth0 192.168.122.12/24 u/u eth1 - u/u foo lo 127.0.0.1/8 u/u ::1/128 vyos@r2-roll:~$
Conf mode
vyos@r2-roll# show interfaces ethernet eth0 { address 192.168.122.12/24 } ethernet eth1 { description foo } ethernet eth2 { address 100.64.0.1/30 } [edit] vyos@r2-roll#
Delete eth2
vyos@r2-roll# delete interfaces ethernet eth2 [edit] vyos@r2-roll# commit [ interfaces ethernet eth2 ] VyOS had an issue completing a command. We are sorry that you encountered a problem while using VyOS. There are a few things you can do to help us (and yourself): - Make sure you are running the latest version of the code available at https://downloads.vyos.io/rolling/current/amd64/vyos-rolling-latest.iso - Consult the forum to see how to handle this issue https://forum.vyos.io - Join our community on slack where our users exchange help and advice https://vyos.slack.com When reporting problems, please include as much information as possible: - do not obfuscate any data (feel free to contact us privately if your business policy requires it) - and include all the information presented below Report Time: 2020-08-10 21:01:14 Image Version: VyOS 1.3-rolling-202008101519 Release Train: equuleus Built by: [email protected] Built on: Mon 10 Aug 2020 15:19 UTC Build UUID: 1559e709-8201-423c-a839-bc640e610f45 Build Commit ID: 99114c57bad638 Architecture: x86_64 Boot via: installed image System type: KVM guest Hardware vendor: QEMU Hardware model: Standard PC (Q35 + ICH9, 2009) Hardware S/N: Hardware UUID: 707134eb-893f-4c31-97e2-8c3c1f8b702b Traceback (most recent call last): File "/usr/libexec/vyos/conf_mode/interfaces-ethernet.py", line 86, in <module> apply(c) File "/usr/libexec/vyos/conf_mode/interfaces-ethernet.py", line 73, in apply e = EthernetIf(ethernet['ifname']) File "/usr/lib/python3/dist-packages/vyos/ifconfig/interface.py", line 237, in __init__ self._create() File "/usr/lib/python3/dist-packages/vyos/ifconfig/interface.py", line 251, in _create self._cmd(cmd) File "/usr/lib/python3/dist-packages/vyos/ifconfig/control.py", line 51, in _cmd return cmd(command, self.debug) File "/usr/lib/python3/dist-packages/vyos/util.py", line 179, in cmd raise OSError(code, feedback) FileNotFoundError: [Errno 2] failed to run command: ip link add dev eth2 type ethernet returned: exit code: 2 noteworthy: cmd 'ip link add dev eth2 type ethernet' returned (out): returned (err): RTNETLINK answers: Operation not supported delete [ interfaces ethernet eth2 ] failed Commit failed [edit] vyos@r2-roll#
lspci
vyos@r2-roll# sudo lspci | grep -i eth 01:00.0 Ethernet controller: Red Hat, Inc Virtio network device (rev 01) 02:00.0 Ethernet controller: Red Hat, Inc Virtio network device (rev 01) [edit] vyos@r2-roll#