首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >我的网络接口更改了名称,因此DHCP / dhclient无法对其进行操作。

我的网络接口更改了名称,因此DHCP / dhclient无法对其进行操作。
EN

Server Fault用户
提问于 2021-05-14 20:31:09
回答 1查看 561关注 0票数 2

在一些ArchLinux服务器上,我已经从dhcpcd切换到了dhclient,但是服务器没有接收IP。使用journalctl检查时,我发现,在所有情况下,IP都没有收到,dhclient试图在接口上操作,然后重新命名接口。所讨论的内容如下:

代码语言:javascript
复制
dhclient[461]: Failed to get interface index: No such device
...
kernel: igc 0000:6f:00.0 enp111s0: renamed from eth1

这个“接口重命名”业务是什么,dhclient怎么可能不会被预定呢?

当然,下面的命令修复了DHCP:

代码语言:javascript
复制
sudo systemctl restart dhclient@enp111s0.service

更多的日志:

代码语言:javascript
复制
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]: dhclient@enp111s0.service: Main process exited, code=exited, status=1/FAILURE
May 14 19:03:32 serverski systemd[1]: dhclient@enp111s0.service: 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
EN

回答 1

Server Fault用户

回答已采纳

发布于 2021-05-18 09:47:02

在我自己的问题上发表一个解决办法。

在与dhclient (这个问题)以及其他与dhcpcd有关的问题之后(我并没有完全搞清楚这些问题,而是直接切换到dhclient作为一个插入替换解决了它们,因为对于两个您都需要只需要systemctl enable dhclient@iface.service),我得出的结论是最好和最干净的,抛弃dhclientdhcpcd,转而使用systemd-networkd,后者可以很容易地配置来处理DHCP,参见这里,而不需要额外的包。

使用systemd-networkd's自己的DHCP逻辑处理将解决命名问题,因为我认为它是执行接口重命名的相同的systemd组件。

票数 0
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/1063595

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档