仿生系统不支持 Netplan 绑定/桥接 MTU 设置

And*_*ree 2 networking network-bridge network-bonding netplan

我在 18.04 系统上运行 Netplan。我已经能够锻炼并将我的大部分网络配置从我的 16.04 系统转换为 18.04 的 Netplan,但是我现在在尝试将 MTU 设置为 9000 时遇到了问题一个 VLAN。

我的配置:

# 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
Run Code Online (Sandbox Code Playgroud)

我已将“mtu:9000”添加到作为绑定一部分的两个 NIC 以及 VLAN。我已经这样做了,因为将 'mtu: 9000' 添加到绑定接口或桥接接口会产生错误“未知密钥 mtu”

在任何情况下,该mtu: 9000设置都不会得到遵守,正如您在ip a(通知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
Run Code Online (Sandbox Code Playgroud)

那么我哪里出错了?使用 Netplan 设置 mtu 的正确方法是什么?我是否发现了需要报告的错误?

And*_*ree 5

我通过将 MTU 设置添加到“bonds:”和“bridges:”部分(从“ethernets:”部分中删除)中解决了这个问题。这是工作配置:

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