Ubuntu 24.04 SSH “No Route to Host” – Ping Works, TCP Fails (Homelab)

I’m experiencing a frustrating networking issue with SSH connectivity to my Ubuntu 24.04 LTS machine and hoping someone can point me in the right direction. I’m trying to SSH into a trash can Mac Pro that’s running Ubuntu 24 (homelab style) with a good ethernet connection.

Setup

  • Ubuntu 24.04 LTS with ethernet connection to home router
  • Static IP configured: 10.0.4.250/24 (within valid private range)
  • Attempting SSH connections from macOS client on same local network (10.0.4.78)

The Problem

SSH connections (port 22) consistently fail with “No route to host” error, despite ping working perfectly:

$ ping 10.0.4.250
PING 10.0.4.250 (10.0.4.250): 56 data bytes
64 bytes from 10.0.4.250: icmp_seq=0 ttl=64 time=8.767 ms
[ping succeeds consistently]

$ ssh root@10.0.4.250
ssh: connect to host 10.0.4.250 port 22: No route to host

What I’ve Already Verified

SSH Service: Running and listening on port 22 (both IPv4 and IPv6)
Firewall: UFW disabled, iptables shows ACCEPT policies for INPUT/OUTPUT
Port Binding: sudo lsof -nPi :22 shows both systemd and sshd listening on IPv4
Network Connectivity: Ping works with normal latency
SSH Configuration: No restrictive settings in /etc/ssh/sshd_config

Additional Symptoms

  • Telnet to port 22 also fails with “No route to host”
  • SSH daemon initially had IPv6-only binding issue (fixed by disabling ssh.socket)
  • Static IP configuration appears correct and functional for ICMP traffic

What I’ve Tried

  1. Disabled ssh.socket and enabled ssh.service directly
  2. Verified iptables rules (no blocking rules found)
  3. Flushed connection tracking table
  4. Tested various SSH connection parameters
  5. Confirmed SSH works locally on the target machine

The Mystery

ICMP (ping) works perfectly, but TCP connections to port 22 fail with routing errors. This suggests the issue isn’t actual routing but something blocking TCP specifically.

Has anyone encountered similar behavior with Ubuntu 24.04? What could cause TCP to fail while ICMP succeeds on the same network path?

System Details

  • Target: Ubuntu 24.04 LTS (Mac Pro hardware)
  • Client: macOS with OpenSSH 9.9p2
  • Network: Home network with 10.x addressing
  • Connection: Physical ethernet connections

Any suggestions would be greatly appreciated! This has been driving me crazy for hours.

Thanks in advance for any help!