For the vitual-interface changing mtu settings is wrongly implemented.
Vyos allows only mtu setting in the vif-interface. But it does not allow setting the mtu on the parent interface which is the virtual-interface itself.
So, this is implemented wrongly. The maintainer must allow to configure mtu at the base-interface level first, then v-if or sub-interface should automatically inherit that or allow the option to set it separately.
[edit interfaces virtual-ethernet veth2] vyos@vyos# show peer-name veth200 vif 10 { address 10.0.0.5/30 } Then if I try to set the mtu on the vif - [edit interfaces virtual-ethernet veth2] vyos@vyos# compare [veth2 vif 10] + mtu "9000"
As expected - the base interface here is - veth2 as it's mtu is 1500 and we cannot change it from vyos-cli it will fail -
Traceback (most recent call last): File "/usr/libexec/vyos/conf_mode/interfaces_virtual-ethernet.py", line 110, in <module> apply(c) File "/usr/libexec/vyos/conf_mode/interfaces_virtual-ethernet.py", line 100, in apply p.update(veth) File "/usr/lib/python3/dist-packages/vyos/ifconfig/interface.py", line 1944, in update vlan.update(vif_config) File "/usr/lib/python3/dist-packages/vyos/ifconfig/interface.py", line 1769, in update self.set_mtu(config.get('mtu')) File "/usr/lib/python3/dist-packages/vyos/ifconfig/interface.py", line 465, in set_mtu return self.set_interface('mtu', mtu) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/vyos/ifconfig/control.py", line 195, in set_interface return self._set_command(self.config, name, value) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/vyos/ifconfig/control.py", line 122, in _set_command return self._command_set[name].get('format', lambda _: _)(self._cmd(cmd)) ^^^^^^^^^^^^^^ 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) FileNotFoundError: [Errno 2] failed to run command: ip link set dev veth2.10 mtu 9000 returned: exit code: 2 noteworthy: cmd 'ip link set dev veth2.10 mtu 9000' returned (out): returned (err): RTNETLINK answers: Numerical result out of range [[interfaces virtual-ethernet veth2]] failed Commit failed [edit interfaces virtual-ethernet veth2]
But now - if I go to underlying linux and change the base-int mtu first, then I can chnage vif's mtu also.
root@vyos:~# echo 9000 > /sys/class/net/veth2/mtu
Now I can try the commit again, it will work because base interface mtu is changed.
vyos@vyos# compare [veth2 vif 10] + mtu "9000" [edit interfaces virtual-ethernet veth2] vyos@vyos# commit [edit interfaces virtual-ethernet veth2] vyos@vyos#
Vyos maintainer kindly fix this. The developer just needs to implement an MTU command on the base interface.
Thanks in advance