What is an extended ping on a Cisco router, and when do you use it?
Show the answer
Say this first
Extended ping lets me set the source address or interface, the repeat count, datagram size, timeout, the DF bit, and a sweep of sizes. I use the source option to test the return route for a specific subnet, because a ping from the WAN interface can work while one sourced from the LAN fails. I use DF with a size sweep to find the path MTU, and a high repeat count to measure loss on a suspect link.
Go deeper
Why the source matters
A router sources its ping from the exit interface by default. The far end may have a route back to that WAN /30 but not to the user subnet. Sourcing from the LAN interface or a loopback tests the path that users actually use.
R1# ping 10.20.0.10 source GigabitEthernet0/0/1 repeat 100
R1# ping 10.20.0.10 source Loopback0 size 1500 df-bitThe interactive form
Type ping alone in privileged mode. It prompts for protocol, target, repeat count, datagram size and
timeout, then "Extended commands". Answer y to get the source address or interface, type of service,
DF bit, data pattern, and "Sweep range of sizes".
Finding the path MTU
Set DF and sweep from 1400 to 1500. Sizes above the path MTU come back as M (a router sent "fragmentation
needed") or . (the message was filtered). Equivalent host tests:
ping -M do -s 1472 10.20.0.10 # Linux: 1472 data + 8 ICMP + 20 IP = 1500
ping -f -l 1472 10.20.0.10 # WindowsMeasuring loss
ping 10.20.0.10 repeat 1000 timeout 1 gives a loss percentage worth quoting. Five pings do not.
They will ask next
The router can ping a server, but users still cannot reach it. What do you try?
Ping again sourced from the users' gateway interface. If that fails, the server side has no route back to the user subnet, or a firewall permits the router's WAN address but not the user range.
Why might
ping 10.20.0.10 size 1500 df-bitfail on a path that looks healthy?Cisco's size is the whole IP datagram, so 1500 should pass on a clean Ethernet path. If it fails, something in the path has a smaller MTU, such as a GRE or IPsec tunnel, or PPPoE at 1492.
Traps
- Mixing up Cisco's size (the whole IP datagram) with Linux and Windows sizes (ICMP data only, so 1472 fills 1500).