Score:0

Ubuntu 22.04: Network connectivity problems

cn flag

I have a strange behavior, started today, which I can hardly describe. Before , all worked OK!, and there are many more clients and computers on that that network:

A desktop, Ubuntu 22.04 connected using a LAN cable to a router, stopped reaching several internet sites as (not only): YouTube, Twitter, GitHub and so. Among other that connects OK (and not only)- Facebook, Gmail, Google search engine.

Also - VM machines installed on that desktop, sharing its internet connection (Bridge - meaning they get a local IP from the same router), connect to that same unreached sites the same time not going thru the desktop.

And- Connectivity to all other PC and NAS on LAN is reached OK.

To be sure it is not a web browser issue, even pushing to git, using command line, failed.

Trials

So what did I do (All yielded same no-success result):

  1. Tried to connect using Private Browsing (Fire Fox).
  2. Cleared all cache and history.
  3. disabled all browser add-ons.
  4. Reboot. Disable and re-enable LAN.
  5. Disable LAN and connect via WiFi.
  6. Installed Chromium.
  7. Rebooted router (including telephony company modem).

What DID "solve"?

Connecting to a different network using same cable (reaching same external IP).

Score:0
st flag

This is likely caused by power management or auto-negotiation. If the power management fails to "get it right" then obviously the NIC fails to work for a minute, and if the auto-negotiation gets jacked then you get no connections at all.

Pregame: ip link to get your ethernet interface name. It's usually number two.

Step #1: Make sure the auto-negotiation isn't changing up on you.

sudo ethtool -s eth0 speed 1000 duplex full autoneg off

Obviously, just switch the eth0 to whatever your interface name is. You can get full instructions on the tool with the -h option, which will explain even more settings.

Step #2: Kill the power management.

sudo echo off > /sys/class/net/eth0/power/control

Again, replace eth0 with your interface name. This will disable the power management on this interface until a reboot.

Step #3: Retest.

Run all your programs again.

If you test and want to keep this setting permanently, you will have to put those lines in /etc/rc.local to run after booting.

If neither of these help the likely culprit is probably the actual wire between the computer and the router. It's possible for the little RJ-45 connectors to break internally, or the wires to have been stomped or pierced by another object. This is especially true if you tested the machine somewhere else and it worked.

Hope this helps. -Sean

EDIT

Add these to /etc/rc.local:

#!/bin/bash
ethtool -s eth0 speed 1000 duplex full autoneg off
echo off > /sys/class/net/eth0/power/control

Save the file, and then do: chown root:root /etc/rc.local, and chmod +x /etc/rc.local. It will come up every boot that way after that. Remember to use whatever your network interface name is NOT eth0.

guyd avatar
cn flag
Before testing: 1) TNX!! 2) why do you think that certain addresses were reached and others didn't ? it is always the same ones. AND - I didn't change the RJ connector on the PC side but, at the router side (2 diff networks a,d routers are located side by side)
sean avatar
st flag
@guyd might just be coincidental. I'd assure the connection was stable before worrying about anything else. The reason is you aren't seeing the problems on the other machines and you didn't change configuration of the one that had the problem. This sort of "soft eliminates" all of the things except the bits between the machines. The point of doing those commands is to assure there isn't a driver/power problem causing the issue. After you're assured with that you probably are left only with the wires/connectors themselves.
sean avatar
st flag
@guyd The settings I recommended there will assure the stability of the connection, which we didn't know was true before right? There might be messages in `journalctl` or not, you can have a look for error messages, but sometimes my experience with these things is that don't show in the logs.
sean avatar
st flag
@guyd I've seen some TERRIBLE implementations of autonegotation and firmware that work perfectly on one router or swtich, but as soon as you change the vendor bam it doesn't work... just like that... That's why I suggested to set it. Just get rid of as many problems as possible before you pull your hair out. :D
guyd avatar
cn flag
`sudo ethtool -s eth0 speed 1000 duplex full autoneg off` should remain (if it the reason) ?
sean avatar
st flag
@guyd It won't stay set between reboots. You have to add it to a `/etc/rc.local` file (which is just a bash script that is run as root on the boot of the computer). So if you need either of those commands to persist you will have to type it into that file. See the edit above.
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.