How to use ping to diagnose network connectivity

· Category: Networking

Short answer

Ping is a command-line utility that sends ICMP echo request packets to a target host. It confirms reachability and measures round-trip time.

Steps

  1. Test local stack: Ping 127.0.0.1 (localhost) to verify your own TCP/IP stack.

  2. Test local gateway: Ping your default gateway to confirm local network connectivity.

  3. Test remote host: Ping a public IP like 8.8.8.8 to verify internet access.

  4. Test DNS resolution: Ping a domain name like google.com to confirm DNS is working.

  5. Analyze results: - Replies indicate the host is reachable. - Request timed out suggests firewall blocking or routing failure. - High latency or packet loss indicates congestion or poor link quality.

Tips

  • Use -t on Windows or continuous ping on Linux for ongoing monitoring.
  • Specify packet size with -l or -s to test MTU issues.
  • Use -n to avoid DNS reverse lookups and speed up output.

Common issues

  • ICMP blocked by firewalls giving false negatives.
  • Local firewall on the target dropping echo requests.
  • Confusing name resolution delays with actual latency.