1

I have this weird issue whenever I wake up my lap top from sleeping, the Ethernet connection could not be detected. I managed to get it working by removing network module and adding it again.

rmmod r8169
modprobe r8169

However I want to make those wake ups seamless, I don't want to manually run those command when lap wake up in order to have Ethernet connection.

uname -a
Linux pc-name 4.16.0-041600-generic #201804012230 SMP Sun Apr 1 22:31:39 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

ifconfig -a
enp2s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.50  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::7020:d2e9:225b:9004  prefixlen 64  scopeid 0x20<link>
        ether 54:48:10:e3:a3:56  txqueuelen 1000  (Ethernet)
        RX packets 5919  bytes 3436132 (3.4 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 5752  bytes 667433 (667.4 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 8101  bytes 610092 (610.0 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 8101  bytes 610092 (610.0 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlp3s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.114  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::392d:4fdb:372f:3381  prefixlen 64  scopeid 0x20<link>
        ether 34:e1:2d:f8:1d:f3  txqueuelen 1000  (Ethernet)
        RX packets 9592  bytes 4262963 (4.2 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 6766  bytes 1125519 (1.1 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Please let me share additional information which is helpful to resolve the issue, I do not know which.

Thanks

2 Answers 2

0

Same thing happened to me years ago on an older laptop and I used this script:

#!/bin/bash

# NAME: r8169-reset
# PATH: /lib/systemd/system-sleep
# DESC: Reset Ethernet card after suspend, not working automatically
# DATE: Feb ?? 2017. Modified: Aug 5, 2018.

MYNAME=$0

restart_ethernet() {
   /usr/bin/logger $MYNAME 'restart_ethernet(r8169) BEGIN'
   /sbin/modprobe -v -r r8169
   /sbin/modprobe -v r8169
   /usr/bin/logger 'systemctl restart NetworkManager.service (SUPPRESED)'
   /usr/bin/logger $MYNAME 'restart_ethernet(r8169) END'
}

/usr/bin/logger $MYNAME 'case=[' ${1}' ]'
case "${1}/${2}" in
   hibernate|suspend|pre*)
      ;;
   resume|thaw|post*)
      restart_ethernet;;
esac

Place the script in the directory /lib/systemd/system-sleep with the name r8169-reset. Mark the script executable with the command

sudo chmod a+x /lib/systemd/system-sleep/r8169-reset

Reboot and script will run automatically with every resume after suspend.

3
0

In terminal, type sudo lshw -C network, and look for a line that looks like this:

product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller

Note the 8168.

If you have a similar controller, you might try installing this driver to see if it solves your problem.

sudo apt-get update
sudo apt-get install dkms r8168-dkms
4
  • dkms already installed, but apt says r8168-dkms is the source of the module. What would help me the source of the module? Jul 5, 2019 at 19:53
  • @NikolaLozanovski once installed, dkms builds the module for your current kernel, and for future kernels when you do a Software Update that includes a new kernel. No effort required on your part! Isn't that nice?
    – heynnema
    Jul 5, 2019 at 19:56
  • product: RTL810xE PCI Express Fast Ethernet controller Is r8168-dkms suitable for my controller, if yes, what is the difference between it and r8169? Jul 5, 2019 at 20:17
  • @NikolaLozanovski The r8169 is known to have disconnect issues. The r8168-dkms is suitable if you have the controller described in my answer.
    – heynnema
    Jul 6, 2019 at 0:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .