Ubuntu 16.04 Realtek RTL8111/8168/8411 Ethernet driver is not maintaining a persistent connection

From the comments...

  1. you really do need to run r8168-dkms in your configuration

  2. undo all of the changes that you've made... they didn't fix the problem, only created new ones

  3. After closer review, I see that you're using the r8168-dkms (8.044.02-NAPI) for Ubuntu 17.10 (on a 16.04 system). Please install the correct version and retest.

  4. In your Network GUI, you have multiple "Wired Connection" profiles set up. They would be named Wired Connection, Wired Connection 1, Wired Connection 2, etc. Delete all except for Wired Connection.

Update #1:

Assuming that the current status is that dkms status shows r8168, 8.041.00 : added...

sudo dkms build r8168/8.041.00 -k "$(uname -r)/$(uname -p)"
sudo dkms install r8168/8.041.00 -k "$(uname -r)/$(uname -p)"

Note: you may have to confirm the correct values of r8168/8.041.00 (module/version) by either looking in /usr/src or /var/lib/dkms/r8168.

dkms status

Should show r8168, 8.041.0 installed.

reboot
modinfo r8168 | grep -i version

Should say 8.041.00.

Update #2:

  • r8168 v8.041.00 was too old for 16.04.2 (kernel 4.8.0-58)
  • we're now using r8168 v8.043.02

Update #3:

We'll completely remove r8168-dkms and un-blacklist r8169 and then reinstall r8168-dkms from the Ubuntu repos.

  • sudo dkms remove r8168/8.043.02 -k "$(uname -r)/$(uname -p)"
  • sudo apt-get purge r8168-dkms
  • cd /var/lib/dkms
  • ls -al
    • should not show r8168
  • cd /usr/src
  • ls -al
    • should not show r8168.043.02
  • find /lib -name r8168.ko
    • should not show r8168.ko
  • cd /etc/modprobe.d
  • ls -al r8168*
    • should show no files
  • grep -i r816 *
    • edit output of grep into question as update #n
  • cd
  • sudo modprobe -r r8168
  • sudo update-initramfs -u -k "$(uname -r)"
  • stop here, ping me at @heynnema