ICMP: host unreachable

Compare ARP and ICMP for an unreachable host.

Network

Scroll sideways to exploreOpen full diagram
PC1 connects to R1 eth1 on 192.168.1.0/24; R1 eth0 connects to PC2 on 172.16.12.0/24.
PC2 at .1 is reachable. No host has address .22.
Open a console

1. Test the working path

PC1

ping -n -c 3 -W 1 192.168.1.100
ping -n -c 3 -W 1 172.16.12.1

Both pings should succeed.

2. Capture ARP and ICMP

R1

timeout 120 tcpdump -U --immediate-mode -i eth0 -w /tmp/lab-icmp-host.pcap "arp or icmp or tcp port 5555" &
capture_pid=$!
sleep 1

PC1

timeout 120 tcpdump -U --immediate-mode -i eth0 -w /tmp/lab-icmp-host.pcap "icmp or tcp port 5555" &
capture_pid=$!
sleep 1

PC1

printf 'host-unreachable\n' | nc -N -w 5 172.16.12.22 5555

3. Inspect the error

R1

sleep 2
kill -INT "$capture_pid"
wait "$capture_pid" || true
tcpdump -nn -e -r /tmp/lab-icmp-host.pcap

PC1

sleep 2
kill -INT "$capture_pid"
wait "$capture_pid" || true
tcpdump -nn -e -r /tmp/lab-icmp-host.pcap "icmp[0] == 3 and icmp[1] == 1"

On R1, find unanswered ARP requests for .22. On PC1, find ICMP 3/1 from R1: a route exists, but the host is unreachable.

Validation

Click "Check". Once all steps pass, click "End".