netctl“未找到连接”

netctl“未找到连接”

我刚刚安装了 Arch Linux。

我正在尝试连接到我的本地网络,但是它不工作。

这是我的数据:

lspci-v

...
3:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 09)
    Subsystem: ASUSTeK Computer Inc. P8 series motherboard
    Flags: bus master, fast devsel, latency 0, IRQ 28
    I/O ports at d000 [size=256]
    Memory at f2104000 (64-bit, prefetchable) [size=4K]
    Memory at f2100000 (64-bit, prefetchable) [size=16K]
    Capabilities: [40] Power Management version 3
    Capabilities: [50] MSI: Enable+ Count=1/1 Maskable- 64bit+
    Capabilities: [70] Express Endpoint, MSI 01
    Capabilities: [b0] MSI-X: Enable- Count=4 Masked-
    Capabilities: [d0] Vital Product Data
    Capabilities: [100] Advanced Error Reporting
    Capabilities: [140] Virtual Channel
    Capabilities: [160] Device Serial Number 01-00-00-00-68-4c-e0-00
    Kernel driver in use: r8169
    Kernel modules: r8169
...

ip link 显示 enp3s0

2: enp3s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
    link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff

netctl 配置文件:

Interface=enp3s0
Connection=ethernet
IP=static
Address=('192.168.1.20/24')
Gateway='192.168.1.1'
DNS=('8.8.8.8' '8.8.4.4')

我收到此错误:

--
-- Unit netctl@default_profile.service has begun starting up.
Jan 11 21:48:58 main network[496]: Starting network profile 'default_profile'...
Jan 11 21:48:58 main kernel: r8169 0000:03:00.0 enp3s0: link down
Jan 11 21:48:58 main kernel: r8169 0000:03:00.0 enp3s0: link down
Jan 11 21:48:58 main kernel: IPv6: ADDRCONF(NETDEV_UP): enp3s0: link is not ready
Jan 11 21:49:03 main network[496]: No connection found on interface 'enp3s0' (timeout)
Jan 11 21:49:03 main network[496]: Failed to bring the network up for profile 'default_profile'
Jan 11 21:49:03 main systemd[1]: netctl@default_profile.service: Main process exited, code=exited, status=1/FAILURE
Jan 11 21:49:03 main systemd[1]: Failed to start Networking for netctl profile default_profile.
-- Subject: Unit netctl@default_profile.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit netctl@default_profile.service has failed.
--
-- The result is failed.
Jan 11 21:49:03 main systemd[1]: netctl@default_profile.service: Unit entered failed state.
Jan 11 21:49:03 main systemd[1]: netctl@default_profile.service: Failed with result 'exit-code'.
Jan 11 21:49:03 main systemd[1]: Reached target Network.
-- Subject: Unit network.target has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit network.target has finished starting up.
--
-- The start-up result is done.

如果我尝试使用以下方式连接:

dhcpcp enp3s0

它运行正常,但我想使用 netctl 进行连接。我该怎么做?

答案1

我刚刚遇到了同样的问题,在寻找解决方案时发现了这个问题。

最终我还是找到了解决方案,所以我要在这里发布它。您需要将此选项添加到您的 netctl 配置文件中:

SkipNoCarrier=yes

似乎发生的是错误“在接口‘enp3s0’上未找到连接(超时)“表示网控无论出于什么原因(哈哈)都无法检测到与路由器的连接,它基本上是在说“未检测到连接,您的电缆插入了吗?”

但实际上,电缆是通过打开连接来连接的DHCP服务器会建议,所以这只能是一个错误网控

解决方案是(使用我上面描述的选项)告诉网控忽略设备是否连接到任何东西,只需启用接口(设置链接)并尝试连接。

我不知道我对此有何感受,它让我感觉好像 netctl 可能不是那么好而且我不应该使用它,但是嘿,它有效,并且直到它不再有效为止,我想我会坚持使用它。

相关内容