Score:3

Ethernet connection not available (on Ubuntu 22.04.2 LTS dual-boot setup)

cg flag

Please note that I am a complete beginner to using Ubuntu

I have recently installed Ubuntu 22.04.2 LTS to my Windows desktop in a dual-boot setup.

Problem Statement

After installing Ubuntu, everything seemed to be in working order apart from my ethernet connection. This is what is currently displayed to me in the GUI 'Network' settings area:

enter image description here

In other words, my cable is apparently 'unplugged'. However, when I look inside ifconfig the ethernet device enp1s0 appears to be recognised:

johnny@johnnyb1694-Ubuntu:~$ sudo ifconfig
enp1s0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 68:1d:ef:33:00:6f  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 82  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        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 1956  bytes 165100 (165.1 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1956  bytes 165100 (165.1 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlp2s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.178.33  netmask 255.255.255.0  broadcast 192.168.178.255
        inet6 2a02:8011:ee20:0:2d7f:835f:2f06:564e  prefixlen 64  scopeid 0x0<global>
        inet6 fe80::c4f8:ab8f:6cd8:926c  prefixlen 64  scopeid 0x20<link>
        inet6 2a02:8011:ee20:0:bad5:c122:b248:29f9  prefixlen 64  scopeid 0x0<global>
        ether 78:8a:86:26:b7:e4  txqueuelen 1000  (Ethernet)
        RX packets 9329  bytes 7275533 (7.2 MB)
        RX errors 0  dropped 815  overruns 0  frame 0
        TX packets 6100  bytes 1222425 (1.2 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Another interesting observation is that when running dmesg the same device enp1s0 appears to be renamed from eth0 on startup until being momentarily shut down:

johnny@johnnyb1694-Ubuntu:~$ sudo dmesg | grep enp1s0
[    1.453852] r8169 0000:01:00.0 enp1s0: renamed from eth0
[    6.602587] r8169 0000:01:00.0 enp1s0: rtl_ocp_gphy_cond == 1 (loop: 10, delay: 25).
[    6.603179] r8169 0000:01:00.0 enp1s0: rtl_ocp_gphy_cond == 1 (loop: 10, delay: 25).
[    6.603791] r8169 0000:01:00.0 enp1s0: rtl_ocp_gphy_cond == 1 (loop: 10, delay: 25).
[    6.603802] r8169 0000:01:00.0 enp1s0: Link is Down
[    6.617385] r8169 0000:01:00.0 enp1s0: rtl_counters_cond == 1 (loop: 1000, delay: 10).

What I've tried

One solution that I found in a similar answer was to run the following command from the terminal:

sudo ethtool -s enp1s0 speed 100 duplex full autoneg off

After running this statement, things do seem to temporarily improve. For example, reviewing the dmesg log again now shows a change in status:

johnny@johnnyb1694-Ubuntu:~$ sudo dmesg | grep enp1s0
[    1.453852] r8169 0000:01:00.0 enp1s0: renamed from eth0
[    6.602587] r8169 0000:01:00.0 enp1s0: rtl_ocp_gphy_cond == 1 (loop: 10, delay: 25).
[    6.603179] r8169 0000:01:00.0 enp1s0: rtl_ocp_gphy_cond == 1 (loop: 10, delay: 25).
[    6.603791] r8169 0000:01:00.0 enp1s0: rtl_ocp_gphy_cond == 1 (loop: 10, delay: 25).
[    6.603802] r8169 0000:01:00.0 enp1s0: Link is Down
[    6.617385] r8169 0000:01:00.0 enp1s0: rtl_counters_cond == 1 (loop: 1000, delay: 10).
[ 2132.644712] r8169 0000:01:00.0 enp1s0: Link is Up - 100Mbps/Full - flow control off
[ 2132.644736] IPv6: ADDRCONF(NETDEV_CHANGE): enp1s0: link becomes ready
[ 2137.957219] NETDEV WATCHDOG: enp1s0 (r8169): transmit queue 0 timed out
[ 2137.971670] r8169 0000:01:00.0 enp1s0: rtl_rxtx_empty_cond == 0 (loop: 42, delay: 100).

And the GUI view is also updated:

enter image description here

However, this change in status appears to be fleeting (i.e. it falls off again momentarily afterwards) and, more pressingly, the connection that is established is extremely poor (for example, a request to https://www.google.com/ appears to hang almost indefinitely).

I am pretty sure that this is an issue specific to my Ubuntu setup as when I boot on Windows and access the internet via my wired ethernet connection, everything works perfectly.

Would anybody be able to help me fix this issue with a bit of guidance? I am happy to provide more information if it will be helpful.

Thank you.

Sam avatar
ao flag
Sam
Hello Johnny and welcome to Ubuntu. In the ifconfig output you've shown (before you ran ethtool) your WLAN has an IP address, but your Ethernet doesn't. Run ifconfig again to verify that your Ethernet does get a proper IP address on the correct subnet, and if so, disable your WLAN (to avoid dual interface routing complications) and try going to Google again.
Johnny Breen avatar
cg flag
Hi Sam, thanks for the response! I tried running ifconfig again and noticed that it does not seem to get assigned an IP. Is that expected behaviour or not?
Score:0
ao flag
Sam

Johnny, regarding your comment, if your Ethernet adapter didn't get an IP address that's not normal.

It probably means there's a configuration problem with DHCP or the adapter's driver (or with your Ethernet cable, its connectors, or the Ethernet ports at either end although you mentioned they work fine under Windows).

Try this: when running Ubuntu, stand at the Ethernet switch/router end and have someone plug the other end of your cable into the PC and see if the expected lights turn on for that port on your router/switch.

If they do, that means the adapter's driver and physical connectivity is okay, and you can start looking for configuration problems with DHCP.

Alternatively, you could try statically configuring an IP address for that adapter.

To debug DHCP you can run a tool like Wireshark on another computer on your LAN. Wireshark will let you watch the flow of DHCP request and response packets between the problem PC and your router.

If you try that, and you don't see any DHCP traffic at all, that indicates a problem with the DHCP client software on the Ubuntu system.

Another test you could try is to boot your live Ubuntu 22.04.2 DVD/USB in the problem machine, and see if the live system gets an IP address on that Ethernet adapter.

If the live system gets an IP address then you'll know that the physical connections and driver are fine (and you can also assume there's probably not a driver issue in your installed system).

But if the live system works, there's probably an issue with how you have the Ethernet port defined in the installed system.

Look to see that DHCP is enabled in the active Ethernet profile (or create a new profile to test) and verify that you haven't by accident configured a static address for the adapter on the wrong subnet, etc.

I sit in a Tesla and translated this thread with Ai:

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.