22.04 粘合混乱

22.04 粘合混乱

我正在努力进行绑定。我有一台 Cisco C220,正在尝试为我的 3 个端口中的 2 个(2 个 10Gb SFP+ 端口和 1GB 以太网端口)创建绑定。我有指向每个 IP 地址的设备,并且我正在为我的 10Gb 链路设置容错,以绑定 IP 192.168.1.203。我正在执行 netplan 和 NetworkManager 控制。我已经打开managed=true/etc/NetworkManager/conf.d/10-globally-managed-devices.conf

我的00-installer-config.yaml01-network-manager-all.yaml是相同的,嗯...因为我把意大利面条扔到墙上,而更改没有受到影响。这是文件内容...

network:
  version: 2
  renderer: NetworkManager
  ethernets:
    enp12s0:
      dhcp4: yes
    enp1s0f0:
      dhcp4: yes
    enp11s0:
      dhcp4: yes
  bonds:
    bond0:
      interfaces: [enp11s0, enp12s0]
      addresses: [192.168.1.203/24]
      routes:
       - to: default
         via: 192.168.1.254
      parameters:
        mode: balance-rr
        primary: enp11s0
        transmit-hash-policy: layer3+4
        mii-monitor-interval: 1
      nameservers:
        addresses:
          - "1.1.1.1"
          - "8.8.8.8"

我已经运行过... 然后sudo modprobe bonding 验证了粘合 ,甚至尝试过 ,但粘合仍未出现。sudo lsmod | grep bondingsudo netplan applysudo systemctl restart NetworkManager

重新启动我的路线表后......

root@solarczar-UCSC-C220-M4S:/etc/netplan# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         dsldevice.attlo 0.0.0.0         UG    100    0        0 enp11s0
default         dsldevice.attlo 0.0.0.0         UG    101    0        0 enp1s0f0
default         dsldevice.attlo 0.0.0.0         UG    102    0        0 enp12s0
link-local      0.0.0.0         255.255.0.0     U     1000   0        0 br-25af4793f0bf
172.17.0.0      0.0.0.0         255.255.0.0     U     0      0        0 docker0
172.18.0.0      0.0.0.0         255.255.0.0     U     0      0        0 br-034c84b50ce3
172.18.0.0      0.0.0.0         255.255.0.0     U     425    0        0 br-034c84b50ce3
172.20.0.0      0.0.0.0         255.255.0.0     U     0      0        0 br-d28a65ac3b60
172.20.0.0      0.0.0.0         255.255.0.0     U     432    0        0 br-d28a65ac3b60
172.21.0.0      0.0.0.0         255.255.0.0     U     0      0        0 br-e3aaad61e336
172.22.0.0      0.0.0.0         255.255.0.0     U     0      0        0 br-e73fd129b6e2
172.23.0.0      0.0.0.0         255.255.0.0     U     0      0        0 br-aafa86433ed6
172.23.0.0      0.0.0.0         255.255.0.0     U     431    0        0 br-aafa86433ed6
172.24.0.0      0.0.0.0         255.255.0.0     U     0      0        0 br-483ab991fc09
172.25.0.0      0.0.0.0         255.255.0.0     U     0      0        0 br-9b26775d9624
172.26.0.0      0.0.0.0         255.255.0.0     U     0      0        0 br-462e8ac3b66d
172.26.0.0      0.0.0.0         255.255.0.0     U     428    0        0 br-462e8ac3b66d
172.27.0.0      0.0.0.0         255.255.0.0     U     0      0        0 br-25af4793f0bf
172.28.0.0      0.0.0.0         255.255.0.0     U     0      0        0 br-2bd1f14da1c3
192.168.1.0     0.0.0.0         255.255.255.0   U     100    0        0 enp11s0
192.168.1.0     0.0.0.0         255.255.255.0   U     101    0        0 enp1s0f0
192.168.1.0     0.0.0.0         255.255.255.0   U     102    0        0 enp12s0

我甚至尝试过关闭链接,手动添加绑定,将链接分配给主服务器,然后打开绑定。绑定将显示在 ifconfig 中,但我无法向其发送流量,并且无法在重新启动后继续存在。我尝试打开接口systemdnetworkd取消/etc/network/interfaces散列文件,在硬重置之后,我没有以太网连接......假设存在冲突......所以我关闭了所有 systemd 元素并重新散列我的interfaces文件,做了sudo systemctl restart NetworkManager......然后它出现了。耶!见下文......

solarczar@solarczar-UCSC-C220-M4S:~$ sudo systemctl restart NetworkManager
solarczar@solarczar-UCSC-C220-M4S:~$ ip a
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: enp11s0: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master bond0 state UP group default qlen 1000
    link/ether 16:82:5d:cf:95:82 brd ff:ff:ff:ff:ff:ff permaddr 00:c8:8b:16:97:9f
    inet 192.168.1.161/24 brd 192.168.1.255 scope global enp11s0
       valid_lft forever preferred_lft forever
3: enp1s0f0: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master bond0 state UP group default qlen 1000
    link/ether 16:82:5d:cf:95:82 brd ff:ff:ff:ff:ff:ff permaddr cc:46:d6:fc:78:bc
    inet 192.168.1.201/24 brd 192.168.1.255 scope global enp1s0f0
       valid_lft forever preferred_lft forever
4: enp12s0: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master bond0 state UP group default qlen 1000
    link/ether 16:82:5d:cf:95:82 brd ff:ff:ff:ff:ff:ff permaddr 00:c8:8b:16:97:a0
    inet 192.168.1.202/24 brd 192.168.1.255 scope global enp12s0
       valid_lft forever preferred_lft forever
5: enp1s0f1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether cc:46:d6:fc:78:bd brd ff:ff:ff:ff:ff:ff
6: enp134s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether 00:c8:8b:16:6a:cd brd ff:ff:ff:ff:ff:ff
7: enp135s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether 00:c8:8b:16:6a:ce brd ff:ff:ff:ff:ff:ff
8: enx9cebe887681c: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
    link/ether 9c:eb:e8:87:68:1c brd ff:ff:ff:ff:ff:ff
9: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 16:82:5d:cf:95:82 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.203/24 brd 192.168.1.255 scope global bond0
       valid_lft forever preferred_lft forever
    inet6 fe80::1482:5dff:fecf:9582/64 scope link 
       valid_lft forever preferred_lft forever
10: br-034c84b50ce3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default 
    link/ether 02:42:92:52:fe:c5 brd ff:ff:ff:ff:ff:ff
    inet 172.18.0.1/16 brd 172.18.255.255 scope global br-034c84b50ce3
       valid_lft forever preferred_lft forever
    inet6 fe80::42:92ff:fe52:fec5/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
11: br-462e8ac3b66d: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default 
    link/ether 02:42:05:79:c8:00 brd ff:ff:ff:ff:ff:ff
    inet 172.26.0.1/16 brd 172.26.255.255 scope global br-462e8ac3b66d
       valid_lft forever preferred_lft forever
    inet6 fe80::42:5ff:fe79:c800/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
12: br-9b26775d9624: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default 
    link/ether 02:42:4b:e7:50:ef brd ff:ff:ff:ff:ff:ff
    inet 172.25.0.1/16 brd 172.25.255.255 scope global br-9b26775d9624
       valid_lft forever preferred_lft forever
13: br-d28a65ac3b60: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default 
    link/ether 02:42:c9:60:1c:95 brd ff:ff:ff:ff:ff:ff
    inet 172.20.0.1/16 brd 172.20.255.255 scope global br-d28a65ac3b60
       valid_lft forever preferred_lft forever
    inet6 fe80::42:c9ff:fe60:1c95/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
14: br-e3aaad61e336: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default 
    link/ether 02:42:09:20:4e:1a brd ff:ff:ff:ff:ff:ff
    inet 172.21.0.1/16 brd 172.21.255.255 scope global br-e3aaad61e336
       valid_lft forever preferred_lft forever
15: br-e73fd129b6e2: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default 
    link/ether 02:42:12:9f:28:a7 brd ff:ff:ff:ff:ff:ff
    inet 172.22.0.1/16 brd 172.22.255.255 scope global br-e73fd129b6e2
       valid_lft forever preferred_lft forever
16: br-25af4793f0bf: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default 
    link/ether 02:42:b5:e4:95:0b brd ff:ff:ff:ff:ff:ff
    inet 172.27.0.1/16 brd 172.27.255.255 scope global br-25af4793f0bf
       valid_lft forever preferred_lft forever
17: br-2bd1f14da1c3: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default 
    link/ether 02:42:45:a8:42:46 brd ff:ff:ff:ff:ff:ff
    inet 172.28.0.1/16 brd 172.28.255.255 scope global br-2bd1f14da1c3
       valid_lft forever preferred_lft forever
18: br-483ab991fc09: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default 
    link/ether 02:42:73:e7:38:45 brd ff:ff:ff:ff:ff:ff
    inet 172.24.0.1/16 brd 172.24.255.255 scope global br-483ab991fc09
       valid_lft forever preferred_lft forever
19: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default 
    link/ether 02:42:7e:7c:76:f7 brd ff:ff:ff:ff:ff:ff
    inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
       valid_lft forever preferred_lft forever
20: br-aafa86433ed6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default 
    link/ether 02:42:33:18:44:05 brd ff:ff:ff:ff:ff:ff
    inet 172.23.0.1/16 brd 172.23.255.255 scope global br-aafa86433ed6
       valid_lft forever preferred_lft forever
    inet6 fe80::42:33ff:fe18:4405/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
22: veth7bffbda@if21: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-d28a65ac3b60 state UP group default 
    link/ether 56:fc:6d:bb:41:5c brd ff:ff:ff:ff:ff:ff link-netnsid 2
    inet6 fe80::54fc:6dff:febb:415c/64 scope link 
       valid_lft forever preferred_lft forever
24: vetha7b00c2@if23: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-aafa86433ed6 state UP group default 
    link/ether 92:66:ca:bf:61:94 brd ff:ff:ff:ff:ff:ff link-netnsid 1
    inet6 fe80::9066:caff:febf:6194/64 scope link 
       valid_lft forever preferred_lft forever
26: vethdde6cd8@if25: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-034c84b50ce3 state UP group default 
    link/ether 7a:9b:55:c8:d4:71 brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet6 fe80::789b:55ff:fec8:d471/64 scope link 
       valid_lft forever preferred_lft forever
28: veth34bc713@if27: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-462e8ac3b66d state UP group default 
    link/ether de:6b:75:31:bb:4b brd ff:ff:ff:ff:ff:ff link-netnsid 3
    inet6 fe80::dc6b:75ff:fe31:bb4b/64 scope link 
       valid_lft forever preferred_lft forever
30: vethe43897a@if29: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-aafa86433ed6 state UP group default 
    link/ether ca:c2:5c:ea:d7:24 brd ff:ff:ff:ff:ff:ff link-netnsid 4
    inet6 fe80::c8c2:5cff:feea:d724/64 scope link 
       valid_lft forever preferred_lft forever
32: veth0af69ab@if31: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-034c84b50ce3 state UP group default 
    link/ether 0a:f8:44:8b:eb:5f brd ff:ff:ff:ff:ff:ff link-netnsid 6
    inet6 fe80::8f8:44ff:fe8b:eb5f/64 scope link 
       valid_lft forever preferred_lft forever
34: vethace271c@if33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-034c84b50ce3 state UP group default 
    link/ether d6:64:e2:58:13:5c brd ff:ff:ff:ff:ff:ff link-netnsid 5
    inet6 fe80::d464:e2ff:fe58:135c/64 scope link 
       valid_lft forever preferred_lft forever
solarczar@solarczar-UCSC-C220-M4S:~$ 
solarczar@solarczar-UCSC-C220-M4S:~$ route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         dsldevice.attlo 0.0.0.0         UG    0      0        0 enp12s0
link-local      0.0.0.0         255.255.0.0     U     1000   0        0 enp12s0
172.17.0.0      0.0.0.0         255.255.0.0     U     0      0        0 docker0
172.18.0.0      0.0.0.0         255.255.0.0     U     0      0        0 br-034c84b50ce3
172.18.0.0      0.0.0.0         255.255.0.0     U     425    0        0 br-034c84b50ce3
172.20.0.0      0.0.0.0         255.255.0.0     U     0      0        0 br-d28a65ac3b60
172.20.0.0      0.0.0.0         255.255.0.0     U     432    0        0 br-d28a65ac3b60
172.21.0.0      0.0.0.0         255.255.0.0     U     0      0        0 br-e3aaad61e336
172.22.0.0      0.0.0.0         255.255.0.0     U     0      0        0 br-e73fd129b6e2
172.23.0.0      0.0.0.0         255.255.0.0     U     0      0        0 br-aafa86433ed6
172.23.0.0      0.0.0.0         255.255.0.0     U     431    0        0 br-aafa86433ed6
172.24.0.0      0.0.0.0         255.255.0.0     U     0      0        0 br-483ab991fc09
172.25.0.0      0.0.0.0         255.255.0.0     U     0      0        0 br-9b26775d9624
172.26.0.0      0.0.0.0         255.255.0.0     U     0      0        0 br-462e8ac3b66d
172.26.0.0      0.0.0.0         255.255.0.0     U     428    0        0 br-462e8ac3b66d
172.27.0.0      0.0.0.0         255.255.0.0     U     0      0        0 br-25af4793f0bf
172.28.0.0      0.0.0.0         255.255.0.0     U     0      0        0 br-2bd1f14da1c3
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 bond0
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 enp1s0f0
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 enp12s0
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 enp11s0

好吧,我不能让它不管,因为我想看看它是否能经受住重启。所以我重启了,但它没有恢复。然后我又做了一次……

solarczar@solarczar-UCSC-C220-M4S:~$ sudo netplan apply
solarczar@solarczar-UCSC-C220-M4S:~$ route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         dsldevice.attlo 0.0.0.0         UG    100    0        0 enp11s0
default         dsldevice.attlo 0.0.0.0         UG    101    0        0 enp1s0f0
default         dsldevice.attlo 0.0.0.0         UG    102    0        0 enp12s0
link-local      0.0.0.0         255.255.0.0     U     1000   0        0 br-25af4793f0bf
172.17.0.0      0.0.0.0         255.255.0.0     U     0      0        0 docker0
172.18.0.0      0.0.0.0         255.255.0.0     U     0      0        0 br-034c84b50ce3
172.18.0.0      0.0.0.0         255.255.0.0     U     425    0        0 br-034c84b50ce3
172.20.0.0      0.0.0.0         255.255.0.0     U     0      0        0 br-d28a65ac3b60
172.20.0.0      0.0.0.0         255.255.0.0     U     432    0        0 br-d28a65ac3b60
172.21.0.0      0.0.0.0         255.255.0.0     U     0      0        0 br-e3aaad61e336
172.22.0.0      0.0.0.0         255.255.0.0     U     0      0        0 br-e73fd129b6e2
172.23.0.0      0.0.0.0         255.255.0.0     U     0      0        0 br-aafa86433ed6
172.23.0.0      0.0.0.0         255.255.0.0     U     431    0        0 br-aafa86433ed6
172.24.0.0      0.0.0.0         255.255.0.0     U     0      0        0 br-483ab991fc09
172.25.0.0      0.0.0.0         255.255.0.0     U     0      0        0 br-9b26775d9624
172.26.0.0      0.0.0.0         255.255.0.0     U     0      0        0 br-462e8ac3b66d
172.26.0.0      0.0.0.0         255.255.0.0     U     428    0        0 br-462e8ac3b66d
172.27.0.0      0.0.0.0         255.255.0.0     U     0      0        0 br-25af4793f0bf
172.28.0.0      0.0.0.0         255.255.0.0     U     0      0        0 br-2bd1f14da1c3
192.168.1.0     0.0.0.0         255.255.255.0   U     100    0        0 enp11s0
192.168.1.0     0.0.0.0         255.255.255.0   U     101    0        0 enp1s0f0
192.168.1.0     0.0.0.0         255.255.255.0   U     102    0        0 enp12s0

但它就是上不来!该死!我不知道我做了什么。又做了一次sudo systemctl restart NetworkManager,它还是上不来。

我已经花了一周的时间阅读,试图弄清楚,却毫无收获,于是我决定停下来,看看你们是否能发现我遗漏的东西。提前感谢你们的帮助

答案1

我想我有一个非常相似的问题,我一直在向墙上扔类似的意大利面条,卡住的那个非常不酷 - 这似乎与 netplan 本身无关,因为我已经从 16.04 一路升级了一个盒子,并且仍然有旧的接口配置,但绑定仍然不起作用

现在,您显然仍需要安装 ifenslave 才能使这些功能正常工作,一些教程会告诉您,让 netplan 配置覆盖 /etc/network/interfaces 和 /etc/network/interfaces.d 中的配置的方法是删除 ifupdown。对我来说,这删除了 ​​ifenslave,导致绑定无法工作。

我原以为修复方法是安装 ifenslave,但我仍然有点不确定为什么看起来并非如此。

然而,对我有用的是

ifenslave --detach bond0 eth0
ifenslave bond0 eth0

然后机器就按照广告宣传的那样运行了。

这不是一个很好的解决方案,虽然我可以将它添加到 rc.local 脚本中,但它给我留下了非常不好的感觉。

这可以存活下来netplan applysystemctl restart networking但无法存活下来,例如rmmod bonding modprobe bonding后面跟着的netplan apply

我知道这不是一个完整的答案,更多的是一种解决方法,但我不想再问另一个问题,因为我认为这或多或少是同一个问题


今天我发现只需运行就ip link dev eth0 up可以解决问题并使其正常运行。

我相信我们在升级过程中错过了一个步骤,这个步骤会使这一点变得无关紧要。 netplan migrate似乎不是 22.04 中的命令,虽然源代码(migrade.py)仍然存在,可能有办法运行它,但我没有任何运气。

相关内容