“连接失败,激活网络失败”错误

“连接失败,激活网络失败”错误

即使我已连接到 WiFi 并可以访问互联网,我仍然不断收到“连接失败,激活网络失败”错误弹出窗口。我使用的是双启动 Windows 10/Ubuntu 18.04。

我查看了网络管理器日志,得到的结果如下:

Feb 02 14:30:02 21K-USER NetworkManager[840]: <info>  [1549135802.4288] policy: auto-activating connection 'Wired connection 1'
Feb 02 14:30:02 21K-USER NetworkManager[840]: <info>  [1549135802.4306] device (enp0s20f0u3c2): Activation: starting connection 'Wired connection 1' (4f23e5d8-103f-3fcc-adf5-18a056362def)
Feb 02 14:30:02 21K-USER NetworkManager[840]: <info>  [1549135802.4313] device (enp0s20f0u3c2): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed')
Feb 02 14:30:02 21K-USER NetworkManager[840]: <info>  [1549135802.4323] device (enp0s20f0u3c2): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
Feb 02 14:30:02 21K-USER NetworkManager[840]: <info>  [1549135802.4334] device (enp0s20f0u3c2): state change: config -> ip-config (reason 'none', sys-iface-state: 'managed')
Feb 02 14:30:02 21K-USER NetworkManager[840]: <info>  [1549135802.4342] dhcp4 (enp0s20f0u3c2): activation: beginning transaction (timeout in 45 seconds)
Feb 02 14:30:02 21K-USER NetworkManager[840]: <info>  [1549135802.4414] dhcp4 (enp0s20f0u3c2): dhclient started with pid 13688
Feb 02 14:30:02 21K-USER dhclient[13688]: DHCPDISCOVER on enp0s20f0u3c2 to 255.255.255.255 port 67 interval 3 (xid=0xb0140b5b)
Feb 02 14:30:05 21K-USER dhclient[13688]: DHCPDISCOVER on enp0s20f0u3c2 to 255.255.255.255 port 67 interval 7 (xid=0xb0140b5b)
Feb 02 14:30:12 21K-USER dhclient[13688]: DHCPDISCOVER on enp0s20f0u3c2 to 255.255.255.255 port 67 interval 11 (xid=0xb0140b5b)
Feb 02 14:30:23 21K-USER dhclient[13688]: DHCPDISCOVER on enp0s20f0u3c2 to 255.255.255.255 port 67 interval 13 (xid=0xb0140b5b)
Feb 02 14:30:36 21K-USER dhclient[13688]: DHCPDISCOVER on enp0s20f0u3c2 to 255.255.255.255 port 67 interval 7 (xid=0xb0140b5b)
Feb 02 14:30:43 21K-USER dhclient[13688]: DHCPDISCOVER on enp0s20f0u3c2 to 255.255.255.255 port 67 interval 7 (xid=0xb0140b5b)
Feb 02 14:30:47 21K-USER NetworkManager[840]: <warn>  [1549135847.3719] dhcp4 (enp0s20f0u3c2): request timed out
Feb 02 14:30:47 21K-USER NetworkManager[840]: <info>  [1549135847.3720] dhcp4 (enp0s20f0u3c2): state changed unknown -> timeout
Feb 02 14:30:47 21K-USER NetworkManager[840]: <info>  [1549135847.4042] dhcp4 (enp0s20f0u3c2): canceled DHCP transaction, DHCP client pid 13688
Feb 02 14:30:47 21K-USER NetworkManager[840]: <info>  [1549135847.4042] dhcp4 (enp0s20f0u3c2): state changed timeout -> done
Feb 02 14:30:47 21K-USER NetworkManager[840]: <info>  [1549135847.4046] device (enp0s20f0u3c2): state change: ip-config -> failed (reason 'ip-config-unavailable', sys-iface-state: 'managed')
Feb 02 14:30:47 21K-USER NetworkManager[840]: <warn>  [1549135847.4050] device (enp0s20f0u3c2): Activation: failed for connection 'Wired connection 1'
Feb 02 14:30:47 21K-USER NetworkManager[840]: <info>  [1549135847.4057] device (enp0s20f0u3c2): state change: failed -> disconnected (reason 'none', sys-iface-state: 'managed')

EDIT1:运行 lshw -C 网络命令后:

*-network                 
       description: Wireless interface
       product: Wireless 8260
       vendor: Intel Corporation
       physical id: 0
       bus info: pci@0000:01:00.0
       logical name: wlp1s0
       version: 3a
       serial: 44:85:00:70:d2:8a
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
       configuration: broadcast=yes driver=iwlwifi driverversion=4.15.0-45-generic firmware=34.0.1 ip=172.31.123.208 latency=0 link=yes multicast=yes wireless=IEEE 802.11
       resources: irq:127 memory:e1000000-e1001fff
  *-network
       description: Ethernet interface
       product: Ethernet Connection I219-V
       vendor: Intel Corporation
       physical id: 1f.6
       bus info: pci@0000:00:1f.6
       logical name: enp0s31f6
       version: 21
       serial: 70:5a:0f:19:9c:d6
       capacity: 1Gbit/s
       width: 32 bits
       clock: 33MHz
       capabilities: pm msi bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=e1000e driverversion=3.2.6-k firmware=0.13-4 latency=0 link=no multicast=yes port=twisted pair
       resources: irq:128 memory:e1100000-e111ffff
  *-network
       description: Ethernet interface
       physical id: 2
       logical name: enp0s20f0u3c2
       serial: e6:70:1c:12:20:17
       capabilities: ethernet physical
       configuration: broadcast=yes driver=cdc_ether driverversion=22-Aug-2005 firmware=CDC Ethernet Device link=yes multicast=yes

编辑2:运行cat /etc/network/interfaces得到:

# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

运行结果cat /etc/netplan/*.yaml为:

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

安装后运行dkms status没有输出任何内容。

编辑 3:根据@heynnema 的建议,这些是当前的发现:

1- 我尝试更新 BIOS。问题仍然存在。

2- 我尝试运行dpkg -l *CDC* | grep iipkg -l *cdc* | grep ii。遗憾的是,没有找到匹配项。

3-我尝试运行lsmod | grep cdc,这是输出:

cdc_wdm                20480  1 qmi_wwan
cdc_ether              16384  0
usbnet                 45056  2 qmi_wwan,cdc_ether

答案1

问题是您有第二个类似以太网的设备 enp0s20f0u3c2,它使用 2005 年的“cdc_ether”驱动程序运行。它是“CDC 以太网设备”。系统认为它有一个活动链接,这就是虚假的“连接失败,激活网络失败”错误的来源。

可能是有人安装了一些旧的驱动程序软件,也可能是您的 BIOS 中启用了我们不知道的某些硬件。请检查您的主板规格。

没有任何内容/etc/network/interfaces/etc/netplan/*.yaml信息给我们任何线索。DKMS 也没有向我们显示任何内容。

  1. 启动到 Ubuntu Live DVD/USB 并发出sudo lshw -C network命令terminal,看看它是否显示 enp0s20f0u3c2 (它可能有不同的数字与之关联) 以太网设备。这将告诉我们它是否与软件有关。

  2. 检查您的 BIOS 设置,并检查制造商网站上的 BIOS 更新。

  3. 检查您的软件,查找与“CDC 以太网”相关的内容。尝试terminaldpkg -l *CDC* | grep iidpkg -l *cdc* | grep ii如果发现任何内容,请报告。

  4. lsmod | grep cdc并查看是否找到内核模块。

更新#1:

上面的步骤 4 向我们展示了确实cdc_ether安装了内核模块。这可能是由于之前的USB to 4G加密狗、USB to Ethernet加密狗、TomTomGPS 设备或内部 4G 适配器所致。

由于我们不确定哪个软件安装可能添加了此cdc_ether驱动程序和相关软件,因此我们将首先尝试一种安全的方法来解决这个问题......

创建一个新的黑名单文件...

terminal...

sudo -H gedit /etc/modprobe.d/blacklist-cdc_ether.conf# 创建文件

添加这两行...

blacklist cdc_ether

blacklist usbnet

保存文件并重新启动计算机。

然后做...

sudo lshw -C network# 显示当前网络设备

并确认enp0s20f0u3c2以太网设备不再存在。如果它仍然存在,则执行以下操作,但前提是它仍然在那里...

sudo modprobe -r cdc_ether usbnet# 删除这些内核模块

sudo update-initramfs -c -k "$(uname -r)"# 更新 initramfs

重新启动计算机并lshw再次检查命令。

相关内容