我已成功使用 netplan 通过 Unifi 交换机通过 bond0(LACP 中的 enp6s0 和 enp7s0)与我的网络的其余部分建立 2Gbps 连接。
我现在遇到的问题是连接丢失。当我更新交换机固件或需要拔掉它等时,服务器无法重新连接到网络。此外,当我从网卡上拔下一根电缆并在几分钟后重新插入时,该接口显示连接良好,但没有流量,而另一个接口工作正常。
我发现恢复它的唯一方法是完全重置。
我已经尝试过了netplan --debug apply
,它告诉我基本上一切正常,不需要做任何事情。
任何建议都将不胜感激,请告诉我我是不是个白痴以及原因。此外,如果我的 .yaml 中还有其他突出的问题,请告诉我。
我的网络配置.yaml:
network:
version: 2
renderer: networkd
ethernets:
enp6s0:
match:
macaddress: 00:25:90:04:f6:5a
enp7s0:
match:
macaddress: 00:25:90:04:f6:5b
bonds:
bond0:
interfaces:
- enp6s0
- enp7s0
parameters:
mode: 802.3ad
lacp-rate: fast
transmit-hash-policy: layer2+3
dhcp4: true
netplan --debug apply
拔出并重新插入 enp6s0 时的输出:
** (generate:11383): DEBUG: 22:04:11.180: Processing input file
//etc/netplan/01-netcfg.yaml..
** (generate:11383): DEBUG: 22:04:11.180: starting new processing pass
** (generate:11383): DEBUG: 22:04:11.180: Processing input file
//etc/netplan/50-cloud-init.yaml..
** (generate:11383): DEBUG: 22:04:11.180: starting new processing pass
** (generate:11383): DEBUG: 22:04:11.180: enp7s0: setting default backend to 1
** (generate:11383): DEBUG: 22:04:11.180: bond0: setting default backend to 1
** (generate:11383): DEBUG: 22:04:11.180: enp6s0: setting default backend to 1
** (generate:11383): DEBUG: 22:04:11.180: Generating output files..
** (generate:11383): DEBUG: 22:04:11.180: NetworkManager: definition enp7s0 is not for us (backend 1)
** (generate:11383): DEBUG: 22:04:11.181: NetworkManager: definition bond0 is not for us (backend 1)
** (generate:11383): DEBUG: 22:04:11.181: NetworkManager: definition enp6s0 is not for us (backend 1)
DEBUG:netplan generated networkd configuration exists, restarting networkd
DEBUG:no netplan generated NM configuration exists
DEBUG:device enp7s0 operstate is up, not replugging
DEBUG:netplan triggering .link rules for enp7s0
DEBUG:device veth1ec269a operstate is up, not replugging
DEBUG:netplan triggering .link rules for veth1ec269a
DEBUG:device veth6251ba2 operstate is up, not replugging
DEBUG:netplan triggering .link rules for veth6251ba2
DEBUG:device bond0 operstate is up, not replugging
DEBUG:netplan triggering .link rules for bond0
DEBUG:device enp6s0 operstate is up, not replugging
DEBUG:netplan triggering .link rules for enp6s0
DEBUG:device docker0 operstate is up, not replugging
DEBUG:netplan triggering .link rules for docker0
DEBUG:device lo operstate is unknown, not replugging
DEBUG:netplan triggering .link rules for lo
ip a
拔下并重新插入 enp6s0 后的输出:
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: enp6s0: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc fq_codel master bond0 state UP group default qlen 1000
link/ether 4a:93:c6:63:32:84 brd ff:ff:ff:ff:ff:ff
3: enp7s0: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc fq_codel master bond0 state UP group default qlen 1000
link/ether 4a:93:c6:63:32:84 brd ff:ff:ff:ff:ff:ff
4: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 4a:93:c6:63:32:84 brd ff:ff:ff:ff:ff:ff
inet 172.16.25.8/24 brd 172.16.25.255 scope global dynamic bond0
valid_lft 85571sec preferred_lft 85571sec
inet6 fe80::4893:c6ff:fe63:3284/64 scope link
valid_lft forever preferred_lft forever
5: docker0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
link/ether 02:42:46:ee:01:b9 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
inet6 fe80::42:46ff:feee:1b9/64 scope link
valid_lft forever preferred_lft forever
11: veth1ec269a@if10: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master docker0 state UP group default
link/ether 0a:40:a5:91:b8:f3 brd ff:ff:ff:ff:ff:ff link-netnsid 1
inet6 fe80::840:a5ff:fe91:b8f3/64 scope link
valid_lft forever preferred_lft forever
147: vethc49639f@if146: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master docker0 state UP group default
link/ether a6:f3:3b:c1:52:be brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet6 fe80::a4f3:3bff:fec1:52be/64 scope link
valid_lft forever preferred_lft forever
root@jon-server:/home/root/logs#
答案1
尝试mii-monitor-interval: 100
在参数部分下添加。生成并再次应用。