我的笔记本电脑已经用Ubuntu 18.04.1 LTS
了几个月了,以太网一直运行良好。今天我刚开机,就连接失败了。
Connection Failed: Activation of network connection failed
我不断看到弹出的消息。有关系统的信息显示在下面。
ethtool:
sudo ethtool enp3s0f1
Settings for enp3s0f1:
Supported ports: [ TP MII ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Supported pause frame use: No
Supports auto-negotiation: Yes
Supported FEC modes: Not reported
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Advertised pause frame use: Symmetric Receive-only
Advertised auto-negotiation: Yes
Advertised FEC modes: Not reported
Link partner advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Link partner advertised pause frame use: Symmetric Receive-only
Link partner advertised auto-negotiation: Yes
Link partner advertised FEC modes: Not reported
Speed: 100Mb/s
Duplex: Full
Port: MII
PHYAD: 0
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: pumbg
Wake-on: d
Current message level: 0x00000033 (51)
drv probe ifdown ifup
Link detected: yes
左手边:
sudo lshw -C network
*-network
description: Wireless interface
product: Intel Corporation
vendor: Intel Corporation
physical id: 14.3
bus info: pci@0000:00:14.3
logical name: wlo1
version: 10
serial: d4:6d:6d:81:35:08
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress msix bus_master cap_list ethernet physical wireless
configuration: broadcast=yes driver=iwlwifi driverversion=4.15.0-33-generic firmware=34.0.0 ip=192.168.0.109 latency=0 link=yes multicast=yes wireless=IEEE 802.11
resources: irq:16 memory:a4314000-a4317fff
*-network
description: Ethernet interface
product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
vendor: Realtek Semiconductor Co., Ltd.
physical id: 0.1
bus info: pci@0000:03:00.1
logical name: enp3s0f1
version: 12
serial: 80:fa:5b:58:1f:2d
size: 100Mbit/s
capacity: 1Gbit/s
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=full firmware=rtl8411-2_0.0.1 07/08/13 latency=0 link=yes multicast=yes port=MII speed=100Mbit/s
resources: irq:18 ioport:3000(size=256) memory:a4214000-a4214fff memory:a4210000-a4213fff
*-network:0
description: Ethernet interface
physical id: 1
logical name: enx00142dfffffe
serial: 00:14:2d:ff:ff:fe
capabilities: ethernet physical
configuration: broadcast=yes driver=rndis_host driverversion=22-Aug-2005 firmware=RNDIS device link=yes multicast=yes
*-network:1
description: Ethernet interface
physical id: 2
logical name: docker0
serial: 02:42:dd:36:7d:0e
capabilities: ethernet physical
configuration: broadcast=yes driver=bridge driverversion=2.3 firmware=N/A ip=172.17.0.1 link=no multicast=yes
如果我尝试分配静态 IP,则无法 ping 通网关。网络中还有其他几台计算机,它们通过 DHCP 获得分配的 IP 地址,我可以从它们 ping 通网关,也可以访问互联网。
我看了一下dmesg
,似乎有一个问题,但我不确定它是否相关:
[ 512.317670] ------------[ cut here ]------------
[ 512.317674] NETDEV WATCHDOG: enp3s0f1 (r8169): transmit queue 0 timed out
[ 512.317704] WARNING: CPU: 4 PID: 0 at /build/linux-81MBYC/linux-4.15.0/net/sched/sch_generic.c:323 dev_watchdog+0x221/0x230
[ 512.317706] Modules linked in: rfcomm ipt_MASQUERADE nf_nat_masquerade_ipv4 nf_conntrack_netlink nfnetlink xfrm_user xfrm_algo iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 xt_addrtype iptable_filter xt_conntrack nf_nat nf_conntrack libcrc32c br_netfilter bridge stp llc overlay aufs ccm cmac bnep binfmt_misc nls_iso8859_1 snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic arc4 uvcvideo btusb videobuf2_vmalloc snd_hda_intel btrtl videobuf2_memops snd_hda_codec snd_hda_core videobuf2_v4l2 btbcm wmi_bmof iwlmvm mxm_wmi serio_raw videobuf2_core snd_hwdep btintel input_leds mac80211 snd_pcm videodev intel_rapl media x86_pkg_temp_thermal intel_powerclamp coretemp bluetooth snd_seq_midi snd_seq_midi_event rtsx_pci_ms iwlwifi kvm_intel mei_me snd_rawmidi memstick mei ecdh_generic kvm
[ 512.317808] snd_seq irqbypass crct10dif_pclmul crc32_pclmul ghash_clmulni_intel pcbc aesni_intel snd_seq_device snd_timer snd aes_x86_64 soundcore crypto_simd glue_helper cfg80211 shpchp wmi intel_pch_thermal cryptd intel_cstate intel_hid intel_rapl_perf acpi_pad sparse_keymap joydev mac_hid sch_fq_codel parport_pc ppdev lp parport ip_tables x_tables autofs4 hid_generic usbhid hid i915 rtsx_pci_sdmmc i2c_algo_bit drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops drm psmouse r8169 ahci rtsx_pci mii libahci video
[ 512.317880] CPU: 4 PID: 0 Comm: swapper/4 Not tainted 4.15.0-33-generic #36-Ubuntu
[ 512.317883] Hardware name: Notebook N8xEJEK /N8xEJEK , BIOS 1.05.02RNS1 04/13/2018
[ 512.317888] RIP: 0010:dev_watchdog+0x221/0x230
[ 512.317891] RSP: 0018:ffff912d2d303e58 EFLAGS: 00010286
[ 512.317895] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000006
[ 512.317897] RDX: 0000000000000007 RSI: 0000000000000092 RDI: ffff912d2d316490
[ 512.317900] RBP: ffff912d2d303e88 R08: 0000000000000001 R09: 00000000000003b5
[ 512.317902] R10: ffff912d2d303ee0 R11: 0000000000000000 R12: 0000000000000001
[ 512.317905] R13: ffff912d2a8ce000 R14: ffff912d2a8ce478 R15: ffff912d1ed06480
[ 512.317909] FS: 0000000000000000(0000) GS:ffff912d2d300000(0000) knlGS:0000000000000000
[ 512.317912] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 512.317914] CR2: 000055e53468f438 CR3: 000000019be0a002 CR4: 00000000003606e0
[ 512.317917] Call Trace:
[ 512.317919] <IRQ>
[ 512.317927] ? dev_deactivate_queue.constprop.33+0x60/0x60
[ 512.317935] call_timer_fn+0x30/0x130
[ 512.317942] run_timer_softirq+0x3fb/0x450
[ 512.317947] ? ktime_get+0x43/0xa0
[ 512.317954] ? lapic_next_deadline+0x26/0x30
[ 512.317959] __do_softirq+0xe4/0x2bb
[ 512.317965] irq_exit+0xb8/0xc0
[ 512.317969] smp_apic_timer_interrupt+0x79/0x130
[ 512.317976] apic_timer_interrupt+0x84/0x90
[ 512.317978] </IRQ>
[ 512.317985] RIP: 0010:cpuidle_enter_state+0xa7/0x2f0
[ 512.317988] RSP: 0018:ffffb19d4196fe68 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff11
[ 512.317992] RAX: ffff912d2d322880 RBX: 000000774883164c RCX: 000000000000001f
[ 512.317995] RDX: 000000774883164c RSI: fffffffcf772266b RDI: 0000000000000000
[ 512.317997] RBP: ffffb19d4196fea8 R08: 00000000ffffffff R09: 0000000000000020
[ 512.318000] R10: ffffb19d4196fe38 R11: 00000000000041dd R12: ffff912d2d32cc48
[ 512.318002] R13: 0000000000000002 R14: ffffffffbc171bb8 R15: 0000000000000000
[ 512.318010] ? cpuidle_enter_state+0x97/0x2f0
[ 512.318016] cpuidle_enter+0x17/0x20
[ 512.318022] call_cpuidle+0x23/0x40
[ 512.318027] do_idle+0x18c/0x1f0
[ 512.318033] cpu_startup_entry+0x73/0x80
[ 512.318038] start_secondary+0x1ab/0x200
[ 512.318044] secondary_startup_64+0xa5/0xb0
[ 512.318047] Code: 38 00 49 63 4e e8 eb 92 4c 89 ef c6 05 a7 13 d9 00 01 e8 c3 36 fd ff 89 d9 48 89 c2 4c 89 ee 48 c7 c7 e8 7d d9 bb e8 1f d6 80 ff <0f> 0b eb c0 90 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 55
[ 512.318133] ---[ end trace 756930854e9fb9cc ]---
补充一点,Wi-Fi 接口可以正常工作。所述问题仅影响以太网。
当前安装的内核版本是4.15.0-33-generic
:
uname -a
Linux leo 4.15.0-33-generic #36-Ubuntu SMP Wed Aug 15 16:00:05 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
我尝试从4.15.0-32-generic
和启动,4.15.0-30-generic
它们也都已安装,但问题仍然存在。
任何帮助调试此问题的建议都将不胜感激。
编辑:
我也尝试4.18.5-041805-generic
过从Ubuntu 档案并按照MainlineBuilds 文章,但问题仍然存在。其他一切正常。
我也安装4.15.0-29-generic
并4.15.0-24-generic
使用了 apt(包括 headers、modules 和 modules-extra 包),但这些都无法解决问题。
编辑2:
消息 | grep enp:
dmesg | grep enp
[ 1.844976] r8169 0000:03:00.1 enp3s0f1: renamed from eth0
[ 6.947489] IPv6: ADDRCONF(NETDEV_UP): enp3s0f1: link is not ready
[ 6.998162] r8169 0000:03:00.1 enp3s0f1: link down
[ 6.998165] r8169 0000:03:00.1 enp3s0f1: link down
[ 6.998237] IPv6: ADDRCONF(NETDEV_UP): enp3s0f1: link is not ready
[ 9.088158] r8169 0000:03:00.1 enp3s0f1: link up
[ 9.088166] IPv6: ADDRCONF(NETDEV_CHANGE): enp3s0f1: link becomes ready
[ 149.998558] NETDEV WATCHDOG: enp3s0f1 (r8169): transmit queue 0 timed out
[ 150.025064] r8169 0000:03:00.1 enp3s0f1: link up
[ 494.222007] r8169 0000:03:00.1 enp3s0f1: link down
[ 496.328283] r8169 0000:03:00.1 enp3s0f1: link up
[ 551.660533] r8169 0000:03:00.1 enp3s0f1: renamed from eth0
[ 551.692682] IPv6: ADDRCONF(NETDEV_UP): enp3s0f1: link is not ready
[ 551.771981] r8169 0000:03:00.1 enp3s0f1: link down
[ 551.772077] IPv6: ADDRCONF(NETDEV_UP): enp3s0f1: link is not ready
[ 553.887435] r8169 0000:03:00.1 enp3s0f1: link up
[ 553.887463] IPv6: ADDRCONF(NETDEV_CHANGE): enp3s0f1: link becomes ready
编辑3:
我能够使以太网工作,但需要一个非常具体的解决方法:
要r8168-dkms
按照 @chili555 的建议进行安装,我必须在系统 BIOS 中禁用安全启动。我从未安装过它,但我确实禁用了安全启动,重新启动后,以太网网络便连接并按预期工作。
我进一步重新启动并发现问题仍然存在,这时我发现了以下情况:
- 我的 BIOS 配置正在保留重启后。无论我重启多少次,安全启动功能都会被禁用。
- 如果我进入 BIOS 配置,什么也不改变,选择
save and reset
选项,等待系统启动,以太网就可以工作了。 - 即使禁用安全启动,如果我不执行上一步中描述的步骤,以太网将无法工作。
- 这是使用之前测试过的常规 Ubuntu 最新内核和主线内核可重现的启动(
4.15.0-33-generic
,4.18.5-041805-generic
)。
dmesg
我已经使用以下方法检查了早期内核消息,成功和失败有所不同:
以太网工作时:
...
[ 0.000000] efi: ACPI 2.0=0x7a039000 ACPI=0x7a039000 SMBIOS=0x7a99b000 SMBIOS 3.0=0x7a99a000 ESRT=0x7521af98 MEMATTR=0x7520f018
...
[ 0.000000] esrt: Reserving ESRT space from 0x000000007521af98 to 0x000000007521afd0.
...
[ 0.000000] BRK [0x3e413f000, 0x3e413ffff] PGTABLE
[ 0.000000] BRK [0x3e4140000, 0x3e4140fff] PGTABLE
[ 0.000000] BRK [0x3e4141000, 0x3e4141fff] PGTABLE
[ 0.000000] BRK [0x3e4142000, 0x3e4142fff] PGTABLE
[ 0.000000] BRK [0x3e4143000, 0x3e4143fff] PGTABLE
[ 0.000000] BRK [0x3e4144000, 0x3e4144fff] PGTABLE
[ 0.000000] BRK [0x3e4145000, 0x3e4145fff] PGTABLE
[ 0.000000] BRK [0x3e4146000, 0x3e4146fff] PGTABLE
[ 0.000000] BRK [0x3e4147000, 0x3e4147fff] PGTABLE
[ 0.000000] BRK [0x3e4148000, 0x3e4148fff] PGTABLE
...
[ 0.000000] Memory: 16143384K/16628012K available (12300K kernel code, 2470K rwdata, 4244K rodata, 2408K init, 2416K bss, 484628K reserved, 0K cma-reserved)
...
当以太网出现故障时:
...
[ 0.000000] efi: ACPI 2.0=0x7a039000 ACPI=0x7a039000 SMBIOS=0x7a99b000 SMBIOS 3.0=0x7a99a000 ESRT=0x7521cd18 MEMATTR=0x7520f018
...
[ 0.000000] esrt: Reserving ESRT space from 0x000000007521cd18 to 0x000000007521cd50.
...
[ 0.000000] BRK [0x125d3f000, 0x125d3ffff] PGTABLE
[ 0.000000] BRK [0x125d40000, 0x125d40fff] PGTABLE
[ 0.000000] BRK [0x125d41000, 0x125d41fff] PGTABLE
[ 0.000000] BRK [0x125d42000, 0x125d42fff] PGTABLE
[ 0.000000] BRK [0x125d43000, 0x125d43fff] PGTABLE
[ 0.000000] BRK [0x125d44000, 0x125d44fff] PGTABLE
[ 0.000000] BRK [0x125d45000, 0x125d45fff] PGTABLE
[ 0.000000] BRK [0x125d46000, 0x125d46fff] PGTABLE
[ 0.000000] BRK [0x125d47000, 0x125d47fff] PGTABLE
[ 0.000000] BRK [0x125d48000, 0x125d48fff] PGTABLE
...
[ 0.000000] Memory: 16143392K/16628012K available (12300K kernel code, 2470K rwdata, 4244K rodata, 2408K init, 2416K bss, 484620K reserved, 0K cma-reserved)
...
编辑4:
根据@heynnema 的要求,以下是输出dkms status
(使用 sudo 执行时输出相同):
dkms status
Error! Could not locate dkms.conf file.
File: does not exist.
输出sudo lshw -c network
已在上面提供,并且自问题最初发布以来就没有改变。
编辑5:
输出自ls -al /var/lib/dkms
leonardo@leo:~$ ls -al /var/lib/dkms
total 16
drwxr-xr-x 3 root root 4096 set 3 14:16 .
drwxr-xr-x 78 root root 4096 ago 21 08:45 ..
-rw-r--r-- 1 root root 6 ago 31 2016 dkms_dbversion
drwxr-xr-x 3 root root 4096 jun 18 09:50 nvidia
输出自ls -al /var/lib/dkms/nvidia
leonardo@leo:~$ ls -al /var/lib/dkms/nvidia/
total 12
drwxr-xr-x 3 root root 4096 jun 18 09:50 .
drwxr-xr-x 3 root root 4096 set 3 14:16 ..
drwxr-xr-x 4 root root 4096 jun 18 08:36 390.67
lrwxrwxrwx 1 root root 31 jun 18 08:36 kernel-4.13.0-45-generic-x86_64 -> 390.67/4.13.0-45-generic/x86_64
ps 我目前正在使用 Nouveau 开源驱动程序,而不是这个 nvidia-driver-390。
输出ls -al /usr/src
:
leonardo@leo:~$ ls -al /usr/src
total 64
drwxr-xr-x 16 root root 4096 set 4 06:59 .
drwxr-xr-x 13 root root 4096 jun 18 12:06 ..
drwxr-xr-x 24 root root 4096 set 3 16:37 linux-headers-4.14.67-041467
drwxr-xr-x 8 root root 4096 set 3 16:38 linux-headers-4.14.67-041467-generic
drwxr-xr-x 8 root root 4096 set 3 16:39 linux-headers-4.14.67-041467-lowlatency
drwxr-xr-x 27 root root 4096 set 3 11:27 linux-headers-4.15.0-24
drwxr-xr-x 8 root root 4096 set 3 11:27 linux-headers-4.15.0-24-generic
drwxr-xr-x 27 root root 4096 set 3 11:05 linux-headers-4.15.0-29
drwxr-xr-x 8 root root 4096 set 3 11:05 linux-headers-4.15.0-29-generic
drwxr-xr-x 27 root root 4096 ago 20 06:51 linux-headers-4.15.0-32
drwxr-xr-x 8 root root 4096 ago 20 06:51 linux-headers-4.15.0-32-generic
drwxr-xr-x 27 root root 4096 ago 24 06:54 linux-headers-4.15.0-33
drwxr-xr-x 8 root root 4096 ago 24 06:54 linux-headers-4.15.0-33-generic
drwxr-xr-x 24 root root 4096 set 3 10:39 linux-headers-4.18.5-041805
drwxr-xr-x 8 root root 4096 set 3 10:39 linux-headers-4.18.5-041805-generic
drwxr-xr-x 8 root root 4096 set 3 10:39 linux-headers-4.18.5-041805-lowlatency
有关中列出的其他以太网接口的信息sudo lshw -C network
:*-network:0
是一个 USB RNDIS 接口(我已拔掉它以进行所有测试并确保它是无关的)和一个由 Docker 创建的接口(我已停止并禁用该服务以确保它是无关的)。
答案1
我遇到了类似的以太网问题。
尝试使用不同的以太网电缆,以及交换机/集线器/路由器上的其他端口,看看你的关联停留向上速度为 1000mbs。
我不确定这是否能 100% 修复,但这就是我所做的,我的以太网现在可以正常工作了。
在终端...
cd /etc/netplan
sudo pico config.yaml # create the .yaml file and add the following text
network:
version: 2
renderer: NetworkManager
sudo netplan generate
sudo netplan apply
reboot
答案2
几天后我发现问题已经解决。我猜可能是系统更新解决了这个问题。
与此同时,当问题还没有“自行解决”时,我所做的就是每次重启机器时进入 BIOS 并禁用安全启动。这是强制性的,即使我的 BIOS 保留了设置。