[R8168] Wired network connection fails to connect after resume (from suspend)

Encountered quite a strange issue recently which now appears constantly.
Wired network connection can not be established after resume (from suspend) - the "network" icon spins endlessly.
Connection gets into normal working state only after reboot (again, had to reboot to even create this topic with a proper attachments/logs)

Some tries:

  • sudo pacman -Suy didn't make a difference.
  • active/inactive systemd-resolved.service has no effect
  • "Ignored" set as method to "IPv6" section in "Wired connection" settings - has no effect

Details:

[roman@roman-pc ~]$ uname -a
Linux roman-pc 5.0.18-1-MANJARO #1 SMP PREEMPT Wed May 22 17:35:29 UTC 2019 x86_64 GNU/Linux

[roman@roman-pc ~]$ inxi -n
Network:   Device-1: Intel Wireless-AC 9560 [Jefferson Peak] driver: iwlwifi
           IF: wlo1 state: down mac: 5e:98:81:e3:a3:bf
           Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet driver: r8168
           IF: enp59s0 state: up speed: 1000 Mbps duplex: full mac: 3c:2c:30:99:09:d6

Crucial services statuses:

[roman@roman-pc ~]$ sudo systemctl status NetworkManager
● NetworkManager.service - Network Manager
   Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; enabled; vendor preset: disabled)
  Drop-In: /usr/lib/systemd/system/NetworkManager.service.d
           └─NetworkManager-ovs.conf
   Active: active (running) since Tue 2019-06-11 08:47:55 EEST; 1min 26s ago
     Docs: man:NetworkManager(8)
 Main PID: 4850 (NetworkManager)
    Tasks: 3 (limit: 4915)
   Memory: 5.3M
   CGroup: /system.slice/NetworkManager.service
           └─4850 /usr/bin/NetworkManager --no-daemon

чер 11 08:48:40 roman-pc NetworkManager[4850]: <info>  [1560232120.8153] manager: startup complete
чер 11 08:48:40 roman-pc NetworkManager[4850]: <warn>  [1560232120.8154] device (enp59s0): Activation: failed for connection 'Wired connection 1'
чер 11 08:48:40 roman-pc NetworkManager[4850]: <info>  [1560232120.8156] device (enp59s0): state change: failed -> disconnected (reason 'none', sys-iface-s>
чер 11 08:48:40 roman-pc NetworkManager[4850]: <info>  [1560232120.8167] policy: auto-activating connection 'Wired connection 1' (d602a2d2-c05d-3d36-a913-a>
чер 11 08:48:40 roman-pc NetworkManager[4850]: <info>  [1560232120.8170] device (enp59s0): Activation: starting connection 'Wired connection 1' (d602a2d2-c>
чер 11 08:48:40 roman-pc NetworkManager[4850]: <info>  [1560232120.8171] device (enp59s0): state change: disconnected -> prepare (reason 'none', sys-iface->
чер 11 08:48:40 roman-pc NetworkManager[4850]: <info>  [1560232120.8173] manager: NetworkManager state is now CONNECTING
чер 11 08:48:40 roman-pc NetworkManager[4850]: <info>  [1560232120.8175] device (enp59s0): state change: prepare -> config (reason 'none', sys-iface-state:>
чер 11 08:48:40 roman-pc NetworkManager[4850]: <info>  [1560232120.8179] device (enp59s0): state change: config -> ip-config (reason 'none', sys-iface-stat>
чер 11 08:48:40 roman-pc NetworkManager[4850]: <info>  [1560232120.8181] dhcp4 (enp59s0): activation: beginning transaction (timeout in 45 seconds)
lines 1-22/22 (END)


[roman@roman-pc ~]$ sudo systemctl status systemd-resolved.service
● systemd-resolved.service - Network Name Resolution
   Loaded: loaded (/usr/lib/systemd/system/systemd-resolved.service; enabled; vendor preset: enabled)
   Active: active (running) since Tue 2019-06-11 08:38:22 EEST; 13min ago
     Docs: man:systemd-resolved.service(8)
           https://www.freedesktop.org/wiki/Software/systemd/resolved
           https://www.freedesktop.org/wiki/Software/systemd/writing-network-configuration-managers
           https://www.freedesktop.org/wiki/Software/systemd/writing-resolver-clients
 Main PID: 4646 (systemd-resolve)
   Status: "Processing requests..."
    Tasks: 1 (limit: 4915)
   Memory: 2.9M
   CGroup: /system.slice/systemd-resolved.service
           └─4646 /usr/lib/systemd/systemd-resolved

чер 11 08:38:22 roman-pc systemd[1]: Starting Network Name Resolution...
чер 11 08:38:22 roman-pc systemd-resolved[4646]: Positive Trust Anchors:
чер 11 08:38:22 roman-pc systemd-resolved[4646]: . IN DS 19036 8 2 49aac11d7b6f6446702e54a1607371607a1a41855200fd2ce1cdde32f24e8fb5
чер 11 08:38:22 roman-pc systemd-resolved[4646]: . IN DS 20326 8 2 e06d44b80b8f1d39a95c0b0d7c65d08458e880409bbc683457104237c7f8ec8d
чер 11 08:38:22 roman-pc systemd-resolved[4646]: Negative trust anchors: 10.in-addr.arpa 16.172.in-addr.arpa 17.172.in-addr.arpa 18.172.in-addr.arpa 19.172>
чер 11 08:38:22 roman-pc systemd-resolved[4646]: Using system hostname 'roman-pc'.
чер 11 08:38:22 roman-pc systemd[1]: Started Network Name Resolution.

[roman@roman-pc ~]$ systemctl status dhcpcd.service
● dhcpcd.service - dhcpcd on all interfaces
   Loaded: loaded (/usr/lib/systemd/system/dhcpcd.service; disabled; vendor preset: disabled)
   Active: active (running) since Tue 2019-06-11 08:40:07 EEST; 13min ago
  Process: 4698 ExecStart=/usr/bin/dhcpcd -q -b (code=exited, status=0/SUCCESS)
 Main PID: 4701 (dhcpcd)
    Tasks: 1 (limit: 4915)
   Memory: 2.1M
   CGroup: /system.slice/dhcpcd.service
           └─4701 /usr/bin/dhcpcd -q -b

чер 11 08:40:07 roman-pc dhcpcd[4698]: forked to background, child pid 4701
чер 11 08:40:07 roman-pc systemd[1]: Started dhcpcd on all interfaces.
чер 11 08:40:07 roman-pc dhcpcd[4701]: DUID 00:04:4c:4c:45:44:00:39:46:10:80:57:c8:c0:4f:58:52:32
чер 11 08:40:07 roman-pc dhcpcd[4701]: enp59s0: IAID 30:99:09:d6
чер 11 08:40:07 roman-pc dhcpcd[4701]: dhcpcd_prestartinterface: wlo1: Operation not possible due to RF-kill
чер 11 08:40:07 roman-pc dhcpcd[4701]: wlo1: waiting for carrier
чер 11 08:40:07 roman-pc dhcpcd[4701]: enp59s0: soliciting a DHCP lease
чер 11 08:40:07 roman-pc dhcpcd[4701]: enp59s0: soliciting an IPv6 router
чер 11 08:40:19 roman-pc dhcpcd[4701]: enp59s0: no IPv6 Routers available
чер 11 08:47:55 roman-pc dhcpcd[4701]: wlo1: new hardware address: ca:5d:8b:d3:a2:7c

Klog throws the same messages iteratively (while the "network" icon spins endlessly):

|11.06.19 08:42|kdeinit5|plasma-nm: Unhandled active connection state change:  1|
|---|---|---|
|11.06.19 08:42|avahi-daemon|Joining mDNS multicast group on interface enp59s0.IPv6 with address fe80::3e2c:30ff:fe99:9d6.|
|11.06.19 08:42|avahi-daemon|New relevant interface enp59s0.IPv6 for mDNS.|
|11.06.19 08:42|avahi-daemon|Registering new address record for fe80::3e2c:30ff:fe99:9d6 on enp59s0.*.|
|11.06.19 08:43|NetworkManager|<warn>  [1560231797.7913] dhcp4 (enp59s0): request timed out|
|11.06.19 08:43|NetworkManager|<info>  [1560231797.7913] dhcp4 (enp59s0): state changed unknown -> timeout|
|11.06.19 08:43|NetworkManager|<info>  [1560231797.8113] dhcp4 (enp59s0): canceled DHCP transaction|
|11.06.19 08:43|NetworkManager|<info>  [1560231797.8114] dhcp4 (enp59s0): state changed timeout -> done|
|11.06.19 08:43|NetworkManager|<info>  [1560231797.8119] device (enp59s0): state change: ip-config -> failed (reason 'ip-config-unavailable', sys-iface-state: 'managed')|
|11.06.19 08:43|NetworkManager|<info>  [1560231797.8129] manager: NetworkManager state is now DISCONNECTED|
|11.06.19 08:43|NetworkManager|<warn>  [1560231797.8139] device (enp59s0): Activation: failed for connection 'Wired connection 1'|
|11.06.19 08:43|NetworkManager|<info>  [1560231797.8147] device (enp59s0): state change: failed -> disconnected (reason 'none', sys-iface-state: 'managed')|
|11.06.19 08:43|avahi-daemon|Withdrawing address record for fe80::3e2c:30ff:fe99:9d6 on enp59s0.|
|11.06.19 08:43|avahi-daemon|Leaving mDNS multicast group on interface enp59s0.IPv6 with address fe80::3e2c:30ff:fe99:9d6.|
|11.06.19 08:43|avahi-daemon|Interface enp59s0.IPv6 no longer relevant for mDNS.|
|11.06.19 08:43|NetworkManager|<info>  [1560231797.8196] policy: auto-activating connection 'Wired connection 1' (d602a2d2-c05d-3d36-a913-a611076243d0)|
|11.06.19 08:43|NetworkManager|<info>  [1560231797.8208] device (enp59s0): Activation: starting connection 'Wired connection 1' (d602a2d2-c05d-3d36-a913-a611076243d0)|
|11.06.19 08:43|NetworkManager|<info>  [1560231797.8213] device (enp59s0): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed')|
|11.06.19 08:43|NetworkManager|<info>  [1560231797.8226] manager: NetworkManager state is now CONNECTING|
|11.06.19 08:43|NetworkManager|<info>  [1560231797.8235] device (enp59s0): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')|
|11.06.19 08:43|NetworkManager|<info>  [1560231797.8250] device (enp59s0): state change: config -> ip-config (reason 'none', sys-iface-state: 'managed')|
|11.06.19 08:43|NetworkManager|<info>  [1560231797.8260] dhcp4 (enp59s0): activation: beginning transaction (timeout in 45 seconds)|
|11.06.19 08:43|kdeinit5|plasma-nm: Unhandled active connection state change:  1|

The r8168 driver has been experiencing major problems lately.

The r8169 kernel module is now the preferred driver.

Follow the instructions below to get your r8168 LAN adapter working properly.

Uninstall the linuxXXX-r8168 driver:

Open Manjaro Settings Manager -> Hardware configuration -> Network controller

Right click on the RTL8111/8168/8411 ethernet device and select “Remove”.

The following steps are not normally required but, in some cases this may help.

Run the following commands (they will take a while to execute):

sudo depmod -a
sudo mkinitcpio -P 

After completing all those steps, power off the computer completely, then restart (cold boot).

After you restart the computer, the 8169 kernel module should now be automatically loaded.

If the r8169 kernel module is not loaded automatically when you reboot (after uninstalling r8168) then do this:

Open any file located in /etc/modprobe.d and ensure there is no reference to r8169.

Any file that contains the line:

blacklist r8169

Change to:

blacklist r8168

Save the edited conf file with root permissions, and then reboot

Alternately, you may delete the conf file entirely, (if it only contains the entry "blacklist r8169").

Example:

If /etc/modprobe.d contains a file named r8169_blacklist.conf then you can delete it with this command:

sudo rm /etc/modprobe.d/r8169_blacklist.conf

Be very careful, you do not make any errors when using the "rm" command with sudo privileges.

Reboot after making any changes to files in /etc/modprobe.d.

3 Likes

Nice workaround.
Removed r8168, shut down, rebooted, suspended and resumed - Ethernet connection is good.
Thanks. Any chances that that "bad" driver could get in the way in future kernel upgrades?

Everything should be good now. :smile:

1 Like

Nice, it looks like this fixed my computer being unable to suspend properly too. For me resume was ok.

Now I don't understand why r8169 is included in linux, but r8168 requires a separate package. Why is that the case?

R8168 is the proprietary driver from Realtek. For many years it was far more reliable than the kernel module (driver) that was developed by the Linux community. Times change and the open source driver is now more reliable than the manufacturers driver.

The linux kernel team does not like the inclusion of drivers that are not open source in the kernel.

Glad you got things working.

1 Like

I see, thanks for your reply. However I don't think R8168 is proprietary because that's not what Manjaro Settings says. So I found this: https://unix.stackexchange.com/questions/26997/whats-the-difference-between-the-drivers-r8169-and-r8168.

Unfortunately my computer still can't suspend properly all the times, I have to try something different.

Well if you look in your dmesg logs for errors, you will see a message about how "r8168 taints the kernel". That is the error message that is displayed whenever you are loading a module that is not open source. So I think I'll rely on the messages from the kernel itself a little more than messages from MSM.

I have written suspend services to solve this issue for many different drivers including the r8168/69. You can find how to write systemd services on this page:

2 Likes

Forum kindly sponsored by Bytemark