EHOSTUNREACH networking tcp_connection ai_generated true

No route to host (EHOSTUNREACH)

ID: networking/host-unreachable

Also available as: JSON · Markdown
83%Fix Rate
85%Confidence
55Evidence
2023-01-01First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
any active

Root Cause

The system cannot find a network route to reach the target host. An ICMP 'Destination Host Unreachable' message was received from a router along the path, or the local routing table has no matching route. This indicates a routing, gateway, or network configuration problem.

generic

Workarounds

  1. 85% success Fix the local or intermediate routing configuration
    1. Check local routing table: ip route show
    2. Verify default gateway is set: ip route | grep default
    3. If missing, add default gateway: ip route add default via GATEWAY_IP dev eth0
    4. Check if the interface is up: ip link show
    5. Bring interface up if needed: ip link set eth0 up
    6. For VPN or overlay networks, verify the tunnel is established
    7. Trace the route to find where it breaks: traceroute target-host
    8. Check for ICMP 'unreachable' messages: tcpdump -i any icmp
  2. 82% success Verify network connectivity and firewall rules at the host and intermediate levels
    1. Verify the target host is on the network: arping target-host (for same subnet)
    2. Check if iptables is rejecting with ICMP unreachable: iptables -L -n | grep REJECT
    3. In cloud environments, check VPC routing tables, subnet associations, and internet gateway configuration
    4. Verify security groups and network ACLs allow the traffic
    5. For cross-VPC or cross-region, verify VPC peering or transit gateway routes
    6. Check if the target host has a valid IP and is powered on

Dead Ends

Common approaches that don't work:

  1. Retry the connection repeatedly without addressing the routing issue 95% fail

    EHOSTUNREACH is a definitive routing error. The kernel or an intermediate router has determined there is no path to the destination. Retrying does nothing unless the network topology changes, which requires manual intervention or automated failover to trigger.

  2. Change the application-level protocol or port number 95% fail

    Host unreachable is a network-layer (IP/ICMP) error that occurs before any port or protocol negotiation. The issue is that IP packets cannot reach the host at all, so changing the destination port or switching between HTTP/HTTPS has no effect.

Error Chain

Leads to:
Preceded by:
Frequently confused with: