以太网DHCP在Ubuntu 18.04.1 LTS上停止工作

我有一台笔记本运行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 

lshw:

 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]  [ 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]  [ 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  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-generic4.15.0-30-generic ,这些也已安装,但问题仍然存在。

任何调试此问题的帮助表示赞赏。

编辑:

我还尝试了从Ubuntu存档下载并按照MainlineBuilds文章中的描述安装的主线内核4.18.5-041805-generic ,但问题仍然存在。 其他一切都运作良好。

我还使用apt(包括头文件,模块和模块 – 额外软件包)安装了4.15.0-29-generic4.15.0-24-generic ,但没有一个解决了这个问题。

编辑2:

dmesg | 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:

我能够使以太网工作,但具有非常具体的解决方法程序:

要按照@ chili555的建议安装r8168-dkms ,我必须在系统BIOS中禁用安全启动。 我从来没有安装它,但我确实禁用了安全启动,重启后,以太网连接并按预期工作。

我进一步重新启动并注意到问题仍然存在,就在我发现以下内容时:

  • 我的BIOS配置在重启时保留 。 无论重启多少次,都会禁用安全启动function。
  • 如果我进入BIOS配置, 根本不做任何改动 ,选择save and reset选项,等待系统启动,以太网工作。
  • 即使禁用安全启动,如果我不执行上一步骤中描述的过程,以太网也不起作用。
  • 这是可重复的启动,使用之前测试过的常规Ubuntu最新内核和主线内核( 4.15.0-33-generic4.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创建的接口(我已经停止了)并禁用该服务以确保无关)。

我出现了类似的以太网问题。

尝试使用不同的以太网电缆,以及交换机/集线器/路由器上的不同端口,并查看您的链路是否保持在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 

几天后我发现问题已经解决了。 我最好的选择是系统更新可以解决问题。

同时当问题尚未“自行解决”时,我所做的就是进入BIOS并在每次重新启动机器时禁用安全启动。 它是强制性的,即使我的BIOS保持设置。