Systemd 网桥在重新启动时具有自分配的 IP

Systemd 网桥在重新启动时具有自分配的 IP

运行 Ubuntu 22.04TrendNet 2.5Gbe PCIe 卡 我将 NIC enp3s0 绑定到网桥 br0,以便与我想要访问本地网络的 KVM 一起使用。使用 systemd-networkd 配置网桥可以正常工作(br0 是 enp3s0 的主站并接收 DHCP 租约),直到我重新启动主机。网桥将有一些自分配的 IP,例如 ip a 中的 172.19.0.x。如果我重新启动网络服务,网桥将正确接收 DHCP 租约。奇怪的是,在启动后和重置网络服务之前检查 jounralctl 时,它显示 br0 正在接收 DHCP 租约。有谁知道出了什么问题吗?这是我的 Journalctl -eu systemd-networkd 从重新启动开始并显示网络服务重新启动

-- Boot b5d8c30dd45c4118a5532486410ae807 --
Apr 22 22:50:34 theheartofgold systemd[1]: Starting Network Configuration...
Apr 22 22:50:34 theheartofgold systemd-networkd[1898]: br0: netdev ready
Apr 22 22:50:34 theheartofgold systemd-networkd[1898]: lo: Link UP
Apr 22 22:50:34 theheartofgold systemd-networkd[1898]: lo: Gained carrier
Apr 22 22:50:34 theheartofgold systemd-networkd[1898]: Enumeration completed
Apr 22 22:50:34 theheartofgold systemd[1]: Started Network Configuration.
Apr 22 22:50:34 theheartofgold systemd-networkd[1898]: br0: Link UP
Apr 22 22:50:34 theheartofgold systemd-networkd[1898]: enp3s0: Link UP
Apr 22 22:50:38 theheartofgold systemd-networkd[1898]: enp3s0: Gained carrier
Apr 22 22:50:38 theheartofgold systemd-networkd[1898]: br0: Gained carrier
Apr 22 22:50:40 theheartofgold systemd-networkd[1898]: br0: Gained IPv6LL
Apr 22 22:50:41 theheartofgold systemd-networkd[1898]: br0: DHCPv6 address 2601:240:8100:9810::cd19/128 (valid for 1w, preferred for 1w)
Apr 22 22:50:42 theheartofgold systemd-networkd[1898]: br0: DHCPv4 address 10.0.0.172/24 via 10.0.0.1              <------ Says that br0 received a lease but "ip a" does not reflect this and no network access
Apr 22 22:50:44 theheartofgold systemd-networkd[1898]: nebula1: Link UP
Apr 22 22:50:44 theheartofgold systemd-networkd[1898]: nebula1: Gained carrier
Apr 22 22:50:44 theheartofgold systemd-networkd[1898]: nebula1: Gained IPv6LL
Apr 22 22:50:46 theheartofgold systemd-networkd[1898]: br-f1781ea40a8c: Link UP
Apr 22 22:50:46 theheartofgold systemd-networkd[1898]: br-89c82a376cdf: Link UP
Apr 22 22:50:47 theheartofgold systemd-networkd[1898]: vethb69aed5: Link UP
Apr 22 22:50:47 theheartofgold systemd-networkd[1898]: veth8dbe0f6: Link UP
Apr 22 22:50:47 theheartofgold systemd-networkd[1898]: br-89c82a376cdf: Gained carrier
Apr 22 22:50:47 theheartofgold systemd-networkd[1898]: br-89c82a376cdf: Lost carrier
Apr 22 22:50:48 theheartofgold systemd-networkd[1898]: vethb69aed5: Gained carrier
Apr 22 22:50:48 theheartofgold systemd-networkd[1898]: veth8dbe0f6: Gained carrier
Apr 22 22:50:48 theheartofgold systemd-networkd[1898]: br-89c82a376cdf: Gained carrier
Apr 22 22:50:49 theheartofgold systemd-networkd[1898]: br-89c82a376cdf: Gained IPv6LL
Apr 22 22:50:49 theheartofgold systemd-networkd[1898]: vethb69aed5: Gained IPv6LL
Apr 22 22:50:50 theheartofgold systemd-networkd[1898]: veth8dbe0f6: Gained IPv6LL
Apr 22 22:51:49 theheartofgold systemd[1]: Stopping Network Configuration...         <---- This is when I reset networkd-systemd.service
Apr 22 22:51:49 theheartofgold systemd-networkd[1898]: br0: DHCPv6 lease lost
Apr 22 22:51:49 theheartofgold systemd[1]: systemd-networkd.service: Deactivated successfully.
Apr 22 22:51:49 theheartofgold systemd[1]: Stopped Network Configuration.
Apr 22 22:51:49 theheartofgold systemd[1]: Starting Network Configuration...
Apr 22 22:51:49 theheartofgold systemd-networkd[4856]: veth8dbe0f6: Link UP
Apr 22 22:51:49 theheartofgold systemd-networkd[4856]: veth8dbe0f6: Gained carrier
Apr 22 22:51:49 theheartofgold systemd-networkd[4856]: vethb69aed5: Link UP
Apr 22 22:51:49 theheartofgold systemd-networkd[4856]: vethb69aed5: Gained carrier
Apr 22 22:51:49 theheartofgold systemd-networkd[4856]: br-89c82a376cdf: Link UP
Apr 22 22:51:49 theheartofgold systemd-networkd[4856]: br-89c82a376cdf: Gained carrier
Apr 22 22:51:49 theheartofgold systemd-networkd[4856]: br-f1781ea40a8c: Link UP
Apr 22 22:51:49 theheartofgold systemd-networkd[4856]: nebula1: Link UP
Apr 22 22:51:49 theheartofgold systemd-networkd[4856]: nebula1: Gained carrier
Apr 22 22:51:49 theheartofgold systemd-networkd[4856]: br0: netdev ready
Apr 22 22:51:49 theheartofgold systemd-networkd[4856]: br0: Link UP
Apr 22 22:51:49 theheartofgold systemd-networkd[4856]: br0: Gained carrier
Apr 22 22:51:49 theheartofgold systemd-networkd[4856]: enp3s0: Link UP
Apr 22 22:51:49 theheartofgold systemd-networkd[4856]: enp3s0: Gained carrier
Apr 22 22:51:49 theheartofgold systemd-networkd[4856]: lo: Link UP
Apr 22 22:51:49 theheartofgold systemd-networkd[4856]: lo: Gained carrier
Apr 22 22:51:49 theheartofgold systemd-networkd[4856]: veth8dbe0f6: Gained IPv6LL
Apr 22 22:51:49 theheartofgold systemd-networkd[4856]: vethb69aed5: Gained IPv6LL
Apr 22 22:51:49 theheartofgold systemd-networkd[4856]: br-89c82a376cdf: Gained IPv6LL
Apr 22 22:51:49 theheartofgold systemd-networkd[4856]: nebula1: Gained IPv6LL
Apr 22 22:51:49 theheartofgold systemd-networkd[4856]: br0: Gained IPv6LL
Apr 22 22:51:49 theheartofgold systemd-networkd[4856]: Enumeration completed
Apr 22 22:51:49 theheartofgold systemd[1]: Started Network Configuration.
Apr 22 22:51:49 theheartofgold systemd-networkd[4856]: br0: netdev exists, using existing without changing its parameters
Apr 22 22:51:50 theheartofgold systemd-networkd[4856]: br0: DHCPv4 address 10.0.0.172/24 via 10.0.0.1        <---- DHCP Lease now shows up in "ip a" and have network access
Apr 22 22:51:50 theheartofgold systemd-networkd[4856]: br0: DHCPv6 address 2601:240:8100:9810::cd19/128 (valid for 1w, preferred for 1w)

我相信其他 br 和 veth 设备是由 docker 创建的。

这也是我的网络配置。

theheartofgold:/etc/systemd/network$ cat 20-wired.network
[Match]
Name=enp3s0

[Network]
DHCP=ipv4

theheartofgold:/etc/systemd/network$ cat br0.network
[Match]
Name=br0

[Network]
DHCP=ipv4

theheartofgold:/etc/systemd/network$ cat br0.netdev
[NetDev]
Name=br0
Kind=bridge

theheartofgold:/etc/systemd/network$ cat 10-bind.network
[Match]
Name=enp3s0

[Network]
Bridge=br0

相关内容