![Ubuntu 22.04 和 Open vSwitch 之间的 LACP:Ubuntu 既不响应也不发送 LACP PDU](https://linux22.com/image/790172/Ubuntu%2022.04%20%E5%92%8C%20Open%20vSwitch%20%E4%B9%8B%E9%97%B4%E7%9A%84%20LACP%EF%BC%9AUbuntu%20%E6%97%A2%E4%B8%8D%E5%93%8D%E5%BA%94%E4%B9%9F%E4%B8%8D%E5%8F%91%E9%80%81%20LACP%20PDU.png)
我有一个全新的 Ubuntu 22.04,在 KVM 中运行,带有 6 个 virtio 接口模拟 e1000。它连接到 Open vSwitch,交换机和 Ubuntu 上都配置了 LACP。
问题总结如下:当我在 bond0 中的任何接口上执行 tcpdump 时,我可以看到 ovs 发送的 LACP pdu,但没有看到 Ubuntu 的响应。Ubuntu 似乎也不会自行发送 LACP pdu。
我的配置详细信息如下:
/etc/netplan/00-installer-config.yaml
bonds:
bond0:
addresses: [192.168.201.141/24]
interfaces:
- enp2s0
- enp3s0
- enp4s0
- enp5s0
- enp6s0
- enp7s0
parameters:
mode: 802.3ad
mii-monitor-interval: 100
ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
link/ether 52:54:00:bd:d6:54 brd ff:ff:ff:ff:ff:ff
3: enp2s0: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc fq_codel master bond0 state UP mode DEFAULT group default qlen 1000
link/ether 32:4c:6b:d8:b0:dc brd ff:ff:ff:ff:ff:ff permaddr 52:54:00:aa:fb:bb
4: enp3s0: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc fq_codel master bond0 state UP mode DEFAULT group default qlen 1000
link/ether 32:4c:6b:d8:b0:dc brd ff:ff:ff:ff:ff:ff permaddr 52:54:00:0d:61:fc
5: enp4s0: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc fq_codel master bond0 state UP mode DEFAULT group default qlen 1000
link/ether 32:4c:6b:d8:b0:dc brd ff:ff:ff:ff:ff:ff permaddr 52:54:00:d4:cc:88
6: enp5s0: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc fq_codel master bond0 state UP mode DEFAULT group default qlen 1000
link/ether 32:4c:6b:d8:b0:dc brd ff:ff:ff:ff:ff:ff permaddr 52:54:00:79:8e:a0
7: enp6s0: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc fq_codel master bond0 state UP mode DEFAULT group default qlen 1000
link/ether 32:4c:6b:d8:b0:dc brd ff:ff:ff:ff:ff:ff permaddr 52:54:00:24:36:a7
8: enp7s0: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc fq_codel master bond0 state UP mode DEFAULT group default qlen 1000
link/ether 32:4c:6b:d8:b0:dc brd ff:ff:ff:ff:ff:ff permaddr 52:54:00:c7:90:3c
9: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
link/ether 32:4c:6b:d8:b0:dc brd ff:ff:ff:ff:ff:ff
我可以看到所有链接都是UP的。
/proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v5.15.0-86-generic
Bonding Mode: IEEE 802.3ad Dynamic link aggregation
Transmit Hash Policy: layer2 (0)
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Peer Notification Delay (ms): 0
802.3ad info
LACP active: on
LACP rate: slow
Min links: 0
Aggregator selection policy (ad_select): stable
System priority: 65535
System MAC address: 32:4c:6b:d8:b0:dc
Active Aggregator Info:
Aggregator ID: 1
Number of ports: 1
Actor Key: 0
Partner Key: 1
Partner Mac Address: 00:00:00:00:00:00
Slave Interface: enp7s0
MII Status: up
Speed: Unknown
Duplex: Unknown
Link Failure Count: 0
Permanent HW addr: 52:54:00:c7:90:3c
Slave queue ID: 0
Aggregator ID: 1
Actor Churn State: none
Partner Churn State: churned
Actor Churned Count: 0
Partner Churned Count: 1
details actor lacp pdu:
system priority: 65535
system mac address: 32:4c:6b:d8:b0:dc
port key: 0
port priority: 255
port number: 1
port state: 77
details partner lacp pdu:
system priority: 65535
system mac address: 00:00:00:00:00:00
oper key: 1
port priority: 255
port number: 1
port state: 1
<snip>
上述输出显示了参与者和合作伙伴的 pdu 详细信息,但 tcpdump 没有显示 Ubuntu 发送的 pdu。
此外,速度和双工也是未知的,很可能是因为底层接口是 virtio,但这可能是 Ubuntu 不发送 LACP pdu 的原因吗?
kvm 中接口的描述如下:
<interface type='bridge'>
<mac address='52:54:00:d4:cc:88'/>
<source bridge='ovsbr-lacp0'/>
<virtualport type='openvswitch'>
<parameters interfaceid='0e117751-fd45-4840-9c30-41ea8f76bdce'/>
</virtualport>
<model type='e1000'/>
<address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
</interface>
这是tcpdump
在 Open vSwitch 和 Ubuntu 上看到的输出。fe:54:00:c7:90:3c
是 ovs 中其中一个从属接口的 MAC,a6:a0:01:43:3a:41
是 ovs 中绑定接口的 MAC。
tcpdump -evni enp7s0
tcpdump: listening on enp7s0, link-type EN10MB (Ethernet), snapshot length 262144 bytes
19:41:47.129221 fe:54:00:c7:90:3c > 01:80:c2:00:00:02, ethertype Slow Protocols (0x8809), length 124: LACPv1, length 110
Actor Information TLV (0x01), length 20
System a6:a0:01:43:3a:41, System Priority 65534, Key 15, Port 17, Port Priority 65535
State Flags [Activity, Aggregation, Collecting, Distributing, Default]
Partner Information TLV (0x02), length 20
System 00:00:00:00:00:00, System Priority 0, Key 0, Port 0, Port Priority 0
State Flags [none]
Collector Information TLV (0x03), length 16
Max Delay 0
Terminator TLV (0x00), length 0
Ubuntu 似乎没有读取这个数据包,也没有向它发送响应,它甚至也没有生成自己的 LACP pdu。
我dmesg
可以看到这个日志:
[ 4722.457866] bond0: Warning: No 802.3ad response from the link partner for any adapters in the bond
[ 4752.513642] bond0: Warning: No 802.3ad response from the link partner for any adapters in the bond
这很奇怪,因为我可以在 tcpdump 中看到 ovs 发送的数据包。
有一个相关的问题这里看起来像我所处的情况,但解决方案并不适用于我的情况。
我已经检查了ovs端的所有内容,并且此主题显示结果。
我已经对 debugfoo 感到筋疲力尽了,任何能使它工作的线索都将非常感谢。
X。
PS: 我已经发布到询问 Ubuntu但没有任何回应,因此在此交叉发布以供更多受众查看。
答案1
我在另一组 VM 上再次尝试了这个操作,现在它可以正常工作了!
我能看到的区别是我在 netplan yml 中添加了接口,即:
network:
ethernets:
ens1:
addresses:
- 192.168.200.148/24
nameservers:
addresses:
- 8.8.8.8
- 8.8.4.4
routes:
- to: default
via: 192.168.200.1
enp2s11:
dhcp4: no
enp2s12:
dhcp4: no
enp2s13:
dhcp4: no
enp2s14:
dhcp4: no
enp2s15:
dhcp4: no
enp2s16:
dhcp4: no
enp2s17:
dhcp4: no
enp2s18:
dhcp4: no
bonds:
bond0:
addresses: [192.168.201.141/24]
interfaces:
- enp2s11
- enp2s12
- enp2s13
- enp2s14
- enp2s15
- enp2s16
- enp2s17
- enp2s18
parameters:
mode: 802.3ad
mii-monitor-interval: 100
renderer: networkd
version: 2
如果您注意到,设备 enp2s11 被添加了两次,第一次是在 ethernets 下,第二次是在 bond:interfaces 下。这是我能想到的与之前配置相比的唯一变化。
在OVS端:
sudo ovs-appctl bond/show bond0
---- bond0 ----
bond_mode: active-backup
bond may use recirculation: no, Recirc-ID : -1
bond-hash-basis: 0
lb_output action: disabled, bond-id: -1
updelay: 0 ms
downdelay: 0 ms
lacp_status: negotiated
lacp_fallback_ab: false
active-backup primary: <none>
active member mac: fe:54:00:7c:71:79(vnet365)
member vnet365: enabled
active member
may_enable: true
member vnet366: enabled
may_enable: true
member vnet367: enabled
may_enable: true
member vnet368: enabled
may_enable: true
member vnet369: enabled
may_enable: true
member vnet370: enabled
may_enable: true
member vnet371: enabled
may_enable: true
member vnet372: enabled
may_enable: true
我能够在同一个网络/交换机中的另一台主机之间进行 ping 操作,因此我猜它工作正常。