2

I'm running Netplan on an 18.04 system. I've been able to workout and convert most of my network configuration from my 16.04 systems to Netplan for 18.04, however I've run into an issue now when trying to set the MTU to 9000 on a bridge that uses a bond that is part of a VLAN.

My configuration:

# Ceph network configuration
network:
  version: 2
  renderer: networkd
  ethernets:
    eth2:
      dhcp4: no
      dhcp6: no
      optional: true
      mtu: 9000
    eth3:
      dhcp4: no
      dhcp6: no
      optional: true
      mtu: 9000
  bonds:
    bond1:
      interfaces: [ eth2, eth3 ]
      parameters:
        mode: 802.3ad
        mii-monitor-interval: 100
        lacp-rate: fast
  vlans:
    bond1.220:
      id: 220
      link: bond1
      mtu: 9000
  bridges:
    br-ceph-access:
      addresses: [ x.x.x.x/24 ]
      interfaces: [ bond1.220 ]
      parameters:
        forward-delay: 9
        hello-time: 2
        max-age: 12
        stp: false

I've added 'mtu: 9000' to both NICs that are part of the bond, and to the VLAN as well. I've done this, because the adding 'mtu: 9000' to the bond interface or the bridge interface produces the error "unknown key mtu"

In any case, the mtu: 9000 setting is not honored, as you can see here in the relevant sections of ip a (notice mtu 15000):

4: eth2: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master bond1 state UP group default qlen 1000
    link/ether b2:07:76:18:10:5b brd ff:ff:ff:ff:ff:ff
5: eth3: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master bond1 state UP group default qlen 1000
    link/ether b2:07:76:18:10:5b brd ff:ff:ff:ff:ff:ff
10: br-ceph-access: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    link/ether 4e:b5:52:25:a4:c5 brd ff:ff:ff:ff:ff:ff
    inet x.x.x.x/24 brd 172.16.238.255 scope global br-ceph-access
       valid_lft forever preferred_lft forever
11: bond1: <BROADCAST,MULTICAST,MASTER> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether b2:07:76:18:10:5b brd ff:ff:ff:ff:ff:ff

So where am I going wrong here? What is the proper way to set mtu with Netplan? Have I discovered a bug that needs to be reported?

1

I think you want to match devices by MAC address, otherwise it's hard for systemd-networkd to know exactly which devices to apply the MTU to. You should also specify the MTU is 9000 for the bond itself, as its options will be applied to the underlying interfaces when they are added to the bond:

network:
  version: 2
  renderer: networkd
  ethernets:
    eth2:
      match:
        macaddress: 00:00:aa:bb:cc:dd
      dhcp4: no
      dhcp6: no
      optional: true
      mtu: 9000
    eth3:
      match:
        macaddress: 01:01:aa:bb:cc:de
      dhcp4: no
      dhcp6: no
      optional: true
      mtu: 9000
  bonds:
    bond1:
      mtu: 9000
      interfaces: [ eth2, eth3 ]
      parameters:
        mode: 802.3ad
        mii-monitor-interval: 100
        lacp-rate: fast
  vlans:
    bond1.220:
      id: 220
      link: bond1
      mtu: 9000
  bridges:
    br-ceph-access:
      addresses: [ x.x.x.x/24 ]
      interfaces: [ bond1.220 ]
      parameters:
        forward-delay: 9
        hello-time: 2
        max-age: 12
        stp: false

Watch out though, matching devices comes with its own set of issues; see https://github.com/CanonicalLtd/netplan/commit/a27122bc8d8e066b1a90a7fd8d65342e8b906a8e

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.