enp3s0(以前称为 eth0)不再连接

enp3s0(以前称为 eth0)不再连接

我的电脑一周以来只能通过 wifi 连接到网络。在 NetworkManager 的journalctl输出中,我发现:

journalctl 输出

Nov 04 17:35:06 aeon NetworkManager[549788]: <warn>  [1604507706.0747] dhcp4 (enp3s0): request timed out
Nov 04 17:35:06 aeon NetworkManager[549788]: <info>  [1604507706.0748] dhcp4 (enp3s0): state changed unknown -> timeout
Nov 04 17:35:06 aeon NetworkManager[549788]: <info>  [1604507706.0748] device (enp3s0): state change: ip-config -> failed (reason 'ip-config-unavailable', sys-iface-state: 'managed')
Nov 04 17:35:06 aeon NetworkManager[549788]: <info>  [1604507706.0752] manager: NetworkManager state is now CONNECTED_LOCAL
Nov 04 17:35:06 aeon NetworkManager[549788]: <warn>  [1604507706.0762] device (enp3s0): Activation: failed for connection 'Wired Ethernet'
Nov 04 17:35:06 aeon NetworkManager[549788]: <info>  [1604507706.0766] device (enp3s0): state change: failed -> disconnected (reason 'none', sys-iface-state: 'managed')
Nov 04 17:35:06 aeon NetworkManager[549788]: <info>  [1604507706.0798] dhcp4 (enp3s0): canceled DHCP transaction
Nov 04 17:35:06 aeon NetworkManager[549788]: <info>  [1604507706.0799] dhcp4 (enp3s0): state changed timeout -> done
Nov 04 17:35:06 aeon NetworkManager[549788]: <info>  [1604507706.0808] policy: auto-activating connection 'Wired Ethernet' (a6466101-ff2c-4d4c-b898-de5be7932c85)
Nov 04 17:35:06 aeon NetworkManager[549788]: <info>  [1604507706.0813] device (enp3s0): Activation: starting connection 'Wired Ethernet' (a6466101-ff2c-4d4c-b898-de5be7932c85)
Nov 04 17:35:06 aeon NetworkManager[549788]: <info>  [1604507706.0814] device (enp3s0): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed')
Nov 04 17:35:06 aeon NetworkManager[549788]: <info>  [1604507706.0816] manager: NetworkManager state is now CONNECTING
Nov 04 17:35:06 aeon NetworkManager[549788]: <info>  [1604507706.0818] device (enp3s0): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
Nov 04 17:35:06 aeon NetworkManager[549788]: <info>  [1604507706.0824] device (enp3s0): state change: config -> ip-config (reason 'none', sys-iface-state: 'managed')
Nov 04 17:35:06 aeon NetworkManager[549788]: <info>  [1604507706.0827] dhcp4 (enp3s0): activation: beginning transaction (timeout in 45 seconds)

NM 输出(通知气泡)

“IP 配置不可用”

手动调用 dhclient

root@aeon:~# dhclient -v enp3s0
Internet Systems Consortium DHCP Client 4.4.1
Copyright 2004-2018 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/enp3s0/d4:5d:64:52:c9:c1
Sending on   LPF/enp3s0/d4:5d:64:52:c9:c1
Sending on   Socket/fallback
DHCPDISCOVER on enp3s0 to 255.255.255.255 port 67 interval 2 (xid=0xf30ecf3e)
DHCPDISCOVER on enp3s0 to 255.255.255.255 port 67 interval 2 (xid=0xf30ecf3e)
DHCPDISCOVER on enp3s0 to 255.255.255.255 port 67 interval 2 (xid=0xf30ecf3e)
DHCPDISCOVER on enp3s0 to 255.255.255.255 port 67 interval 2 (xid=0xf30ecf3e)
DHCPDISCOVER on enp3s0 to 255.255.255.255 port 67 interval 2 (xid=0xf30ecf3e)
DHCPDISCOVER on enp3s0 to 255.255.255.255 port 67 interval 1 (xid=0xf30ecf3e)
No DHCPOFFERS received.
No working leases in persistent database - sleeping.
^C

什么有效

wifi 工作正常,dhcp 立即返回。

我尝试过的事情

  1. 将我的 NetworkManager.conf 中的 dhcp 提供程序更改为 internal 或 dhclient。
  2. 删除 中的旧租约/var/lib/NetworkManager/
  3. 我确保空文件已放置/etc/NetworkManager/conf.d/10-globally-managed-devices.conf在适当位置。
  4. 尝试创建静态网络 IP 连接。连接成功,但无法获取任何数据。

当前的NetworkManager.conf

[main]
plugins=ifupdown,keyfile
dns=dnsmasq
#dhcp=dhclient
#dhcp=internal

[ifupdown]
managed=false

[device]
wifi.scan-rand-mac-address=no

lsb

root@aeon:~# lsb_release -d
Description:    Ubuntu 20.04.1 LTS

netplan 文件

root@aeon:~# ll /etc/netplan/
total 24
drwxr-xr-x   2 root root  4096 Apr 23  2018 ./
drwxrwxr-x 208 root root 20480 Nov  4 20:10 ../

好的,我不知道下一步该怎么做。我想我已经将 netplan.io apt-update 从 0.99.x 升级到了 0.100.x,但降级也没有帮助。任何建议都非常感谢!

答案1

当您使用有线电缆无法接收 IP 地址时,您应该做什么:

  1. 测试您的网络没有短路,请尝试另一条电缆。
  2. 目视检查网络端口内的针脚是否损坏(两侧、计算机和交换机/路由器)
  3. 检查网络灯活动。
  4. 尝试接入另一个网络。
  5. 尝试重启电源:关闭电脑,拔下电源,长按电源按钮 30 秒(当然电脑不会开机)。重新插上电源,开机并再次测试。

答案2

通常,在桌面安装中,有一个 netplan yaml 文件可以有效地将网络移交给网络管理器。你没有。让我们添加它,看看连接性是否会改善。从终端:

sudo nano /etc/netplan/01-network-manager-all.yaml

添加以下内容:

# Let NetworkManager manage all devices on this system
network:
  version: 2
  renderer: NetworkManager

Netplan 对间距和缩进非常讲究。请仔细校对两遍。

保存(Ctrl+o 然后按 Enter)并退出文本编辑器。(Ctrl+x)

接下来是:

sudo netplan generate
sudo netplan apply
sudo systemctl restart NetworkManager.service

有沒有改善?

相关内容