Systemd-Networkd
乙太網網路未在 raspberrypi 上啟動:DHCP6 客戶端:設置 DUID 失敗:未找到介質
我試圖通過 systemd-networkd 設置一個靜態 ip,並且在我刪除了我的自定義文件並重新啟動設備之後,eth0 和 wlan0 都無法啟動。我希望他們能再次從 DHCP 獲取地址,檢查我看到的調試日誌:
Dec 16 17:27:56 raspberrypi4 systemd-networkd[339]: Sent message type=signal sender=n/a destination=n/a path=/org/freedesktop/network1/link/_33 interface=org.freedesktop.DBus.Properties member=PropertiesChanged cookie=12 reply_cookie=0 signature=sa{sv}as error-name=n/a error-message=n/a Dec 16 17:27:56 raspberrypi4 systemd-networkd[339]: Got message type=method_return sender=org.freedesktop.DBus destination=:1.10 path=n/a interface=n/a member=n/a cookie=1 reply_cookie=1 signature=s error-name=n/a error-message=n/a Dec 16 17:27:56 raspberrypi4 systemd-networkd[339]: Bus bus-api-network: changing state HELLO → RUNNING Dec 16 17:27:56 raspberrypi4 systemd-networkd[339]: Got message type=signal sender=org.freedesktop.DBus.Local destination=n/a path=/org/freedesktop/DBus/Local interface=org.freedesktop.DBus.Local member=Connected cookie=4294967295 reply_cookie=0 signature=n/a error-name=n/a error-message=n/a Dec 16 17:27:56 raspberrypi4 systemd-networkd[339]: Got message type=signal sender=org.freedesktop.DBus destination=:1.10 path=/org/freedesktop/DBus interface=org.freedesktop.DBus member=NameAcquired cookie=2 reply_cookie=0 signature=s error-name=n/a error-message=n/a Dec 16 17:27:56 raspberrypi4 systemd-networkd[339]: Got message type=signal sender=org.freedesktop.DBus destination=:1.10 path=/org/freedesktop/DBus interface=org.freedesktop.DBus member=NameAcquired cookie=3 reply_cookie=0 signature=s error-name=n/a error-message=n/a Dec 16 17:27:56 raspberrypi4 systemd-networkd[339]: Got message type=method_return sender=org.freedesktop.DBus destination=:1.10 path=n/a interface=n/a member=n/a cookie=4 reply_cookie=2 signature=u error-name=n/a error-message=n/a Dec 16 17:27:56 raspberrypi4 systemd-networkd[339]: Successfully acquired requested service name. Dec 16 17:27:56 raspberrypi4 systemd-networkd[339]: Got message type=method_return sender=org.freedesktop.DBus destination=:1.10 path=n/a interface=n/a member=n/a cookie=5 reply_cookie=3 signature=n/a error-name=n/a error-message=n/a Dec 16 17:27:56 raspberrypi4 systemd-networkd[339]: Match type='signal',sender='org.freedesktop.login1',path='/org/freedesktop/login1',interface='org.freedesktop.login1.Manager',member='PrepareForSleep' successfully installed. Dec 16 17:27:56 raspberrypi4 systemd-networkd[339]: eth0: Link state is up-to-date Dec 16 17:27:56 raspberrypi4 systemd-networkd[339]: eth0: found matching network '/lib/systemd/network/80-wired.network' Dec 16 17:27:56 raspberrypi4 systemd-networkd[339]: Setting '/proc/sys/net/ipv6/conf/eth0/disable_ipv6' to '0' Dec 16 17:27:56 raspberrypi4 systemd-networkd[339]: eth0: IPv6 successfully enabled Dec 16 17:27:56 raspberrypi4 systemd-networkd[339]: Setting '/proc/sys/net/ipv6/conf/eth0/proxy_ndp' to '0' Dec 16 17:27:56 raspberrypi4 systemd-networkd[339]: Setting '/proc/sys/net/ipv6/conf/eth0/use_tempaddr' to '0' Dec 16 17:27:56 raspberrypi4 systemd-networkd[339]: Setting '/proc/sys/net/ipv6/conf/eth0/accept_ra' to '0' Dec 16 17:27:56 raspberrypi4 systemd-networkd[339]: DHCPv6 CLIENT: Failed to set DUID-EN: No medium found Dec 16 17:27:56 raspberrypi4 systemd-networkd[339]: eth0: DHCP6 CLIENT: Failed to set DUID: No medium found Dec 16 17:27:56 raspberrypi4 systemd-networkd[339]: eth0: Failed Dec 16 17:27:56 raspberrypi4 systemd-networkd[339]: eth0: State changed: initialized -> failed Dec 16 17:27:56 raspberrypi4 systemd-networkd[339]: Sent message type=signal sender=n/a destination=n/a path=/org/freedesktop/network1/link/_32 interface=org.freedesktop.DBus.Properties member=PropertiesChanged cookie=13 reply_cookie=0 signature=sa{sv}as error-name=n/a error-message=n/a Dec 16 17:27:56 raspberrypi4 systemd-networkd[339]: DHCP CLIENT (0x0): STOPPED
但是在過去,ipv6 地址已成功分配。我找不到對
Failed to set DUID: No medium found
錯誤的任何引用
問題原來是我們在 /etc 上使用了 overlayfs,它覆蓋了
/etc/machine-id
使用預設空文件生成的 systemd,因為 systemd on 掛載的 tmpfs/ets/machine-id
正在被重寫。由於這個原因,DHCP6 客戶端無法設置 DUID,因為
/etc/machine-id
它是空的。如果不存在,我已經通過將 /etc/machine-id 複製到覆蓋分區中來修復它,使其在重新啟動時保持不變。