Random and long connection timeouts

Hello,

I’m experiencing issues connecting to my AlmaLinux server via SSH (and networking in general for example cockpit).

The setup:

I have a clean install of AlmaLinux 9 (latest) Server with some additional packages provided as options in the installer. I’m currently using WiFi to connect to the internet, so I have NetworkManager-wifi installed. For the time being, I’m using DHCP, but I plan to switch to a static IP later.

The problem:

When I try to ping the server from my Windows machine (or other machines like another laptop that I have that it has Fedora installed), I get a Destination host unreachable response. Similarly, when I try to connect to the server using SSH, I get a Connection timed out error. The same happens with Cockpit when I try to access it on the default port of 9090. Some more context, sometimes it let’s SSH into it but as soon as I run a couple commands I get connection timeout. With Cockpit it’s basically the same, if I pass the login page, as soon as I go to an tab or do an action I get timeout.

Ping output:

Here’s the output of the ping command:

Pinging 192.168.1.95 with 32 bytes of data:
Reply from 192.168.1.105: Destination host unreachable.
Reply from 192.168.1.105: Destination host unreachable.
Reply from 192.168.1.105: Destination host unreachable.
Reply from 192.168.1.105: Destination host unreachable.

Ping statistics for 192.168.1.95:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),

Sometimes though some packets do pass:

Pinging 192.168.1.95 with 32 bytes of data:
Request timed out.
Reply from 192.168.1.105: Destination host unreachable.
Reply from 192.168.1.105: Destination host unreachable.
Reply from 192.168.1.105: Destination host unreachable.

Ping statistics for 192.168.1.95:
    Packets: Sent = 4, Received = 3, Lost = 1 (25% loss),

SSH output:

Here’s the output of the ssh command with the -v option:

OpenSSH_for_Windows_8.6p1, LibreSSL 3.4.3
debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling
debug1: Connecting to 192.168.1.95 [192.168.1.95] port 22.
debug1: connect to address 192.168.1.95 port 22: Connection timed out
ssh: connect to host 192.168.1.95 port 22: Connection timed out

Notes

I have been experiencing this problem for a couple of days. However, yesterday I randomly tried to SSH into it around this time, and it worked flawlessly. I haven’t been able to reproduce that though, I always get request timeouts :frowning_face:

Does anyone know what might be the problem? Is it a router issue maybe?
Also yes SSH, Cockpit are enabled and Running cause I checked their status multiple times.

There might be all sorts of reasons for such a behaviour, be it errors in your network or errors in your server.
So methodically track down the problem by excluding one possible reason afer another.

For a start use a wired connection instead of WiFi. WiFi tends to use “power save” settings, that assume a client like usage pattern. Stop using WiFi client on the server.

Disable all or at least recheck all power saving settings in Bios and in Alma. E.g. gnome “Power management”.

If the problems are caused by something like Networkmanager or systemd doing stupid things, then you should find some clues in /var/log/messages.

When you have the connectivity problems, do you see an arp entry for the alma host?
(e.g. if client and server are on the same subnet use “arp -a | grep 192.168.1.105” on the client)

Look at network counters on the server: does “netstat -ain” show errors?

When the problem exists, can you ping from the server e.g. to your defaultgw?