Use it to interpret ping and traceroute results, and when deciding what ICMP a firewall should let through.
ICMP & ICMPv6
ICMP is how IP reports problems and tests reachability: ping uses echo request and reply, traceroute uses "time exceeded", and routers send "destination unreachable" or "packet too large" when they cannot deliver. ICMPv6 does the same and also carries neighbour discovery.
1. ping <ip> — !, ., U or A?
2. U → a router on the path has no route; A → a filter rejected it.
3. . → traceroute <ip>: where does it stop?
4. Ping from another source address works → no return route to the first.
5. Small pings work, large fail → MTU, with the error message filtered.
echo request routed to the destination → not filtered → echo reply routed back to the source address → received; on failure, the device that could not deliver returns an ICMP error naming the reason
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
ping 10.20.0.50 source GigabitEthernet0/0Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Verification Verify boundary
ping 10.20.0.50 source GigabitEthernet0/0
traceroute 10.20.0.50
show ip icmp rate-limit
show ip traffic | section ICMP
debug ip icmp
A sourced ping tests the path from a specific address, which matters for the return route. Traceroute shows the last router that answered. show ip traffic counts ICMP messages sent and received by type on the router itself. debug ip icmp prints the ICMP messages the router sends and receives, with type, code and addresses; use it briefly.
In Cisco ping and traceroute output, the characters tell which message came back: ! reply, . timeout, U unreachable, A administratively prohibited, M could not fragment, H host unreachable, N network unreachable.
Known-good: echo is answered from the intended source, and traceroute reaches the destination.
Step 2 Failure boundaries & design notes Narrow the fault
- Ping times out but the service works. Echo is filtered; test with the actual protocol.
- Ping returns
Uor "destination unreachable". A router on the path has no route — its address is the source of the message. - Ping returns
Aor "administratively prohibited". An access list or firewall rejected the packet and said so. - Traceroute shows asterisks from one hop onwards. A filter beyond that hop, or the destination does not answer the probe type in use.
- Asterisks at single hops, later hops fine. Rate limiting of ICMP errors on that router.
- Small pings work, large ones fail. An MTU problem; "packet too large" or "fragmentation needed" is being filtered.
- Traceroute repeats the same two addresses. A routing loop; the TTL expires between them.
- A ping works from one source address and not from another. There is no return route to the second.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
The messages say why: no route, administratively prohibited, packet too large. A ping timeout proves little — echo may simply be filtered. An asterisk at one traceroute hop with later hops answering is rate limiting, not loss. Never block ICMPv6 wholesale.
ping <ip> source <interface>— reachability from a specific address, including the way back.traceroute <ip>— the last router that answered.show ip traffic | section ICMP— ICMP messages sent and received by type.debug ip icmp— messages with type and code; use briefly.- Cisco ping characters:
!reply,.timeout,Uunreachable,Aprohibited,Mcould not fragment.
ReferenceWhat it is1 section · depth on demand
Mechanics & mental model
ICMP is the protocol IP uses to report problems and to test reachability. Ping and traceroute are built on it, and routers use it to tell a sender that a packet could not be delivered and why. ICMPv6 does the same for IPv6 and additionally carries neighbour discovery.
ReferenceWhy it matters1 section · depth on demand
Why it matters operationally
The messages are the network explaining itself: "no route", "administratively prohibited", "packet too large" each point to a specific cause, where a plain timeout says nothing. Filtering ICMP wholesale throws that information away — and in IPv6, where neighbour discovery and path MTU discovery depend on it, breaks connectivity outright.
ReferenceHow it works1 section · depth on demand
Operational flow & dependencies
Messages worth knowing.
| Purpose | ICMP (IPv4) type/code | ICMPv6 type/code |
|---|---|---|
| Echo request / reply (ping) | 8 / 0 | 128 / 129 |
| Destination unreachable — no route | 3/0 network, 3/1 host | 1/0 |
| Destination unreachable — filtered by policy | 3/13 | 1/1 |
| Destination unreachable — port closed | 3/3 | 1/4 |
| Packet too large | 3/4 (fragmentation needed) | 2 |
| Time exceeded — TTL or hop limit reached 0 | 11/0 | 3/0 |
| Redirect — a better next hop exists | 5 | 137 |
| Neighbour and router discovery | — (ARP is separate) | 133–136 |
Who sends an error, and what it contains. The device that could not forward or deliver the packet sends the error to the packet's source. It includes the beginning of the original packet, so the source can tell which connection is affected. The source address of the error is the device that had the problem — which is what makes traceroute possible.
Ping sends echo requests and waits for replies. A reply proves a path in both directions. No reply proves little: the request or the reply may be filtered, or the target may not answer pings.
Traceroute sends packets with a TTL of 1, 2, 3 and so on. Each router where the TTL reaches zero returns "time exceeded", revealing itself. Cisco and Linux send UDP probes by default and Windows sends ICMP echo, so a firewall may pass one and not the other.
Rate limiting. Routers generate ICMP errors on their CPU and limit how many they send — Cisco IOS sends at most one unreachable per 500 ms by default. An asterisk at one hop in a traceroute, with later hops answering, is usually this and not packet loss.
Filtering sensibly. Permit at least echo, destination unreachable, time exceeded and packet too large — and for IPv6 also the neighbour discovery types on the local link.
ReferenceImportant terms & boundaries2 sections · depth on demand
In depth
ICMP and ICMPv6 messages
ICMP is how IP reports problems and tests reachability. RFC 792 defines the IPv4 message types:
- Echo reply (0) and echo (8).
- Destination unreachable (3): code 0 net, 1 host, 2 protocol, 3 port, 4 fragmentation needed with DF set, 5 source route failed.
- Source quench (4), redirect (5), time exceeded (11) and parameter problem (12).
ICMP errors are never sent about ICMP messages. Each error carries the original IP header plus the first 64 bits of data, which is enough to identify the ports. RFC 4443 defines ICMPv6: error types 0–127 and informational types 128–255, mandatory rate limiting, and Packet Too Big as type 2.
IPv4 and IPv6 equivalents
| Purpose | ICMPv4 | ICMPv6 |
|---|---|---|
| Echo request / reply | 8 / 0 | 128 / 129 |
| Destination unreachable | 3 | 1 |
| Fragmentation needed / packet too big | 3 code 4 | 2 |
| Time exceeded | 11 | 3 |
| Parameter problem | 12 | 4 |
| Redirect | 5 | 137 (ND) |
| Neighbour discovery | (ARP, not ICMP) | 133–137 |
What not to filter
| Message | Breaks if filtered |
|---|---|
| ICMPv4 type 3 code 4 / ICMPv6 type 2 | Path MTU discovery: large transfers hang |
| ICMPv6 133–137 | IPv6 neighbour and router discovery: IPv6 stops working |
| Time exceeded | Traceroute; loop diagnosis |
| Unreachable | Fast failure; applications wait for timeouts instead |
Echo can be rate-limited or restricted at the edge without breaking protocols. Error messages shouldn't be blocked.
Rules that limit ICMP (RFC 4443)
ICMPv6 errors must be rate-limited, ideally with a token bucket so bursts like traceroute still work. They are not sent in response to other ICMPv6 errors, to multicast packets (except Packet Too Big and some parameter problems), or to packets without a unique source address.
R1# show ip traffic | include ICMP|unreachable|time exceeded|echo
R1# show ipv6 traffic | include ICMP|too big|unreach|time
R1(config)# interface GigabitEthernet0/0/0
R1(config-if)# no ip unreachables
R1(config-if)# no ip redirects
R1(config)# ip icmp rate-limit unreachable 500
host$ sudo tcpdump -ni eth0 'icmp[icmptype] == 3 or icmp6 and ip6[40] == 1'
Turning off unreachables on Internet-facing interfaces reduces information leakage. It also makes traceroute show stars at that hop, so document the choice.
Documented example, not captured output.
Quick reference
ICMP is the IP layer's control and error-reporting protocol. Ping and traceroute use it, but its more important job is telling senders what went wrong: that a destination is unreachable, that a packet's time to live expired, or that a packet was too large to forward. ICMPv6 carries even more: Neighbour Discovery, Router Advertisements and multicast listener reports all run over it, so IPv6 does not work at all if ICMPv6 is blocked.
| ICMPv4 | ICMPv6 | Meaning |
|---|---|---|
| 0/8 | 129/128 | Echo reply/request |
| 3 | 1 | Destination unreachable |
| 3 code 4 | 2 | Fragmentation needed / packet too big |
| 11 | 3 | Time exceeded |
| — | 133–137 | RS, RA, NS, NA, redirect |
Filtering guidance: rate-limit rather than block echo; always allow "fragmentation needed" (v4) and "packet too big" (v6), or path MTU discovery breaks and large transfers hang; in IPv6 allow the Neighbour Discovery types on the local link.
show ip traffic | section ICMP
show ipv6 traffic | section ICMP
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Network & Protocols → ICMP & ICMPv6. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.rfc-editor.org/rfc/rfc4443.html · confidence 94%Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.