Page MenuHomeVyOS Platform

Add an option to force interface MTU to the value received from DHCP
Closed, ResolvedPublicBUG

Description

All MTU configuration nodes contain a default value of 1500. This does not seem to be right, because those values override MTU that can be set from other sources - dynamically by DHCP client, for example, or even manually via custom scripts.
I think that it would be better to remove default values from there and allow using by default what a driver and Linux kernel suggest during interface initialization.

One of the obvious examples of the problem:

  1. Configure DHCP client on an interface.
  2. Get MTU via DHCP - it will be changed accordingly.
  3. Change any interface setting.
  4. MTU is back again to the default 1500 value.

Details

Difficulty level
Easy (less than an hour)
Version
1.4-rolling-202207270217, 1.3.1-S1
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Perfectly compatible
Issue type
Bug (incorrect behavior)

Event Timeline

zsdc changed the task status from Open to Confirmed.
zsdc triaged this task as Low priority.
zsdc added a project: VyOS 1.3 Equuleus.

Will it affect also tunnels/openvpn/wireguard/vxlan etc?
If you get rid of the default MTU values you get more pain.

I have no proof now of any obvious negative issues. Moreover, in my personal opinion - if some protocol or interface type requires a default MTU that is not assigned to it by the kernel, this is the problem that should be solved by configuration script for that particular interface.

Forcibly stretching the same MTU to all interfaces, regardless of other system components' logic, does not seems to be a good idea as well as missing default MTU for interfaces that may require it. Here I think that easier to assign MTU where this is really necessary than ignore it where it interferes with something.

Will it work if you replace this https://github.com/vyos/vyos-1x/blob/4168e03721b2a9595de4090fddf1280d39ccce4c/python/vyos/ifconfig/interface.py#L1378-L1379

sudo nano -c +1385 /usr/lib/python3/dist-packages/vyos/ifconfig/interface.py

with:

# MTU - Maximum Transfer Unit
#if 'mtu' in config:
#    self.set_mtu(config.get('mtu'))
if 'mtu' in config and 'dhcp' not in new_addr:
    self.set_mtu(config.get('mtu'))

To solve the issue with MTU over DHCP we can use some new options like mtu for example:

set interfaces ethernet eth0 dhcp-options mtu
Viacheslav changed the task status from Confirmed to Needs testing.Aug 4 2022, 3:11 PM
dmbaturin renamed this task from Remove default values in MTU nodes to Add an option to force interface MTU to the value received by DHCP.Aug 14 2022, 5:42 PM
dmbaturin renamed this task from Add an option to force interface MTU to the value received by DHCP to Add an option to force interface MTU to the value received from DHCP.
Viacheslav claimed this task.
Viacheslav moved this task from Need Triage to Finished on the VyOS 1.4 Sagitta board.
Viacheslav moved this task from Need Triage to Finished on the VyOS 1.3 Equuleus (1.3.2) board.