Courseiva
DiagnosticsPrivileged EXEC

ping [ip]

The ping command sends ICMP echo requests to a destination IP address to test network connectivity and measure round-trip time.

Definition: ping [ip] is a Cisco IOS privileged exec command. The ping command sends ICMP echo requests to a destination IP address to test network connectivity and measure round-trip time.

Overview

The ping command is one of the most fundamental and widely used network diagnostic tools in Cisco IOS. It sends Internet Control Message Protocol (ICMP) echo request packets to a specified destination IP address and awaits echo reply packets. The command measures round-trip time (RTT) and packet loss, providing immediate feedback on network reachability and latency.

For CCNA and CCNP candidates, mastering ping is essential because it is the first line of defense in troubleshooting connectivity issues. The underlying concept is simple: ICMP is a Layer 3 protocol that reports errors and provides operational information. When you ping a host, you are essentially verifying that IP routing is functional, that the destination is alive, and that the path is not excessively congested or faulty.

You would reach for ping over other tools like traceroute when you need a quick connectivity check; traceroute is better for path discovery. Ping fits into the broader troubleshooting workflow as an initial test—if ping fails, you then check ARP, routing tables, ACLs, and interface status. Important IOS behavior: ping output is buffered; you can use the extended ping command (ping with no arguments) to set options like repeat count, timeout, and data pattern.

The command requires privileged EXEC mode (enable). It does not affect the running configuration. In IOS, the standard ping sends five ICMP packets by default, each 100 bytes.

The output shows success rate and min/avg/max RTT. A series of exclamation marks (!) indicates successful replies, while periods (.) indicate timeouts. Understanding these nuances is critical for accurate interpretation.

The ping command also supports IPv6 (ping ipv6) and can be used with hostnames if DNS is configured. In modern networks, ping is often the first tool used to verify connectivity after configuration changes, before moving to more advanced diagnostics. It is also used in scripts and monitoring tools to check device health.

Despite its simplicity, ping can reveal a lot: asymmetric routing, packet loss, high latency, or even MTU issues when combined with the don't fragment (DF) bit. For CCNA and CCNP candidates, knowing how to interpret ping output and use extended ping options is a key skill. This command is available in all Cisco IOS versions and platforms, making it a universal troubleshooting tool.

Syntax·Privileged EXEC
ping [ip]

When to Use This Command

  • Verify reachability of a remote host after configuring a new network link
  • Troubleshoot intermittent connectivity issues by observing packet loss patterns
  • Check latency between two devices to assess network performance
  • Confirm that a firewall or ACL is not blocking traffic by testing with extended ping options

Parameters

ParameterSyntaxDescription
ip-addressA.B.C.DThe destination IPv4 address to ping. Valid values are any unicast IPv4 address. Common mistakes include pinging a broadcast or multicast address, which may cause unexpected behavior or be blocked.

Command Examples

Basic ping to a known host

ping 192.168.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms

The output shows five exclamation marks indicating all five echo replies were received. The success rate is 100% with round-trip times: minimum 1 ms, average 2 ms, maximum 4 ms.

Ping with extended options (repeat count and size)

ping 10.0.0.1 repeat 10 size 1500
Type escape sequence to abort.
Sending 10, 1500-byte ICMP Echos to 10.0.0.1, timeout is 2 seconds:
!!!!!!!!!!
Success rate is 100 percent (10/10), round-trip min/avg/max = 10/12/15 ms

This sends 10 large packets (1500 bytes) to test jumbo frame support or stress the link. All ten replies received with slightly higher latency due to larger packet size.

Understanding the Output

The ping output begins with 'Type escape sequence to abort.' indicating you can press Ctrl+Shift+6 to stop. Then it shows the parameters: number of packets, size in bytes, destination IP, and timeout. Each '.' indicates a timeout (no reply), while '!' indicates a successful reply.

'U' means destination unreachable. The summary line shows success rate (percentage and fraction) and round-trip time statistics (min/avg/max). A 100% success rate with low and consistent RTT indicates good connectivity.

Partial loss (e.g., 80%) suggests intermittent issues. High RTT or increasing RTT may indicate congestion or long paths. Watch for 'U' which often indicates a routing problem or ACL blocking.

Configuration Scenarios

Basic connectivity test between two directly connected routers

Two routers R1 and R2 are connected via a serial link. After configuring IP addresses on the interfaces, you need to verify Layer 3 connectivity before proceeding with routing protocols.

Topology

R1(Se0/0/0)---10.0.12.0/30---(Se0/0/0)R2

Steps

  1. 1.Step 1: On R1, enter privileged EXEC mode: enable
  2. 2.Step 2: Ping R2's serial interface IP: ping 10.0.12.2
  3. 3.Step 3: Observe the output. Expected: exclamation marks (!) indicating success.
Configuration
! No configuration needed for ping; it is a diagnostic command.
! Ensure interfaces are up and IP addresses are configured:
R1(config)# interface Serial0/0/0
R1(config-if)# ip address 10.0.12.1 255.255.255.252
R1(config-if)# no shutdown

Verify: ping 10.0.12.2 Output: !!!!! (five exclamation marks) indicates 100% success. If you see periods (.), connectivity is failing.

Watch out: Ensure both interfaces are in the same subnet. A common mistake is misconfiguring the subnet mask, causing the router to think the destination is on a different network.

Testing connectivity across a routed network with extended ping

A network engineer needs to test connectivity from R1 to a remote server at 192.168.1.100 across multiple routers. The default ping uses five packets; extended ping allows setting repeat count and timeout for more thorough testing.

Topology

R1(Gi0/0)---10.0.1.0/24---R2(Gi0/1)---10.0.2.0/24---R3(Gi0/0)---192.168.1.0/24

Steps

  1. 1.Step 1: On R1, enter privileged EXEC mode: enable
  2. 2.Step 2: Initiate extended ping by typing 'ping' without arguments: ping
  3. 3.Step 3: At the prompts, enter the destination: 192.168.1.100
  4. 4.Step 4: Set repeat count to 10: 10
  5. 5.Step 5: Set datagram size to 1500 (to test MTU): 1500
  6. 6.Step 6: Set timeout to 2 seconds: 2
  7. 7.Step 7: Accept defaults for other parameters (press Enter).
Configuration
! No configuration needed; extended ping is interactive.
! Ensure routing is configured so R1 knows how to reach 192.168.1.0/24.

Verify: Output shows 10 exclamation marks or periods. Success rate should be 100% if routing and ACLs are correct. If some packets fail, check for MTU issues or ACL drops.

Watch out: Setting the DF bit (Don't Fragment) in extended ping can help identify MTU problems. If pings with DF bit set fail but normal pings succeed, there is a path MTU issue.

Troubleshooting with This Command

When using ping for troubleshooting, healthy output consists of a series of exclamation marks (!) with a success rate of 100% and low round-trip times (typically under 10 ms on LAN, under 100 ms on WAN). Problem indicators include periods (.) indicating timeouts, which suggest packet loss; high RTT values (e.g., >200 ms) indicating congestion or long paths; and varying RTT (jitter) indicating network instability. Key fields to focus on are the success rate (percentage of replies) and the min/avg/max RTT.

Common symptoms: 100% loss often means no route to destination, destination unreachable (ICMP unreachable message), or ACL blocking ICMP. Partial loss (e.g., 60% success) may indicate intermittent link errors or congestion. High RTT may be due to satellite links, overloaded routers, or suboptimal routing.

A step-by-step diagnostic flow: 1) Ping the local gateway to verify local connectivity. 2) Ping the next-hop router to isolate the problem segment. 3) Use extended ping with different sizes to test MTU. 4) If ping fails, check interface status (show interfaces), routing table (show ip route), and ACLs (show access-lists). Correlate ping output with show ip interface brief to see if interfaces are up/up. Use debug ip icmp (with caution) to see ICMP events in real time.

If ping succeeds but application traffic fails, the issue may be at higher layers (e.g., firewall, TCP port blocking). In that case, use telnet or traceroute to test specific ports. Ping can also be used to test for duplicate IP addresses: if you get replies from an unexpected MAC, there may be an IP conflict.

Remember that some devices (e.g., Windows firewalls) block ICMP by default, so a failed ping does not always mean the host is down. Always consider the network security policy. In summary, ping is a quick, powerful tool that, when interpreted correctly, can pinpoint many Layer 3 issues.

CCNA Exam Tips

1.

Know that '!' means success and '.' means timeout; exam may show output and ask you to interpret connectivity

2.

Remember that ping uses ICMP, which may be blocked by security policies; a failed ping doesn't always mean no connectivity

3.

Extended ping (from privileged EXEC) allows setting source interface, repeat count, size, and timeout; be ready to use it in troubleshooting scenarios

4.

The round-trip time (RTT) is measured in milliseconds; high RTT or jitter can indicate network issues

Common Mistakes

Assuming a failed ping means the destination is down; ICMP may be blocked by ACLs or firewalls

Not using extended ping to specify a source interface when multiple paths exist, leading to misleading results

Interpreting a single '.' as a major failure; it could be due to transient congestion or ARP resolution delay

ping [ip] vs traceroute [ip]

Both ping and traceroute are essential diagnostic tools for network troubleshooting, but they serve different purposes: ping tests basic reachability and latency, while traceroute identifies the path and per-hop delay. They are often confused because both use ICMP packets and are used in similar contexts.

Aspectping [ip]traceroute [ip]
ScopeEnd-to-end connectivityPer-hop path analysis
Protocol usedICMP Echo/ReplyICMP Time Exceeded (and UDP probes)
OutputRound-trip time statisticsList of hops with round-trip times
Use caseBasic reachability testPath and latency troubleshooting
SpeedQuick single testSlower due to multiple probes
Traffic impactMinimalHigher (multiple packets per hop)

Use ping [ip] when you need to quickly verify if a remote host is reachable and measure basic network latency.

Use traceroute [ip] when you need to diagnose where packet loss or delay occurs along the path to a destination.

Platform Notes

In IOS-XE (e.g., Catalyst 9000 switches), the ping command syntax and output are identical to classic IOS. However, IOS-XE supports the 'ping vrf' syntax for VRF-aware pinging: ping vrf <vrf-name> <ip>. The output format is the same.

In NX-OS (Cisco Nexus switches), the equivalent command is 'ping <ip>' but with slightly different output formatting. NX-OS also supports 'ping <ip> count <number>' and 'ping <ip> timeout <seconds>' directly without entering extended mode. For example: 'ping 10.0.0.1 count 10'.

NX-OS does not have an interactive extended ping; you specify options inline. In ASA (Adaptive Security Appliance), the command is 'ping <ip>' from privileged EXEC mode. ASA also supports 'ping <ip> repeat <count>' and 'ping <ip> timeout <seconds>'.

ASA's ping output includes 'Reply received' or 'No reply received' messages. In IOS-XR (Cisco IOS XR), the command is 'ping <ip>' and supports options like 'count', 'size', 'timeout'. IOS-XR output is similar to IOS but may show 'Success rate is 100 percent' with RTT.

Note that in some older IOS versions (12.x), the default ping uses 5 packets; in newer versions (15.x, 16.x), it remains 5. The extended ping interactive menu is consistent across IOS versions. For IPv6, use 'ping ipv6 <ipv6-address>' in IOS, IOS-XE, and NX-OS.

In NX-OS, 'ping6 <ipv6-address>' also works. Always check the specific platform documentation for exact syntax, as minor variations exist.

Related Commands

Practice for the CCNA 200-301

Test your knowledge with practice questions covering all CCNA 200-301 exam domains.

Practice CCNA 200-301 Questions