在一些 ArchLinux 服务器上,我已从 切换dhcpcd
到dhclient
,但服务器没有收到 IP。经过检查,journalctl
我看到,在所有情况下都没有收到 IP,dhclient
试图在接口上操作,然后接口被重命名。有问题的行是:
dhclient[461]: Failed to get interface index: No such device
...
kernel: igc 0000:6f:00.0 enp111s0: renamed from eth1
这个“接口重命名”业务是什么?怎么可能dhclient
没有围绕它进行排序?
当然,稍后,以下命令会修复 DHCP:
sudo systemctl restart [email protected]
更多日志:
May 14 19:03:32 serverski systemd[1]: Reached target Multi-User System.
May 14 19:03:32 serverski systemd[1]: Reached target Graphical Interface.
May 14 19:03:32 serverski dhclient[487]: Cannot find device "enp111s0"
May 14 19:03:32 serverski dhclient[461]: Failed to get interface index: No such device
May 14 19:03:32 serverski dhclient[461]: Failed to get interface index: No such device
May 14 19:03:32 serverski dhclient[461]: If you think you have received this message due to a bug rather
May 14 19:03:32 serverski dhclient[461]: than a configuration issue please read the section on submitting
May 14 19:03:32 serverski dhclient[461]: bugs on either our web page at www.isc.org or in the README file
May 14 19:03:32 serverski dhclient[461]: before submitting a bug. These pages explain the proper
May 14 19:03:32 serverski dhclient[461]: process and the information we find helpful for debugging.
May 14 19:03:32 serverski dhclient[461]: exiting.
May 14 19:03:32 serverski dhclient[461]:
May 14 19:03:32 serverski dhclient[461]: If you think you have received this message due to a bug rather
May 14 19:03:32 serverski dhclient[461]: than a configuration issue please read the section on submitting
May 14 19:03:32 serverski dhclient[461]: bugs on either our web page at www.isc.org or in the README file
May 14 19:03:32 serverski dhclient[461]: before submitting a bug. These pages explain the proper
May 14 19:03:32 serverski dhclient[461]: process and the information we find helpful for debugging.
May 14 19:03:32 serverski dhclient[461]:
May 14 19:03:32 serverski dhclient[461]: exiting.
May 14 19:03:32 serverski systemd-udevd[380]: ethtool: autonegotiation is unset or enabled, the speed and duplex are not writable.
May 14 19:03:32 serverski systemd[1]: [email protected]: Main process exited, code=exited, status=1/FAILURE
May 14 19:03:32 serverski systemd[1]: [email protected]: Failed with result 'exit-code'.
May 14 19:03:32 serverski audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=dhclient@enp111s0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=fail>
May 14 19:03:32 serverski systemd-udevd[427]: Using default interface naming scheme 'v247'.
May 14 19:03:32 serverski systemd-udevd[427]: ethtool: autonegotiation is unset or enabled, the speed and duplex are not writable.
May 14 19:03:32 serverski kernel: r8169 0000:70:00.1 enp112s0f1: renamed from eth0
May 14 19:03:32 serverski kernel: iTCO_vendor_support: vendor-support=0
May 14 19:03:32 serverski systemd-udevd[382]: Using default interface naming scheme 'v247'.
May 14 19:03:32 serverski systemd-udevd[382]: ethtool: autonegotiation is unset or enabled, the speed and duplex are not writable.
May 14 19:03:32 serverski kernel: ee1004 0-0051: 512 byte EE1004-compliant SPD EEPROM, read-only
May 14 19:03:32 serverski kernel: ee1004 0-0053: 512 byte EE1004-compliant SPD EEPROM, read-only
May 14 19:03:32 serverski kernel: igc 0000:6f:00.0 enp111s0: renamed from eth1
针对我自己的问题发布解决方法。
在遇到
dhclient
(这个问题)以及其他问题dhcpcd
(我没有完全深入了解,但简单地切换到dhclient
作为替代品解决了它们,因为你需要这样做systemctl enable [email protected]
)之后,我得出的结论是最好和最干净的,放弃两者dhclient
并dhcpcd
支持systemd-networkd
,可以轻松配置为处理 DHCP,请参见此处,无需额外的软件包。在逻辑上使用
systemd-networkd
自己的 DHCP 处理将解决命名问题,因为我相信它与执行接口重命名的 systemd 组件相同。