TL;博士:
我的网络(以太网)在我(手动)运行之前无法工作sudo dhclient
,但我每次启动时都需要这样做。如何让它坚持重新启动?
历史:
我已经启动了 Arch ISO。我有一个带有线以太网的台式机,常亮灯。 ip link
给我们[eno1]
和是BROADCAST, MULTICAST, UP, LOWER_UP
。
我已经关注Arch Linux - connect: Network is unreachable为 eno1 设置 netctl ethernet-dhcp 配置文件并启用它。
这个配置/配置文件看起来不错吗?尽管启用/启动它在重新启动时失败...
Description='A basic dhcp ethernet connection'
Interface=eno1
Connection=ethernet
IP=dhcp
#DHCPClient=dhcpcd
#DHCPReleaseOnStop=no
## for DHCPv6
#IP6=dhcp
#DHCP6Client=dhclient
## for IPv6 autoconfiguration
#IP6=stateless
如果我ping
有任何 IP(包括 8.8.8.8 和 192.168.1.1),我会得到“网络无法访问”,如果我尝试 google.co.uk,我会得到“名称解析暂时失败”。
ifconfig
产量:
eno1: flags:4163<UP,BROADCAST,RUNNING,MULTICAST>
inet: fe00::c42b:cd14:3908:6ea8
ether: 74:d4:35:1c:f0:3e
sudo dhclient
导致互联网出现,但在重新启动时,这会丢失。
sudo netctl status mynet-eno1-dhcp
● netctl@mynet\x2deno1\x2ddhcp.service - A basic dhcp ethernet connection
Loaded: loaded (/etc/systemd/system/netctl@mynet\x2deno1\x2ddhcp.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Sun 2018-05-06 22:11:28 BST; 19min ago
Docs: man:netctl.profile(5)
Process: 492 ExecStart=/usr/lib/netctl/network start mynet-eno1-dhcp (code=exited, status=1/FAILURE)
Main PID: 492 (code=exited, status=1/FAILURE)
May 06 22:10:58 msc001 dhcpcd[537]: DUID 00:01:00:01:22:80:f1:8f:74:d4:35:1c:f0:3e
May 06 22:10:58 msc001 dhcpcd[537]: eno1: IAID 35:1c:f0:3e
May 06 22:10:58 msc001 dhcpcd[537]: eno1: soliciting a DHCP lease
May 06 22:11:28 msc001 network[492]: timed out
May 06 22:11:28 msc001 dhcpcd[537]: timed out
May 06 22:11:28 msc001 dhcpcd[537]: dhcpcd exited
May 06 22:11:28 msc001 network[492]: DHCP IPv4 lease attempt failed on interface 'eno1'
May 06 22:11:28 msc001 network[492]: Failed to bring the network up for profile 'mynet-eno1-dhcp'
May 06 22:11:28 msc001 systemd[1]: netctl@mynet\x2deno1\x2ddhcp.service: Main process exited, code=exited, status=1/FAILURE
May 06 22:11:28 msc001 systemd[1]: netctl@mynet\x2deno1\x2ddhcp.service: Failed with result 'exit-code'.
由于 dhcpcd 和 dhclient 都不能完全工作,我稍后会查看网络管理器,会报告回来。
如何让它坚持重新启动?
这些消息表明您的 netctl 配置文件正在
dhcpcd
用作 DHCP 客户端,而不是dhclient
.由于它看起来
dhclient
有效但dhcpcd
无效,您可以尝试将默认 DHCP 客户端更改为dhclient
./etc/netctl/hooks/dhcp
使用以下内容创建:或
/etc/netctl/interfaces/eno1
使用以下内容创建:在这两种情况下,将文件标记为可执行文件 (
chmod a+x <filename>
)。