我在 arch linux 上使用以太网连接到互联网时遇到问题。我使用 NetworkManager,它告诉我Device not managed
有关以太网的信息。
这是我的内容
NetworkManager.conf
# Configuration file for NetworkManager. # See "man 5 NetworkManager.conf" for details. [ifupdown] managed=true
这是服务的状态
systemctl status NetworkManager.service ● NetworkManager.service - Network Manager Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; enabled; vendor preset: disabled) Drop-In: /usr/lib/systemd/system/NetworkManager.service.d └─NetworkManager-ovs.conf Active: active (running) since Thu 2020-07-09 10:40:29 CEST; 8min ago Docs: man:NetworkManager(8) Main PID: 26730 (NetworkManager) Tasks: 3 (limit: 18960) Memory: 11.0M CGroup: /system.slice/NetworkManager.service └─26730 /usr/bin/NetworkManager --no-daemon Jul 09 10:40:31 Anarchy NetworkManager[26730]: <info> [1594284031.9395] dhcp4 (wlo1): option subnet_mask => '255.255.255.0' Jul 09 10:40:31 Anarchy NetworkManager[26730]: <info> [1594284031.9395] dhcp4 (wlo1): state changed unknown -> bound Jul 09 10:40:31 Anarchy NetworkManager[26730]: <info> [1594284031.9407] device (wlo1): state change: ip-config -> ip-check (reason 'none', sys-iface-state: 'managed') Jul 09 10:40:31 Anarchy NetworkManager[26730]: <info> [1594284031.9420] device (wlo1): state change: ip-check -> secondaries (reason 'none', sys-iface-state: 'managed') Jul 09 10:40:31 Anarchy NetworkManager[26730]: <info> [1594284031.9422] device (wlo1): state change: secondaries -> activated (reason 'none', sys-iface-state: 'managed') Jul 09 10:40:31 Anarchy NetworkManager[26730]: <info> [1594284031.9425] manager: NetworkManager state is now CONNECTED_LOCAL Jul 09 10:40:31 Anarchy NetworkManager[26730]: <info> [1594284031.9444] manager: NetworkManager state is now CONNECTED_SITE Jul 09 10:40:31 Anarchy NetworkManager[26730]: <info> [1594284031.9445] policy: set 'RBIG02' (wlo1) as default for IPv4 routing and DNS Jul 09 10:40:31 Anarchy NetworkManager[26730]: <info> [1594284031.9481] device (wlo1): Activation: successful, device activated. Jul 09 10:40:32 Anarchy NetworkManager[26730]: <info> [1594284032.0036] manager: NetworkManager state is now CONNECTED_GLOBAL
另外,我在系统日志中发现了这一点
# journalctl -b | grep enp Jul 09 10:12:44 Anarchy systemd-udevd[666]: eth0: Failed to rename network interface 2 from 'eth0' to 'enp60s0': Device or resource busy
# journalctl -b | grep eth Jul 09 10:12:42 Anarchy kernel: wmi_bus wmi_bus-PNP0C14:05: WQBC data block query control method not found Jul 09 10:12:43 Anarchy kernel: r8169 0000:3c:00.0 eth0: RTL8168h/8111h, 8c:04:ba:a0:23:3e, XID 541, IRQ 164 Jul 09 10:12:43 Anarchy kernel: r8169 0000:3c:00.0 eth0: jumbo features [frames: 9200 bytes, tx checksumming: ko] Jul 09 10:12:43 Anarchy kernel: r8169 0000:3c:00.0 eth0: Link is Down Jul 09 10:12:44 Anarchy systemd-udevd[635]: ethtool: autonegotiation is unset or enabled, the speed and duplex are not writable. Jul 09 10:12:44 Anarchy systemd-udevd[666]: ethtool: autonegotiation is unset or enabled, the speed and duplex are not writable. Jul 09 10:12:44 Anarchy systemd-udevd[666]: eth0: Failed to rename network interface 2 from 'eth0' to 'enp60s0': Device or resource busy Jul 09 10:12:44 Anarchy systemd-udevd[666]: eth0: Failed to process device, ignoring: Device or resource busy Jul 09 10:12:44 Anarchy systemd-udevd[668]: ethtool: autonegotiation is unset or enabled, the speed and duplex are not writable. Jul 09 10:12:46 Anarchy NetworkManager[2918]: <info> [1594282366.6504] manager: (eth0): new Ethernet device (/org/freedesktop/NetworkManager/Devices/3) Jul 09 10:12:47 Anarchy NetworkManager[2918]: <info> [1594282367.1419] device (eth0): carrier: link connected Jul 09 10:12:47 Anarchy kernel: r8169 0000:3c:00.0 eth0: Link is Up - 1Gbps/Full - flow control off Jul 09 10:12:47 Anarchy kernel: IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready Jul 09 10:12:53 Anarchy wpa_supplicant[3915]: wlo1: CTRL-EVENT-EAP-PROPOSED-METHOD vendor=0 method=25 Jul 09 10:12:53 Anarchy wpa_supplicant[3915]: wlo1: CTRL-EVENT-EAP-METHOD EAP vendor 0 method 25 (PEAP) selected Jul 09 10:14:03 Anarchy sudo[5972]: manuel : TTY=pts/0 ; PWD=/home/manuel ; USER=root ; COMMAND=/usr/bin/ip link set eth0 up Jul 09 10:28:11 Anarchy NetworkManager[18286]: <info> [1594283291.6889] device (eth0): carrier: link connected Jul 09 10:28:11 Anarchy NetworkManager[18286]: <info> [1594283291.6891] manager: (eth0): new Ethernet device (/org/freedesktop/NetworkManager/Devices/3) Jul 09 10:33:21 Anarchy sudo[22070]: manuel : TTY=pts/4 ; PWD=/home/manuel ; USER=root ; COMMAND=/usr/bin/dhcpd eth0 Jul 09 10:33:22 Anarchy dhcpd[22072]: No subnet declaration for eth0 (no IPv4 addresses). Jul 09 10:33:22 Anarchy dhcpd[22072]: ** Ignoring requests on eth0. If this is not what Jul 09 10:33:22 Anarchy dhcpd[22072]: to which interface eth0 is attached. ** Jul 09 10:40:29 Anarchy NetworkManager[26730]: <info> [1594284029.4918] device (eth0): carrier: link connected Jul 09 10:40:29 Anarchy NetworkManager[26730]: <info> [1594284029.4920] manager: (eth0): new Ethernet device (/org/freedesktop/NetworkManager/Devices/3)
该/etc/network/interfaces
文件在我的机器上不存在,但是我发现需要此文件来解决此问题(至少在 ubuntu 上)。
我对网络方面的东西不太熟悉,所以我很乐意提供有关如何解决此问题的任何建议。
编辑:我发现,当我在没有插入电源线的情况下启动笔记本电脑时,不会发生这种情况。但是,如果我这样做,我将无法再打开我的外部显卡(optimus-laptop),而且我真的不这样做查看以太网设备、显卡、电源线之间的连接
答案1
检查/etc/netctl/eth0
里面是否有文件或类似文件/etc/netctl
。如果您需要 NetworkManager 处理此 NIC,请删除该文件。另外,sudo systemctl disable dhcpcd
要禁用外部 DHCP(它将由 NetworkManager 处理),请重新启动系统,然后 NIC 将由 NetworkManager 管理。否则,您可以使用 dchp 或静态 IPeth0
通过编辑进行设置。/etc/netctl/eth0