Modify

Opened 2 years ago

Last modified 2 years ago

#20393 new defect

netifd fails set MTU on VLAN devices

Reported by: stintel Owned by: developers
Priority: normal Milestone: Chaos Calmer 15.05
Component: base system Version: Trunk
Keywords: Cc: nbd

Description

When changing the MTU for a VLAN interface in /etc/config/network, the MTU is never actually set. Tried both old and new style config (https://lists.openwrt.org/pipermail/openwrt-devel/2014-September/027941.html).

Old:

config interface 'mgmt'
        option ifname 'eth0.51'
        option mtu '9000'
        option proto 'static'
        option ipaddr '192.168.51.254'
        option netmask '255.255.255.0'
        option ip6assign '64'
        option ip6hint '51'

New:

config device 'eth0.51'
        option type '8021q'
        option ifname 'eth0'
        option name 'eth0.51'
        option vid '51'
        option mtu '9000'

config interface 'mgmt'
        option ifname 'eth0.51'
        option proto 'static'
        option ipaddr '192.168.51.254'
        option netmask '255.255.255.0'
        option ip6assign '64'
        option ip6hint '51'

With either of the above configurations, running ifdown mgmt; ifup mgmt will not change the MTU for eth0.51:

root@ar0:~# ip link show dev eth0.51
48: eth0.51@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default
    link/ether 04:18:d6:31:38:b3 brd ff:ff:ff:ff:ff:ff

Changing the MTU manually doesn't work either:

root@ar0:~# ip link set mtu 9000 dev eth0.51
RTNETLINK answers: Numerical result out of range

This is because the MTU of the master interface is still on 1500. When I manually change the MTU of the master interface first, I can change the MTU of the VLAN interface as well:

root@ar0:~# ip link set mtu 9000 dev eth0.51
root@ar0:~# ip link show dev eth0.51
48: eth0.51@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc noqueue state UP mode DEFAULT group default
    link/ether 04:18:d6:31:38:b3 brd ff:ff:ff:ff:ff:ff

Once the MTU for the master interface is on 9000, both the old and new style configuration as shown above work fine. When running ifdown mgmt; ifup mgmt afterwards, the eth0.51 interface comes back up with MTU 9000.

Netifd should check the MTU of the master interface and change it if needed, before trying to set the MTU of the VLAN interface.

Attachments (0)

Change History (2)

comment:1 Changed 2 years ago by anonymous

Create an unmanaged interface for eth0 and set mtu

comment:2 Changed 2 years ago by roucaries.bastien@…

Ok something like this work:

config interface 'eth0'
        option ifname 'eth0'
        option proto 'none'
        option mtu '9000'

config interface 'eth0.51'
        option ifname 'eth0.51'
        option proto 'none'
        option mtu '9000'

Add Comment

Modify Ticket

Action
as new .
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.