Can't set MTU for VxLAN using Luci

When we change the MTU of a VxLAN in the device page, it's not applied to the VxLAN. What I found is that the parameter is written in the device section of the /etc/config/network instead of interface so the VxLAN proto doesn't process it.

config interface 'vxlan55'
        option proto 'vxlan'
        option peeraddr '8.8.8.8'
        option vid '55'
        option wan_bind '1'
config device
        option name 'vxlan55'
        option mtu '9000'

The /lib/netifd/proto/vxlan.sh is responsable to get the configuration and so I did a little workaround to grab the MTU from the device section that I will post.

The issue started with this commit that remove the MTU configuration from the interface page:
treewide: drop MAC and MTU from interfaces (protocols)
https://github.com/openwrt/luci/commit/79947af064122438c803f3b7bc580ede093a26e4

Since VxLAN is a layer 2 protocol I assume the best way will be to move it entirely in the device page and not in the interface section. I'm open to feedback on this.
thanks a lot

1 Like