Netplan eth 和 Wi-Fi 绑定然后桥接 ubuntu 22.04

Netplan eth 和 Wi-Fi 绑定然后桥接 ubuntu 22.04

尝试设置网络绑定,然后使用 netplan 在桥接中使用该绑定。绑定在 proc 下正确显示,但拉动以太网不会导致故障转移到 Wi-Fi。我的 netplan 配置文件如下:

# Let NetworkManager manage all devices on this system
network:
  version: 2
  renderer: networkd
  ethernets:
    enp1s0:
      dhcp4: true
      dhcp6: no
  wifis:
    wlp2s0:
      dhcp4: true
      dhcp6: no
      access-points:
        "<removed>":
          password: "<removed>"
      regulatory-domain: 'GB'
  bonds:
    bond0:
      dhcp4: no
      interfaces:
        - enp1s0
        - wlp2s0
      parameters:
        mode: active-backup
        fail-over-mac-policy: none
        primary-reselect-policy: always
        primary: enp1s0
        mii-monitor-interval: 100
        min-links: 1
  vlans:
    vlan0:
      id: 0
      link: bond0
  bridges:
    br0:
      dhcp4: no
      dhcp6: no
      interfaces:
        - bond0
      mtu: 1500
      addresses:
        - '192.168.1.84/24'
      nameservers:
        addresses:
          - 192.168.1.1
      routes:
        - to: default
          via: 192.168.1.1
      parameters:
        forward-delay: 4

如果我不使用网桥,而只是为系统配置一个绑定,它将正确启动并按预期运行,即拔下以太网会强制连接到 Wi-Fi,然后在恢复以太网后切换回来。但是当我将网桥设置为使用 bond0 时,故障转移不再起作用,并且只有在插入以太网时才能 ping 接口。

$ cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v6.2.0-37-generic

Bonding Mode: fault-tolerance (active-backup)
Primary Slave: enp1s0 (primary_reselect always)
Currently Active Slave: enp1s0
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Peer Notification Delay (ms): 0

Slave Interface: enp1s0
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 8c:04:ba:9c:3c:4f
Slave queue ID: 0

Slave Interface: wlp2s0
MII Status: up
Speed: Unknown
Duplex: Unknown
Link Failure Count: 0
Permanent HW addr: 40:5b:d8:59:7a:fb
Slave queue ID: 0

我尝试过从 networkd 切换到 NetworkManager,尝试过有或没有 VLAN 配置。任何帮助都将不胜感激。

相关内容