Skip to content

Destination Host Unreachable: a router on the way refuses

Networkingtested on Ubuntu 24.04, iproute2, Network Namespaces

Unlike “Network is unreachable”, the packet did leave here. A router on the way accepted it and answered with an ICMP message. The address after “From” is the router that does not know how to continue – that is where the search starts.

Symptom

sudo ip netns exec c1 ping -c1 -W1 203.0.113.65
From 10.40.1.1 icmp_seq=1 Destination Host Unreachable
1 packets transmitted, 0 received, +1 errors, 100% packet loss, time 0ms

In the course the router r deliberately sets up a route into nowhere. +1 errors counts the ICMP message that came back.

Diagnosis

On the router after “From”, check which route applies to the destination. From the router itself ping then reports the reason directly, without ICMP.

sudo ip netns exec r ping -c1 -W1 203.0.113.65
ping: connect: No route to host

Causes

unreachable routeA route refuses on purpose

ip route add unreachable PREFIX makes the router answer “Host Unreachable” at once – meant for networks that do not exist here. The sender should give up quickly instead of waiting.

sudo ip -n r route add unreachable 203.0.113.64/26

blackhole or prohibitThe relatives behave differently

With blackhole the packet vanishes without a reply (only 100% packet loss), with prohibit the router reports “Packet filtered”. So the message tells you the kind of route.

no neighborThe destination does not answer ARP

If the destination is in the router's network but is down or has a wrong address, the router also reports Destination Host Unreachable, because ARP gets no answer.

Fix

On the router after “From”, add the correct route (ip route replace DEST via GATEWAY) or remove a deliberate block (ip route del unreachable PREFIX). Then check with ip route get DEST on the router and a ping from the sender.

Don't: Searching on the sender. The sender did everything right – the message comes from the router after From.

▶
Break it yourself and find it – free
Linux networking hands-on, Day 4: routing, policy routing, VRFs and routes that drop on purpose.
Go to day 4 →

FAQ

What is the difference to “Network is unreachable”?

Network is unreachable is reported by your own kernel before a packet leaves. Destination Host Unreachable arrives as ICMP from a router on the way.

Why does ping show “+1 errors”?

ping counts incoming ICMP error messages separately from replies; each unreachable message is one error.

Related error patterns

More