1

I've just upgraded to 21.04. Now after waking from suspension. The network cable is shown as unplugged. I found a solution. which is I have to remove and reinstall the ethernet device driver. Via modprobe -r and then -i. Everytime after waking from suspend.

Is there any elegant and simple solution to fix this?

Upgraded from 20.10 to 21.04

lspci -nn | grep -i ethernet

04:00.0 Ethernet controller [0200]: Qualcomm Atheros Killer E220x Gigabit Ethernet Controller [1969:e091] (rev 13)

sudo lshw -C network -network
description: Ethernet interface product: Killer E220x Gigabit Ethernet Controller vendor: Qualcomm Atheros physical id: 0 bus info: pci@0000:04:00.0 logical name: enp4s0 version: 13 serial: 44:8a:5b:46:f3:a5 size: 1Gbit/s capacity: 1Gbit/s width: 64 bits clock: 33MHz capabilities: pm pciexpress msi msix bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation configuration: autonegotiation=on broadcast=yes driver=alx driverversion=5.11.0-18-generic duplex=full ip=192.168.1.158 latency=0 link=yes multicast=yes port=twisted pair speed=1Gbit/s resources: irq:19 memory:f7900000-f793ffff ioport:d000(size=128)
-network DISABLED description: Wireless interface product: Wireless 3160 vendor: Intel Corporation physical id: 0 bus info: pci@0000:05:00.0 logical name: wlp5s0 version: 83 serial: 30:3a:64:5f:7b:1b width: 64 bits clock: 33MHz capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless configuration: broadcast=yes driver=iwlwifi driverversion=5.11.0-18-generic firmware=17.3216344376.0 3160-17.ucode latency=0 link=no multicast=yes wireless=IEEE 802.11 resources: irq:35 memory:f7800000-f7801fff

inxi -Fxz System: Kernel: 5.11.0-18-generic x86_64 bits: 64 compiler: gcc v: 10.2.1 Desktop: GNOME 3.38.4 Distro: Ubuntu 21.04 (Hirsute Hippo) Machine: Type: Laptop System: Micro-Star product: GP70 2PE v: REV:1.0 serial: <filter> Mobo: Micro-Star model: MS-175A v: REV:1.0 serial: <filter> BIOS: American Megatrends v: E175AIMS.109 date: 05/27/2014 Battery: ID-1: BAT1 charge: 6.8 Wh condition: 6.8/48.8 Wh (14%) model: MSI Corp. MS-175A status: Full CPU: Info: Quad Core model: Intel Core i7-4710HQ bits: 64 type: MT MCP arch: Haswell rev: 3 L2 cache: 6 MiB flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 39909 Speed: 2561 MHz min/max: 1800/3500 MHz Core speeds (MHz): 1: 2561 2: 2852 3: 2695 4: 2582 5: 2495 6: 2494 7: 2467 8: 2487 Graphics: Device-1: Intel 4th Gen Core Processor Integrated Graphics vendor: Micro-Star MSI driver: i915 v: kernel bus ID: 00:02.0 Device-2: NVIDIA GM108M [GeForce 840M] vendor: Micro-Star MSI driver: nvidia v: 460.80 bus ID: 01:00.0 Display: x11 server: X.Org 1.20.11 driver: loaded: modesetting,nvidia unloaded: fbdev,nouveau,vesa resolution: 1600x900 OpenGL: renderer: GeForce 840M/PCIe/SSE2 v: 4.6.0 NVIDIA 460.80 direct render: Yes Audio: Device-1: Intel Xeon E3-1200 v3/4th Gen Core Processor HD Audio vendor: Micro-Star MSI driver: snd_hda_intel v: kernel bus ID: 00:03.0 Device-2: Intel 8 Series/C220 Series High Definition Audio vendor: Micro-Star MSI driver: snd_hda_intel v: kernel bus ID: 00:1b.0 Sound Server: ALSA v: k5.11.0-18-generic Network: Device-1: Qualcomm Atheros Killer E220x Gigabit Ethernet vendor: Micro-Star MSI driver: alx v: kernel port: d000 bus ID: 04:00.0 IF: enp4s0 state: up speed: 1000 Mbps duplex: full mac: <filter> Device-2: Intel Wireless 3160 driver: iwlwifi v: kernel port: d000 bus ID: 05:00.0 IF: wlp5s0 state: down mac: <filter> Bluetooth: Device-1: Intel Bluetooth wireless interface type: USB driver: btusb v: 0.8 bus ID: 1-1.3:4 Report: ID: hci0 state: up running pscan bt-v: 2.1 lmp-v: 4.0 address: <filter> Drives: Local Storage: total: 931.51 GiB used: 596.27 GiB (64.0%) ID-1: /dev/sda vendor: Toshiba model: MQ01ABD100 size: 931.51 GiB temp: 39 C Partition: ID-1: / size: 914.9 GiB used: 596.27 GiB (65.2%) fs: ext4 dev: /dev/sda4 ID-2: /boot/efi size: 512 MiB used: 4 KiB (0.0%) fs: vfat dev: /dev/sda3 Swap: ID-1: swap-1 type: file size: 2 GiB used: 23.8 MiB (1.2%) file: /swapfile Sensors: System Temperatures: cpu: 84.0 C mobo: N/A gpu: nvidia temp: 42 C Fan Speeds (RPM): N/A Info: Processes: 365 Uptime: 7h 58m Memory: 15.55 GiB used: 5.48 GiB (35.2%) Init: systemd runlevel: 5 Compilers: gcc: 10.3.0 Packages: 2784 Shell: Bash v: 5.1.4 inxi: 3.3.01

cat /etc/network/interfaces and cat /etc/netplan/*.yaml cat: /etc/network/interfaces: No such file or directory cat: and: No such file or directory cat: cat: No such file or directory

Let NetworkManager manage all devices on this system

network: version: 2 renderer: NetworkManager

Update. I followed the suggestions here. The drivers are not automatically removed and installed after waking from suspension. https://askubuntu.com/a/1058760/1247412

3 Answers3

0

Try this... in terminal do nm-connection-editor and select your Wired Connection to edit.

  • confirm Device ethernet address
  • confirm WOL
  • change Link Negotiation to Automatic
    • or try Manual/1000Mb/full
  • reboot and retest

enter image description here

Also verify Connect automatically...

enter image description here

Update #1:

See bug report https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/1931301

Update #2:

Used workaround fixes from Ubuntu 18.04 - Ethernet disconnected after suspend

heynnema
  • 70,711
  • Check your spelling in the first line, second shaded block :) – Raffles Jun 16 '21 at 15:48
  • 1
    @Raffles Thanks! The coffee hasn't fully kicked in yet :-) – heynnema Jun 16 '21 at 15:53
  • These are the defaults in nm-connection-editor

    Connect Automatically with priority -999 Link Negotiation - Manual 100mb/s ( although it is 1000mbs normally ) WOL - Default

    I tried Automatic Link Negotiation. and also manually 1gps. Still doesn't work.

    – john lau Jun 17 '21 at 03:58
  • @johnlau Change Connect Automatically priority=0, and Link Neg=ignored. See if there's any difference. – heynnema Jun 17 '21 at 12:58
  • @johnlau Show me cat /etc/initramfs-tools/conf.d/resume and grep -i GRUB_CMDLINE_LINUX /etc/default/grub. – heynnema Jun 17 '21 at 13:02
  • @johnlau When it fails, instead of reloading the alx module, try sudo dhclient enp4s0 and see if that brings it back. – heynnema Jun 17 '21 at 13:55
  • @heynnema i set priroty to 0 and link Neg to ignored. No differences. – john lau Jun 18 '21 at 06:49
  • @heynnema cat /etc/initramfs-tools/conf.d/resume

    cat: /etc/initramfs-tools/conf.d/resume: No such file or directory

    – john lau Jun 18 '21 at 06:50
  • @heynnema grep -i GRUB_CMDLINE_LINUX /etc/default/grub GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" GRUB_CMDLINE_LINUX="" – john lau Jun 18 '21 at 06:50
  • @heynnema sudo dhclient enp4s0 RTNETLINK answers: No such device – john lau Jun 18 '21 at 06:52
  • @johnlau Add yourself to the bug report that I gave a link for in a prior comment. Add a "this effects me too" statement. – heynnema Jun 18 '21 at 13:00
  • @heynnema Done. – john lau Jun 18 '21 at 13:48
0

I had the same issue with upgrade from 20.08 to 21.04, used wireless for a bit and today reinstalled 21.04 from scratch assuming it was some upgrading bug.

Fresh Install still fails the same way.

mike@mike-XPS-8930:~$ lspci -nn | grep -i ethernet 04:00.0 Ethernet controller [0200]: Qualcomm Atheros Killer E2400 Gigabit Ethernet Controller [1969:e0a1] (rev 10) mike@mike-XPS-8930:~$

Mike
  • 61
0

I think a reboot is too heavy and uneeded. Simply reload network card kernel modules can rejuvenate that dead network card.

In recent time i have same problems with my network card to go up from sleep to ram. But in the past i am 100% sure i has no problems. I suspect is the new kernel drivers, 5.11.0-25-generic, to blame here

So in Ubuntu 20.04 with lshw -C network i get the driver name, then with modprobe -rv driver_name will remove and with modprobe -v driver_name my cable ethernet network is back

Nothing else work, systemctl restart NetworkManager cant wake up my ethernet card without modprobe driver recicle step. I suspect is that WOL thing the culprit i mean they are waiting for a lan wake up not a local resume from sleep

aug 27 01:54:53 berbecel NetworkManager[2357602]: <info>  [1630018493.3313] manager: sleep: sleep requested (sleeping: no  enabled: yes)
aug 27 01:54:53 berbecel NetworkManager[2357602]: <info>  [1630018493.3314] manager: NetworkManager state is now ASLEEP
aug 27 01:54:53 berbecel NetworkManager[2357602]: <info>  [1630018493.3317] device (enp2s0): state change: activated -> deactivating (reason 'sleeping', sys-iface-state: 'managed')
aug 27 01:54:53 berbecel NetworkManager[2357602]: <info>  [1630018493.3692] device (enp2s0): state change: deactivating -> disconnected (reason 'sleeping', sys-iface-state: 'managed')
aug 27 01:54:53 berbecel NetworkManager[2357602]: <info>  [1630018493.3881] dhcp4 (enp2s0): canceled DHCP transaction
aug 27 01:54:53 berbecel NetworkManager[2357602]: <info>  [1630018493.3881] dhcp4 (enp2s0): state changed bound -> done
aug 27 01:54:53 berbecel NetworkManager[2357602]: <info>  [1630018493.3920] device (enp2s0): state change: disconnected -> unmanaged (reason 'sleeping', sys-iface-state: 'managed')
aug 28 02:24:11 berbecel NetworkManager[2357602]: <info>  [1630106651.3796] manager: sleep: wake requested (sleeping: yes  enabled: yes)
aug 28 02:24:11 berbecel NetworkManager[2357602]: <info>  [1630106651.3797] device (enp2s0): state change: unmanaged -> unavailable (reason 'managed', sys-iface-state: 'managed')
aug 28 02:24:11 berbecel NetworkManager[2357602]: <info>  [1630106651.3812] manager: NetworkManager state is now DISCONNECTED

but then

aug 28 02:47:59 berbecel NetworkManager[2368981]: <info>  [1630108079.2431] device (enp2s0): driver '(null)' does not support carrier detection.
aug 28 02:47:59 berbecel NetworkManager[2368981]: <info>  [1630108079.2433] device (enp2s0): driver 'alx' does not support carrier detection.
aug 28 02:47:59 berbecel NetworkManager[2368981]: <info>  [1630108079.2436] manager: (enp2s0): new Ethernet device (/org/freedesktop/NetworkManager/Devices/2)
aug 28 02:47:59 berbecel NetworkManager[2368981]: <info>  [1630108079.2445] device (enp2s0): state change: unmanaged -> unavailable (reason 'managed', sys-iface-state: 'external')
aug 28 02:47:59 berbecel NetworkManager[2368981]: <info>  [1630108079.2565] device (enp2s0): state change: unavailable -> disconnected (reason 'none', sys-iface-state: 'managed')
aug 28 02:47:59 berbecel NetworkManager[2368981]: <info>  [1630108079.2577] device (enp2s0): Activation: starting connection 'rdslink' (7ef38c4e-886b-3738-b740-eb3b676cde2d)
aug 28 02:47:59 berbecel NetworkManager[2368981]: <info>  [1630108079.2578] device (enp2s0): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed')
aug 28 02:47:59 berbecel NetworkManager[2368981]: <info>  [1630108079.2586] device (enp2s0): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
aug 28 02:47:59 berbecel NetworkManager[2368981]: <info>  [1630108079.2592] device (enp2s0): state change: config -> failed (reason 'config-failed', sys-iface-state: 'managed')
aug 28 02:47:59 berbecel NetworkManager[2368981]: <warn>  [1630108079.2606] device (enp2s0): Activation: failed for connection 'rdslink'

so look like device (enp2s0): driver 'alx' does not support carrier detection. means my QCA8171 Gigabit Ethernet has no WOL suport and going to sleep means will sleep forewer waiting for a WOl signal who will never arrive?

  • Well for Ubuntu Linux 20.04, my distro, is enough to recycle the alx network card drivers. If NetworkManager service is already running the nic card will be autodetected imediately, if not will be needed a NetworkManager service restart. This means:

    sudo modprobe -rv alx sudo modprobe -v alx

    is enough. If not a

    sudo systemctl restart NetworkManager should be enough

    – totedati Aug 31 '21 at 01:18