0

I'm a complete novice at Linux. I tried running Ethernet on Ubuntu 20.04 and it didn't run, I got nothing, not even wired unmanaged. Ethernet is working fine on Windows 10. The Output of

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:05:00.0 logical name: enp5s0 version: 15 serial: 2c:f0:5d:66:42:09 size: 1Gbit/s 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 driverversion=5.11.0-27-generic duplex=full firmware=rtl8168h-2_0.0.2 02/26/15 latency=0 link=yes multicast=yes port=twisted pair speed=1Gbit/s resources: irq:45 ioport:f000(size=256) memory:fe904000-fe904fff memory:fe900000-fe903fff

It was disabled earlier, but after following this solution, it showed wired unmanaged. I've tried various other solutions. None works for me so far. Some solutions are specific to Ubuntu 18.04 or older.

Terrance
  • 41,612
  • 7
  • 124
  • 183
  • You can try https://askubuntu.com/a/1321823/231142 but I think it needs some sort of internet to work so if you have Wifi working it should work fine. – Terrance Aug 24 '21 at 01:57
  • @Terrance , I followed that solution and ended up getting network Disabled in lshw -c network, for which I used sudo ifconfig epn5s0 up, but now it doesn't even show "wired unmanaged" – Chirag Mehta Aug 24 '21 at 02:35
  • oof, So it works now, the solution that worked for me is this The second answer (upvote wise) by vlada – Chirag Mehta Aug 24 '21 at 02:43
  • What driver does it show it is using? The reason I ask that is that the r8169 is very unstable on the RTL8168 chipset. – Terrance Aug 24 '21 at 03:04
  • @Terrance , For now, it is r8168. So, Ig the solution is what you mentioned + the link I've shared in the previous comment. Thank you for helping me on this – Chirag Mehta Aug 24 '21 at 11:18
  • That is good to know. You can write up what you did as an answer as it was multiple things that helped you. :) – Terrance Aug 24 '21 at 12:24
  • @Terrance Please see my answer. – heynnema Aug 24 '21 at 14:34

1 Answers1

0

After your fixes, you may find that ethernet is either intermittent, or only works after booting into Windows.

MSI/MSIX interrupts were enabled for certain ethernet cards in Ubuntu 20.xx. This can cause intermittent ethernet operation. Here's a patch to fix it. Follow the embedded instructions to install.

#!/bin/sh

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1779817

filename: r8169_disable_msi

Drop it in /etc/initramfs-tools/scripts/init-top and chmod a+x it. Add 'r8169_disable_msi'

to your kernel command line (/etc/default/grub, GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

usually.)

sudo -H gedit /etc/default/grub # to edit the file

Remember to update-initramfs and update-grub as necessary.

sudo update-initramfs -c -k $(uname -r)

sudo update-grub

reboot

For the moment it disables MSI on everything with the ID 0x10ec:0x8168, as there seems to

be no way to get the MAC version from userspace - and certainly not before the driver is

loaded. Other PCI IDs may need adding..

PREREQ="" prereqs() { echo "$PREREQ" } case $1 in

get pre-requisites

prereqs) prereqs exit 0 ;; esac

disable_msi () { for i in /sys/bus/pci/devices/*; do if [ $(cat $i/vendor) = "0x10ec" -a $(cat $i/device) = "0x8168" ]; then echo 0 >$i/msi_bus fi done }

for x in $(cat /proc/cmdline); do case ${x} in r8169_disable_msi) disable_msi break ;; esac done

heynnema
  • 70,711
  • I'm actually a novice at Linux, So, I don't understand even these simple instructions quite enough, I'll try to figure that out. Besides, is this solution for r8169 driver? Now, I'm using r8168 – Chirag Mehta Aug 25 '21 at 02:16
  • @ChiragMehta We were all Linux novices at some time :-) If your ethernet is stable and reliable, then you don't need to do this patch. If you find that ethernet doesn't work, or doesn't work after suspend/resume, or only works after booting to Windows first, then you'll need this patch. It applies to either the r8169 or r8168-dkms driver. – heynnema Aug 25 '21 at 15:27
  • My ethernet is stable but for some reason I'm getting around 135 mbps download on Ubuntu, while it's around 250 mbps on windows. – Chirag Mehta Aug 25 '21 at 16:51
  • @ChiragMehta Is that with VPN on? How are you testing this? – heynnema Aug 25 '21 at 17:06
  • Yes, it's with VPN on, but it's from my ISP's end (my college). I tested speed on Ookla and Cloudflare. I use Cloudflare's WARP sometimes to bypass restrictions but the speed is indistinguishable. – Chirag Mehta Aug 25 '21 at 17:18
  • @ChiragMehta VPN speeds will always be lower, mostly depending on where their server is located, how busy the server is, and the fact that it's VPN. Do you run a VPN app, or use CLI, to bring VPN up/down? Are you able to test with VPN down? – heynnema Aug 25 '21 at 17:24
  • VPN is on my ISP's end, not on my device. It's same for windows and Ubuntu. Since the server belongs to my Institute (IIT-Hyderabad), the ping is ~3 ms. I'm not using any VPN on my end to test speeds on both Windows and Ubuntu. I use CLI (cloudflare's WARP) when I need to surpass the restrictions put by my Institute, the speed tests conducted are without the use of CLI. – Chirag Mehta Aug 26 '21 at 03:43
  • @ChiragMehta The only way to really test speed is without VPN. Do you have access to another network connection that doesn't use VPN, just to test? – heynnema Aug 26 '21 at 13:36
  • No, the college doesn't provide any other network for any purposes, but, I don't understand why the speed would be different for Ubuntu and Windows despite having the same source and the same VPN from Institute. – Chirag Mehta Aug 26 '21 at 14:36
  • @ChiragMehta It's difficult to compare Windows vs Linux... as they do the same things slightly differently. Do you connect wireless or wired? Do you have access to another network besides the college? – heynnema Aug 26 '21 at 15:46
  • I'm connecting to wired network provided by college. Apart from that I've cellular data, i can use mobile hotspot. – Chirag Mehta Aug 26 '21 at 16:02
  • @ChiragMehta Although I expect slow results, go ahead and speedtest cellular/hotspot. – heynnema Aug 26 '21 at 17:41