Score:1

Ubuntu 20.04 Connection failed

th flag

Recently installed Ubuntu 20.04 on my desktop pc and I have problem with wired connection on it. Every time I'm trying to connect I see the message "Connection failed. Activation of network connection failed". I have already tried to connect to my router through static ip, connect without the router, disabling IPv6 in my system and all the solutions from this site https://losst.ru/nastrojka-ubuntu-20-04-posle-ustanovki - sorry for russian, it's my native language and this site have a lot of possible solutions. Oh, and when I'm loading with ubuntu Live CD or in second OS Windows 10 there are no connection problems at all. So nothing helped for now. I can give any additional info needed. Please, help. @heynnema @nate Sorry for bothering you, I just turned off my pc for a couple of hours and now when I've turned it on connection just successfully established without a problem. Looks like one of the solutions solved my issue and I even didn't notice it in a moment. If it's still matters here's listing for your request: terminal

@heynnema here's output on your request: 02:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 0c)

And also problem came back, I don't think that I changed anything about my network connection, but it is broken again, same problem as before. About your past requests all that changed is in "ip a" enp2s0 has no more inet line in it

UPD: I don't know what's going on, connection failed and nothing helpes, I'm rebooting my PC and booting it in Win10 for several hours, after that I'm coming back in Ubuntu and everything working without any problem.

UPD 19.06 @heynnema Looks like this patch is not working for me, I'm pretty sure that I have installed it just like said in the instructions and nothing has changed, after reboot I'm still having connection problems.

@heynnema If by status you mean am I still havine problem then yes, I am. Everything just like before - if I reboot Ubuntu to Ubuntu then my connection failed, if I reboot Ubuntu-Win10-Ubuntu everything working fine. Sorry for bothering you so much, I just don't know what to do. Maybe I should just try to buy another network adapter if problem is in my hardware.

@heynnema Maybe I did something wrong? Here's the file which I have added in /etc/initramfs-tools/scripts/init-top and chmod a+x it. https://drive.google.com/file/d/1h7ytM_twvkMl_U0TE1-WdfRaljNxSMgM/view?usp=sharing Here is my GRUB command line after editing: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash r8169_disable_msi" After that I have updated initframs and updated grub as it said in instructions. What can be wrong?

UPD Yes, I rebooted after the patch. enter image description here enter image description here

heynnema avatar
ru flag
Has this connection ever worked before? Edit your question and show me `sudo lshw -C network` and `cat /etc/network/interfaces` and `cat /etc/netplan/*.yaml`. Start comments to me with @heynnema or I'll miss them.
Nate avatar
cl flag
Can you also show what @heynnema said and `ip a` and please tag me with @nate or I will miss them :P
heynnema avatar
ru flag
Edit your question and show me `lspci -nn | grep -i ethernet`.
heynnema avatar
ru flag
I just noticed that you updated your question, but forgot to inform me by starting a comment with @heynnema so I almost missed it. See Update #1 in my answer. If it helps to solve the problem, please remember to accept it by clicking on the checkmark icon that appears just to the left of my answer. Thanks!
heynnema avatar
ru flag
Status please...
heynnema avatar
ru flag
When you update your question, please remember to send me a comment that starts with @heynnema or I'll certainly miss your updates. Edit your question and show me `ls -al /etc/initramfs-tools/scripts/init-top` and `ls -al /boot`. Did you reboot after adding the patch?
heynnema avatar
ru flag
Also show me `sudo lshw -C network`. What other things did you do to try and fix this problem? Maybe one of them is interfering with my patch.
heynnema avatar
ru flag
In `terminal` do `cd /sys/bus/pci/devices/0000:02:00.0` and show me `cat vendor` and `cat device` and `cat msi_bus`.
Rungar avatar
th flag
@heynnema sorry, I didn't realize that I should add comment, not just tag you in main post. Updated my question with all the info you've asked
heynnema avatar
ru flag
Ah! The patch is working fine, but the reason it doesn't work is because the four symlinks in /boot are wrong. All were modified on the 11th. See what they're linked to and you can see what's wrong. Something must have gone wrong with an update? Do you know how to fix this?
Rungar avatar
th flag
@heynnema Yes, I can see that. That was just a few hours after I've installed Ubuntu on pc and I remember there were some mistakes when I was updating my system, but after reboot it wal looks like everything worked and no error messages, so I thought everything just have fixed. And no, for now I don't know how to fix this, but I'll try to find the solution. Thank you very much
heynnema avatar
ru flag
You'll use `sudo rm` and `sudo mv` and `sudo ln -s` commands. Do you need me to detail them?
Rungar avatar
th flag
@heynnema Well I know what for this commands needed. But I don't know what exactly I should do with or without them to fix my /boot problems. So if you can help me with this I will be grateful.
heynnema avatar
ru flag
Give me a couple of minutes to document the commands for you. Once the system is fixed and the ethernet works, please remember to accept my answer by clicking on the checkmark icon that appears just to the left of my answer. Fair enough?
Rungar avatar
th flag
@heynnema Yes, ofcourse
Score:0
ru flag

Edit /etc/network/interfaces, and change it to this...

auto lo
iface lo inet loopback

Your ethernet is connecting at 100Mb, but it's capable of 1Gb. This is either a cable problem (most common), or a switch/hub/router that's not capable of gigabit connections. Are you using cat 5e or cat 6 cables?

Update #1:

lspci -nn | grep -i ethernet = 02:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 0c)

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
#
# Attached is a work-around for the in-kernel driver that is as unhacky as I can make it.

# 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.) 

# 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..

# Still hoping we can cherry pick the in-driver workaround for bionic...?

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

Update #2:

The patch is working, but the ethernet is still failing, because the symlinks in /boot are wrong. See below...

enter image description here

Update #3:

cd /boot # change directory

ls -al # get current listing

sudo rm -i initrd.img # delete bad symlink

sudo rm -i vmlinuz # delete bad symlink

sudo mv initrd.img.old initrd.img # rename remaining symlink

sudo mv vmlinuz.old vmlinuz # rename remaining symlink

sudo ln -s initrd.img-5.8.0-43-generic initrd.img.old # recreate symlink

sudo ln -s vmlinuz-5.8.0-43-generic vmlinuz.old # recreate symlink

ls -al # compare new symlinks to original listing

reboot # reboot and verify ethernet operation

Rungar avatar
th flag
Changed interfaces as you said, it's sure won't be worse. And 100Mb is all what my provider can give me right now so it's not a problem.
heynnema avatar
ru flag
@Rungar Don't confuse what your ISP can provide, with the connection speed of your interface. Is the hardware (switch/hub/router) in your home capable of 1G? Have you tried a different cable?
Rungar avatar
th flag
It worked, thank you very much and sorry for disturbing you for so long. You are great
heynnema avatar
ru flag
@Rungar Glad it worked! You didn't disturb me :-)
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.