Error Codes Wiki

Linux 'No Route to Host' Network Error

Errornetwork

Overview

Linux 'No route to host' error means the system has no network path to reach the destination, typically due to routing table or firewall issues.

Key Details

  • EHOSTUNREACH — the kernel has no route in its routing table for the destination
  • Different from 'Network unreachable' which means no route to the network
  • Can be caused by the remote host firewall rejecting with ICMP host-unreachable
  • The default gateway may be missing or unreachable
  • VPN routing conflicts can cause this for specific destinations

Common Causes

  • Default gateway not configured or unreachable
  • Remote host firewall sending ICMP host-unreachable
  • Network interface down or not configured
  • Routing table missing entry for the destination network
  • VPN split-tunneling misconfiguration

Steps

  1. 1Check routing table: ip route show — look for default via entry
  2. 2Verify network interface is up: ip link show
  3. 3Ping the gateway: ping -c 3 $(ip route | grep default | awk '{print $3}')
  4. 4Add default route if missing: sudo ip route add default via GATEWAY_IP
  5. 5Check if remote firewall is the cause: try from a different network

Tags

linuxnetworkno-routeroutingconnectivity

More in Network

Frequently Asked Questions

'No route to host' means the host specifically is unreachable (maybe firewall). 'Network unreachable' means the entire network has no route.