无以太网连接

无以太网连接

长话短说:

我的网络(以太网)在我(手动)运行之前无法工作sudo dhclient,但我每次启动时都需要执行此操作。如何让它在重新启动时保持不变?

历史:

我已经启动了 Arch ISO。我有一台带有有线以太网、常亮灯的台式机。 ip link给我们[eno1]和 是BROADCAST, MULTICAST, UP, LOWER_UP

我已经关注了Arch Linux - 连接:网络无法访问为 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 都不能完全工作,我稍后会查看网络管理器,然后再报告。

如何让它在重新启动时保持不变?

答案1

这些消息表明您的 netctl 配置文件正在用作dhcpcdDHCP 客户端,而不是dhclient.

因为它看起来dhclient有效但dhcpcd实际上无效,您可以尝试将默认 DHCP 客户端更改为dhclient.

/etc/netctl/hooks/dhcp使用以下内容创建:

#!/bin/sh
DHCPClient='dhclient'

或者/etc/netctl/interfaces/eno1使用以下内容创建:

DHCPClient='dhclient'

在这两种情况下,都将文件标记为可执行文件 ( chmod a+x <filename>)。

相关内容