我最近安装了 Ubuntu Server 20.04 来替换 ESXi 服务器。在安装过程中,我为两个以太网接口配置了一个绑定接口。我将 ZyXel GS1900-8 上的键配置为静态 LAG。在设置过程中,链接成功建立并通过 DHCP 租用了 IP。
所有后续引导都未能获取绑定接口的 IP 地址。有时,如果我在被奴役的接口上允许 dhcp4 并运行sudo dhclient -r && sudo dhclient
,被奴役的接口将被租用一个 IP 地址,并且绑定将获得一个 IP 地址。我知道这是不合适的,因为 dhclient 和 systemd-networkd 不能混合使用。
另外,我想将其配置为 LACP 绑定。我在交换机上启用了 LACP,优先级为 65535 和“IP/MAC 地址”负载平衡算法,将 LAG 从静态切换到 LACP,并更改了 netplan 以使用 802.3ad 绑定模式。
请让我知道我在这里做错了什么,如果有的话。我在这里查看了尽可能多的 netplan DHCP 绑定帖子,但无济于事。有关配置文件和命令输出,请参见下文。
内容/etc/netplan/00-bond.yaml
:
network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: false
eth1:
dhcp4: false
bonds:
bond0:
dhcp4: true
interfaces:
- eth0
- eth1
parameters:
mode: 802.3ad
的输出sudo journalctl -b -u systemd-networkd
Dec 14 08:06:47 lore systemd[1]: Starting Network Service...
Dec 14 08:06:47 lore systemd-networkd[852]: bond0: netdev ready
Dec 14 08:06:47 lore systemd-networkd[852]: Enumeration completed.
Dec 14 08:06:47 lore systemd[1]: Started Network Service.
Dec 14 08:06:47 lore systemd-networkd[852]: bond0: IPv6 successfully enabled
Dec 14 08:06:47 lore systemd-networkd[852]: bond0: Link UP
Dec 14 08:08:53 lore systemd-networkd[852]: rtn1: received neighbor for link '7' we don't know about, ignoring.
Dec 14 08:08:53 lore systemd-networkd[852]: rtn1: received neighbor for link '7' we don't know about, ignoring.
Dec 14 08:08:53 lore systemd-networkd[852]: rtn1: received neighbor for link '7' we don't know about, ignoring.
Dec 14 08:08:53 lore systemd-networkd[852]: rtn1: received neighbor for link '7' we don't know about, ignoring.
Dec 14 08:08:53 lore systemd-networkd[852]: docker0: Link UP
输出sudo ip a
:
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
eno1: <BROADCAST,MULTICAST> mtu 1500 qdisk noop state DOWN group default qlen 1000
link/ether 0c:c4:7a:c6:c3:46 brd ff:ff:ff:ff:ff:ff
eno2: <BROADCAST,MULTICAST> mtu 1500 qdisk noop state DOWN group default qlen 1000
link/ether 0c:c4:7a:c6:c3:47 brd ff:ff:ff:ff:ff:ff
eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 0c:c4:7a:c6:c6:a2 brd ff:ff:ff:ff:ff:ff
eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 0c:c4:7a:c6:c6:a3 brd ff:ff:ff:ff:ff:ff
bond0: <NO-CARRIER,BROADCAST,MULTICAST,MASTER,UP> mtu 1500 qdisk noqueue state DOWN group default qlen 1000
link/ether 52:8b:2c:cc:a0:15 brd ff:ff:ff:ff:ff:ff
docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
link/ether 02:42:26:1c:1b:39 brd ff:ff:ff:ff:ff:ff
inet 172.17.0.1/16 brd 172.17.255.255 scope global docker 0
valid_lft forever preferred_lft forever
的内容/run/systemd/network/10-netplan-bond0.netdev
[NetDev]
Name=bond0
Kind=bond
[Bond]
Mode=802.3ad
的内容/run/systemd/network/10-netplan-bond0.network
[Match]
Name=bond0
[Network]
DHCP=ipv4
LinkLocalAddressing=ipv6
ConfigureWithoutCarrier=yes
[DHCP]
RouteMetric=100
UseMTU=true
的内容/run/systemd/network/10-netplan-eth0.network
[Match]
Name=eth0
[Network]
LinkLocalAddressing=no
Bond=bond0
的内容/run/systemd/network/10-netplan-eth1.network
[Match]
Name=eth1
[Network]
LinkLocalAddressing=no
Bond=bond0
的内容/proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
Bonding Mode: IEEE 802.3ad Dynamic link aggregation
Transmit Hash Policy: layer2 (0)
MII Status: down
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Peer Notification Delay (ms): 0
802.3ad info
LACP rate: slow
Min links: 0
Aggregator selection policy (ad_select): stable
发现这是由于命名冲突。发现
dmidecode -t 41
我的 MOBO 的 BIOS 错误地将四个 NIC 报告为只有两个类型的实例。因此,将两个 NIC 分配给 eno1,将两个 NIC 分配给 eno2。结果是我尝试使用的 NIC 在配置过程中被 udev 丢弃。