0

OS: Ubuntu 18.04.1 LTS (server)

Netplan version: 0.98-0ubuntu1~18.04.1

I'm trying to configure 2 VLANs on a single physical interface with different MTUs. I'm able to get the MTU on the physical interface to 9000, however it seems that all of the VLANs slaved to this device also inherit 9000. I added mtu: 1500 to the affected VLAN, but that does not take effect. I noticed that the mtu keyword is not available for VLANs in the Netplan reference. How do I get netplan to change a VLAN's MTU?

I can change it manually just fine: sudo ip link set mtu 1500 dev vl_lan

And it seems that netplan is parsing the YAML just fine:

user@host:~$ cat /run/systemd/network/10-netplan-vl_lan.netdev 
[NetDev]
Name=vl_lan
MTUBytes=1500
Kind=vlan

[VLAN]
Id=10

Below is my netplan file from /etc/netplan

network:
    version: 2
    ethernets:
        eno1:
            match:
                macaddress: 38:ea:a7:91:5d:d8
            dhcp4: false
            accept-ra: no
            set-name: eno1
            mtu: 9000
        eno2:
            match:
                macaddress: 38:ea:a7:91:5d:d9
            dhcp4: false
            accept-ra: no
            optional: true
            set-name: eno2
    vlans:
        vl_lan:
            accept-ra: no
            id: 10
            link: eno1
            mtu: 1500
            addresses: [ 10.102.0.14/23 ]
            gateway4: 10.102.0.1
            nameservers:
                addresses: [ 10.102.0.1 ]
                search: [ "removed", "removed" ]
        vl_san:
            accept-ra: no
            id: 14
            link: eno1
            mtu: 9000
            addresses: [ 10.102.4.14/24 ]

This is the resulting configuration after a fresh boot-up. Everything is correct except for the MTU for the vl_lan VLAN:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc mq state UP group default qlen 1000
    link/ether 38:ea:a7:91:5d:d8 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::3aea:a7ff:fe91:5dd8/64 scope link 
       valid_lft forever preferred_lft forever
3: eno2: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether 38:ea:a7:91:5d:d9 brd ff:ff:ff:ff:ff:ff
4: vl_lan@eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc noqueue state UP group default qlen 1000
    link/ether 38:ea:a7:91:5d:d8 brd ff:ff:ff:ff:ff:ff
    inet 10.102.0.14/23 brd 10.102.1.255 scope global vl_lan
       valid_lft forever preferred_lft forever
    inet6 fe80::3aea:a7ff:fe91:5dd8/64 scope link 
       valid_lft forever preferred_lft forever
5: vl_san@eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc noqueue state UP group default qlen 1000
    link/ether 38:ea:a7:91:5d:d8 brd ff:ff:ff:ff:ff:ff
    inet 10.102.4.14/24 brd 10.102.4.255 scope global vl_san
       valid_lft forever preferred_lft forever
    inet6 fe80::3aea:a7ff:fe91:5dd8/64 scope link 
       valid_lft forever preferred_lft forever

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.