Linux-Networking

在 debian9 上使用 systemd 設置網橋時出現太多符號連結錯誤

  • December 27, 2017

重新啟動後主機無法訪問,我在日誌中看到此錯誤vmbr0: Could not join netdev: Too many levels of symbolic links我真的不知道是什麼原因造成的,我在 Google 上找不到任何東西

Dec 27 20:31:30 host8 systemd-networkd[448]: vmbr0: netdev ready
Dec 27 20:31:30 host8 systemd-networkd[448]: Enumeration completed
Dec 27 20:31:30 host8 systemd-networkd[448]: eth0: Renamed to eno1
Dec 27 20:31:30 host8 systemd-networkd[448]: vmbr0: Could not join netdev: Too many levels of symbolic links
Dec 27 20:31:30 host8 systemd-networkd[448]: vmbr0: Failed
Dec 27 20:31:30 host8 systemd-networkd[448]: eno1: IPv6 disabled for interface: Success
Dec 27 20:31:30 host8 systemd-networkd[448]: eno1: Gained carrier

這是我的網橋設置:

# /etc/systemd/network/50-default.network
[Match]
MACAddress=a4:bf:01:26:XX:XX

[Network]
Bridge=vmbr0

# /etc/systemd/network/50-public-interface.link
[Match]
MACAddress=a4:bf:01:26:XX:XX

[Link]
MACAddressPolicy=persistent
NamePolicy=kernel database onboard slot path mac

# /etc/systemd/network/50-vmbr0.netdev
[NetDev]
Name=vmbr0
Kind=bridge
MACAddress=a4:bf:01:26:XX:XX

# /etc/systemd/network/50-vmbr0.network
[Match]
Name=vmbr0

[Network]
Address=54.36.XX.XX/24
Gateway=54.36.XX.254
#IPv6AcceptRA=false
NTP=ntp.ovh.net
DNS=127.0.0.1
DNS=213.186.33.99
DNS=2001:41d0:3:163::1
Gateway=2001:41d0:0303:46ff:ff:ff:ff:ff

[Address]
Address=2001:41d0:XXX:XXX::/64

[Route]
Destination=2001:41d0:XXX:XXX:ff:ff:ff:ff
Scope=link

看起來您正在嘗試將乙太網介面的 MAC 地址複製到新創建的網橋。

網橋提供了分配的 MAC 地址,但現在您有兩個具有該 MAC 地址的介面,物理介面eno1和網橋vmbr0

因此,在50-default.network處理時,它會嘗試將與vmbr0給定 MAC 地址匹配的每個介面分配給網橋。不幸的是vmbr0也有這個地址,所以 systemd-networkd 不能分配vmbr0為它自己的介面!

50-default.network要解決此問題,請按名稱而不是 MAC 地址指定所需的乙太網介面。

[Match]
# Remove me
# MACAddress=a4:bf:01:26:XX:XX
Name=eno1

[Network]
Bridge=vmbr0

引用自:https://serverfault.com/questions/889804