2

Yesterday, I (finally) upgrade my Ubuntu 18.04 to 20.04. The upgrade progressed smoothly and I was prompted to reboot. After the reboot, I can no longer connect to the Internet via Ethernet cable. WIFI connection seems OK.

I created a USB stick with Ubuntu 20.04 (and subsequently 20.10) and find that I have the same problem even running from the two USB stick trials.

My PC is a Dell Inspiron 3268. It is partition into Windows 10 and Ubuntu. The Ethernet connection has no problem on the Windows side. The network connection was running smoothly in Ubuntu 18.04 before the upgrade.

Here is the result running: sudo lshw -c network

 *-network                 
       description: Ethernet interface
       product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 0
       bus info: pci@0000:02:00.0
       logical name: enp2s0
       version: 15
       serial: 50:9a:4c:3a:1c:6b
       capacity: 1Gbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress msix bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=r8169 firmware=rtl8168h-2_0.0.2 02/26/15 latency=0 link=no multicast=yes port=MII
       resources: irq:19 ioport:e000(size=256) memory:df104000-df104fff memory:df100000-df103fff
  *-network
       description: Wireless interface
       product: QCA9565 / AR9565 Wireless Network Adapter
       vendor: Qualcomm Atheros
       physical id: 0
       bus info: pci@0000:03:00.0
       logical name: wlp3s0
       version: 01
       serial: b0:52:16:59:ac:93
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list rom ethernet physical wireless
       configuration: broadcast=yes driver=ath9k driverversion=5.4.0-66-generic firmware=N/A ip=192.168.43.91 latency=0 link=yes multicast=yes wireless=IEEE 802.11
       resources: irq:17 memory:df000000-df07ffff memory:df080000-df08ffff

I really need my Ethernet connection and cannot rely on WiFi. I would hate it if I eventually need to switch back to Windows as my primary OS.

Thanks ahead.

Dave T
  • 41
  • Try using the r8168 driver. sudo apt install dkms r8168-dkms. You might have to remove the r8169 driver, but I cannot remember off the top of my head how to remove that one. Make sure that you are connected via wifi when doing this. – Terrance Mar 05 '21 at 17:24
  • @Terrance, I tried the command but unfortunately it still is not working and lshw -c network now show the network "UNCLAIMED". I guess I screwed up something related to UEFI reboot with password. I plan to try to run the install command again later. Thanks. – Dave T Mar 06 '21 at 05:33
  • @Terrance, when I 1st run the "install dkms" command, I was asked to choose a password because of UEFI Secure Boot. I would need to supply the password after rebooting. After the reboot, an unfamiliar menu pop up. I chose the 1st option to "continue boot". I was not asked about the password. I guess that's how I screwed up. Now, running the command again would do nothing, stating "r8168-dkms is already the newest version". I guess I need to remove it first? Use "apt remove" or "dkms uninstall"? I am surprised if 20.04 cannot support my network card and I am the only one having this problem. – Dave T Mar 07 '21 at 10:15
  • Let me write this up. I found what I did to get rid of the 8169 driver that is not correct. – Terrance Mar 07 '21 at 15:35

2 Answers2

2

Shortening up this answer:

First, install the dkms driver for the r8168 chipset:

sudo apt install dkms r8168-dkms

Now, unload the current r8169 driver:

sudo rmmod r8169

Blacklist the r8169 driver to keep it from loading in the future:

echo "blacklist r8169" | sudo tee -a /etc/modprobe.d/blacklist.conf

Then load the r8168 driver:

sudo modprobe r8168

Then you can check the status of the driver by running both sudo lshw -C network and dkms status.

Example:

terrance@terrance-ubuntu:~$ sudo lshw -C network
  *-network                 
       description: Ethernet interface
       product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 0
       bus info: pci@0000:03:00.0
       logical name: eth0
       version: 0c
       serial: 40:8d:5c:4f:12:03
       size: 1Gbit/s
       capacity: 1Gbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=r8168 driverversion=8.048.00 duplex=full ip=10.0.0.100 latency=0 link=yes multicast=yes port=twisted pair speed=1Gbit/s
       resources: irq:27 ioport:ce00(size=256) memory:fdeff000-fdefffff memory:fddfc000-fddfffff

terrance@terrance-ubuntu:~$ dkms status nvidia, 460.39, 5.4.0-66-generic, x86_64: installed nvidia, 460.39, 5.8.0-43-generic, x86_64: installed nvidia, 460.39, 5.8.0-44-generic, x86_64: installed r8168, 8.048.00, 5.4.0-66-generic, x86_64: installed r8168, 8.048.00, 5.8.0-43-generic, x86_64: installed r8168, 8.048.00, 5.8.0-44-generic, x86_64: installed

Hope this helps!

Terrance
  • 41,612
  • 7
  • 124
  • 183
  • Thanks for the detailed instructions. I believe I have completed the steps successfully (even the UEFI related Enroll MOK in my case), but unfortunately still no luck. The network is still UNCLAIMED and dkms status shows r8168, 8.048.00, 5.4.0-66-generic, x86_64: installed (WARNING! Diff between built and installed module!) . – Dave T Mar 08 '21 at 04:54
  • @DaveT Try just running the sudo ./autorun.sh after removing the r8168-dkms version sudo apt remove r8168-dkms. Let's see if the version direct from Realtek by itself can claim your network. – Terrance Mar 08 '21 at 14:01
  • after apt remove r8168-dkms, running the autorun.sh showed some errors, such as ....system library:fopen:No such file or directory: ../crypto/bio/bss_file.c:69 .....no such file: ../crypto/bio/bss_file.c:76 ...... signing_key.pem: No such file or directory ..... missing System.map file. Skipping depmod .... modprobe: ERROR: could not insert r8168: Operation not permitted. Running dkms status shows nothing now, and lshw still shows network UNCLAIMED. – Dave T Mar 08 '21 at 16:18
  • @DaveT Disable Secure Boot in your BIOS and try again. – Terrance Mar 08 '21 at 16:44
  • I disabled the Secure Boot and ran the autorun.sh. Now, the lshw shows description: Ethernet interface, product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller, configuration: autonegotiation=on broadcast=yes driver=r8168 driverversion=8.048.03-NAPI duplex=full latency=0 link=yes multicast=yes port=twisted pair speed=100Mbit/s. However, Ethernet connection still fails. dkms status shows nothing. – Dave T Mar 09 '21 at 06:03
  • @DaveT So, it has now claimed the driver correctly, but I see your speed is wrong, unless you are connecting to a 100Mb hub/switch. You can get the dkms driver reinstalled, and it is a 3 step process. First, install the driver sudo apt install --reinstall r8168-dkms. Then you do a remove and reinstall the kernel driver sudo dkms uninstall -m r8168 -v 8.048.00 -k 5.4.0-66-generic && sudo dkms install -m r8168 -v 8.048.00 -k 5.4.0-66-generic --force. – Terrance Mar 09 '21 at 14:39
  • the PC may be connected to 100Mb router, which is provided by the service provider. I will carry out your suggestion probably on Friday, as I am away from the problem PC these few days. Thanks again. – Dave T Mar 09 '21 at 15:56
  • I have carried out the commands successfully. Still no Ethernet connection. lshw still shows description: Ethernet interface. dkms status shows r8168, 8.048.00, 5.4.0-66-generic, x86_64: installed. I tried to run ubuntu 18.04 from usb stick, Ethernet connection is OK. Checking lshw, I see the main difference is capabilities: pm msi pciexpress msix bus_master cap_list ethernet physical tp *mii* 10bt ......, configuration: ...... broadcast=yes driver=*r8169 duplex=full firmware=rtl8168h-2_0.0.2 02/26/15 ip=113.252.197.8 latency=0 link=yes multicast=yes port=MII speed=100Mbit/s* – Dave T Mar 12 '21 at 06:12
  • @DaveT It looks like it went back to the r8169 driver. Let's just blacklist that driver completely and re-enable the r8168 driver. sudo rmmod r8169 then type in echo "blacklist r8169" | sudo tee -a /etc/modprobe.d/blacklist.conf. Now reload the 8168 driver as sudo modprobe r8168. I do see that you are getting an IP on the ethernet that is an External IP address looks like your public IP. – Terrance Mar 12 '21 at 14:16
  • I may have misled you? In my previous comment, the "main difference is...." part are the lshw result of the working Ubuntu 18.04 version running from USB. So, the driver=r8169 is NOT from the 20.04 version. Please let me know if I should still try the rmmod, tee and modprobe commands. Sorry for the confusion. – Dave T Mar 12 '21 at 16:00
  • @DaveT Yeah, I would run it anyways. My card in my desktop that is using the RTL8111/8168 was originally loading with the r8169 driver on it. It would work OK for a while, then after sometime I would no longer be able to connect to the internet, even though it was showing that I was still getting IP addresses. I would actually have to hard power cycle my system to get it back up and working. Once I got rid of the r8169 driver and went to the r8168 driver, I have not had any issues since. – Terrance Mar 12 '21 at 16:48
  • @DaveT But yes, I did miss that part of you stating that you booted to the USB of 18.04. Somehow my brain said that was how it was loaded in 18.04 before and now it happened again. However, the firmware=rtl8168h-2_0.0.2 is what is puzzling me. I have two systems here both running 20.04 and both have 8168 chipsets on them, but neither has the firmware showing. – Terrance Mar 12 '21 at 16:57
  • I have executed the rmmod, tee and modprobe commands. Still no luck. lshw shows product: RTL8111/8168/8411 ... , configuration: autonegotiation=on broadcast=yes driver=r8168 .... and dkms status shows r8168, 8.048.00, 5.4.0-66-generic, x86_64: installed. As when I had Ethernet connection running from the 18.04 USB, the driver was showing r8169, so I guess my problem may be of other nature rather than / in addition to driver issues. No matter what, thanks you for spending time on this. – Dave T Mar 13 '21 at 15:36
  • @DaveT OK, it is showing the right driver. I am assuming then that it is not getting an IP address? Does ip addr look correct? Or are you receiving multiple IP addresses on one interface? If you are getting multiple IP addresses then there is a possibility that you have a /etc/dhcpcd.conf file that does not have your ethernet interface denied in it. This file can still exist when a system is upgraded from 18.04 to 20.04, which I had the joy of discovering recently because my server was getting multiple IPs from my router. – Terrance Mar 13 '21 at 21:47
  • @DaveT If that is the case, add a line before the interface line in the /etc/dhcpcd.conf file that is towards the bottom of the file that reads denyinterfaces enp2s0 as I believe that is the name of your ethernet interface name. – Terrance Mar 13 '21 at 21:50
  • No, I don't have a dhcpcd.conf file. When I was using 18.04 before the upgrade, I did not have any problem with network connection, so I have never needed to tweak the network settings. In the new 20.04, when the Ethernet cable is connected, ip addr shows no ip address, which make sense since I don't have a connection. If I connect via WIFI, I would have an ip address: 3: wlp3s0: <BROADCAST, MULTICAST, UP, LOWER_UP> mtu 1500 qdisc noqueue state UP ... inet 192.168.43.91/24 brd 192.168.43.255 scope global dynamic noprefixroute wlp3s0 ..... inet6 fe80::86f7:b2ef:61eb:6773/64 .... – Dave T Mar 14 '21 at 15:39
  • @DaveT So it is definitely using the exact same chipset for the Ethernet that I am using on two separate systems here: https://certification.ubuntu.com/hardware/201610-25169 The only other thing that I can think of is that I don't use Netplan as I am not a huge fan of it. I actually use the ifupdown and also setting net.ifnames=0 biosdevnames=0 in my grub config so the names of my connections are eth0, eth1, wlan0, etc. Do you have a .yaml file in your /etc/netplan/ folder showing your enp2s0 connection? I am hoping we can get to the bottom of why it is showing no link. – Terrance Mar 14 '21 at 17:52
  • I have nothing under the /etc/netplan/ folder. I see the Dell Inspiron 3268 is certified with version 16.04, and I had no problem during 18.04. Since I have the same problem running from a 20.04 Ubuntu USB stick, I tend to think the problem is hardware related. However, as you are having the same machines and have no problem, may be it is related to my specific machine, or you have some settings changed before and can avoid the problem in Ubuntu 20.04? One thing, my Inspiron's CPU is G4560 not a i5 in the certified machine, not sure whether it is relevant. – Dave T Mar 15 '21 at 01:43
  • @DaveT Nah, I don't think the CPU is relevant at this point. Try creating a yaml file then. At this point I don't think we have anything to lose. Also, don't forget to add your wifi to the yaml file as well. https://askubuntu.com/a/1051816/231142 – Terrance Mar 15 '21 at 03:19
  • I created a yaml file. I cannot get the wifi part working, so I just create a simple one with this contents (carriage return replaced with |) : network:| ethernets:| enp2s0:| dhcp4: true| renderer: networkd| version: 2. I ran sudo netplan --debug try. The trial could successfully conducted but still no Ethernet connection. I now suspect that the cause of my problem may be the router modem, a rather old model, supplied by my Internet Service Provider. I guess I will use wifi connection at the moment, and see if future Ubuntu updates can miraculously have my problem fixed. – Dave T Mar 15 '21 at 15:06
  • @DaveT I wish you good luck on the router part. I wish so much that we could have figured out why it was not getting any IP. It was my pleasure to stay working with you. =) – Terrance Mar 15 '21 at 15:07
  • Thanks again for your help. I have learned something. – Dave T Mar 15 '21 at 15:09
0

I have this issue on my Gigabyte DS3H.

Every time I boot in windows and reboot to linux 20.04, the connection works.

And when I reboot (without pass though windows), the connection is lost and the driver cannot connect again.

I solve the issue by installing new version of the Kernel. I was using the ubuntu 20.04 (kernel 5.11), but in the middle of the process I updated the distro to 21.04.

To update the ubuntu distro from lts to normal, you can follow this link: https://www.howtogeek.com/351360/how-to-upgrade-to-the-latest-version-of-ubuntu/

The commands below installs the mainline kernel installer for ubuntu:

sudo add-apt-repository ppa:cappelikan/ppa
sudo apt-get update
sudo apt-get install mainline

Just open the mainline from GUI apps.

Now you can see that there are a lot of new kernel compilations.

I suggest you to install the 5.14.2, because this version depends on glibc6 2.33 (still compatible with the ubuntu stable 21.04).

All other versions 5.14.3 and greater needs glibc6 2.34, that is not installed in the ubuntu stable 21.04 yet (2021/set).

This solved my problem with the realtek r8169 driver connection issue.

And if you have the secure boot enabled, you might need this also: https://gloveboxes.github.io/Ubuntu-for-Azure-Developers/docs/signing-kernel-for-secure-boot.html