Network
ping
Test network reachability with ICMP echo requests.
networkconnectivitylatencyicmptroubleshoot
Additional Notes
ping sends ICMP echo requests to a host and waits for replies. It is a basic tool for checking whether a host is reachable and roughly how much latency exists.
A failed ping does not always mean the host is down. Firewalls, routers, cloud providers, or local policy may block ICMP.
Syntax
ping [options] host
Parameters
options: Flags that change howpingbehaves.host: Hostname, IP address, URL, or network target.
Common Options
-c N: SendNpackets, then stop.-i SECONDS: Wait between packets.-4: Use IPv4.-6: Use IPv6.-W SECONDS: Wait time for a reply.-s SIZE: Set packet payload size.-q: Quiet summary output.
Examples
ping example.com
Ping a domain continuously until stopped.
ping -c 4 8.8.8.8
Send four packets to an IP address.
ping -4 example.com
Force IPv4.
ping -6 example.com
Force IPv6.
ping -c 3 -W 2 gateway.local
Send three packets with a two-second reply timeout.
Reading Output
time=: Round-trip latency.ttl=: Time-to-live value from the reply.- Packet loss: Percentage of packets with no reply.
- Summary min/avg/max: Latency statistics.
Practical Notes
- First test your gateway, then a public IP, then DNS names.
- If IP ping works but domain ping fails, suspect DNS.
- If ping fails but a web service works, ICMP may be blocked.
- Use
tracerouteto inspect the path when reachability is unclear.