Updated 10 hours ago
The basic ping command is a blunt instrument. It sends tiny packets, waits patiently, and tells you whether something got through. But networks fail in subtle ways that basic ping never reveals.
The flags and options transform ping from a simple yes/no test into a diagnostic tool that can expose packet loss patterns, MTU problems, routing inefficiencies, and intermittent failures. Here's how to use them.
The Problem with Default Ping
Default ping sends small packets (56-64 bytes) at leisurely one-second intervals. This is forgiving—too forgiving. A network can successfully ping while dropping 20% of real traffic, fragmenting large packets, or routing through congested paths.
The options below let you stress-test what actually matters.
Controlling How Many Packets
| Platform | Flag | Example |
|---|---|---|
| Linux/macOS | -c count | ping -c 10 example.com |
| Windows | -n count | ping -n 10 example.com |
Linux and macOS ping forever by default. Windows sends exactly 4 packets.
When to adjust: 4 packets catch nothing. 10-20 packets reveal trends. 100+ packets expose intermittent problems—that 2% packet loss that makes video calls stutter but doesn't show up in a quick test.
Windows users: add -t to ping continuously like Linux/macOS. Press Ctrl+C to stop and see statistics.
Testing with Realistic Packet Sizes
| Platform | Flag | Example |
|---|---|---|
| Linux/macOS | -s size | ping -s 1000 example.com |
| Windows | -l size | ping -l 1000 example.com |
The default ping lies to you. Small packets succeed even when your network is broken for real traffic.
The Internet's standard MTU (Maximum Transmission Unit) is 1500 bytes. Packets larger than the path MTU get fragmented—split into pieces that must all arrive and be reassembled. If any piece is lost, the whole packet fails.
If large packets fail but small ones succeed, you've found an MTU or fragmentation problem. This is common with VPNs, tunnels, and certain ISP configurations.
Finding Your Path MTU
Combine large packets with the Don't Fragment flag to discover your exact path MTU:
| Platform | Flag | Example |
|---|---|---|
| Linux/macOS | -D | ping -D -s 1472 example.com |
| Windows | -f | ping -f -l 1472 example.com |
This tells routers: "Don't fragment this packet. If it's too big, drop it and tell me."
Path MTU discovery is detective work:
The largest size that works is your path MTU (minus the 28-byte header). This number matters for VPN configuration, tunnel setup, and diagnosing "large file transfers fail but small ones work" mysteries.
Adjusting Timing
Interval between packets (Linux/macOS only):
Intervals below 0.2 seconds require root privileges—this prevents accidental (or intentional) ping floods.
Timeout waiting for replies:
| Platform | Flag | Unit | Example |
|---|---|---|---|
| Linux/macOS | -W | seconds | ping -W 2 example.com |
| Windows | -w | milliseconds | ping -w 2000 example.com |
Shorter timeouts fail faster when hosts are unreachable. Longer timeouts accommodate slow satellite links or overloaded servers.
Setting TTL (Time to Live)
| Platform | Flag | Example |
|---|---|---|
| Linux/macOS | -t ttl | ping -t 10 example.com |
| Windows | -i ttl | ping -i 10 example.com |
TTL limits how many routers a packet can traverse. Each hop decrements the counter; when it hits zero, the packet dies and the router sends back "Time to live exceeded."
Low TTL values reveal routing behavior:
If you get TTL exceeded messages from unexpected routers, packets may be taking inefficient routes or hitting routing loops.
Quiet Mode for Scripts
Quiet mode (-q) suppresses per-packet output, showing only the final statistics. Perfect for automation:
Or for periodic monitoring:
Flood Ping (Requires Root)
Flood ping sends packets as fast as the network can handle them. It displays a dot for each packet sent and erases one for each reply—a visual representation of packet loss.
This is essentially a weapon. It can saturate network links, overwhelm hosts, and trigger security alerts. Only use it on networks you own, for legitimate stress testing, with full awareness of the consequences.
Choosing a Network Interface
On multi-homed systems (multiple network interfaces):
This isolates which path you're testing—essential when comparing wired vs. wireless performance or diagnosing issues with specific interfaces.
IPv4 vs. IPv6
On Linux/macOS, you can also use ping6 for IPv6. Windows auto-detects but respects the -4 and -6 flags.
Explicitly choosing IP versions diagnoses whether problems are protocol-specific. "Works on IPv4, fails on IPv6" points to different infrastructure or configuration issues.
Practical Combinations
Quick connectivity check:
Quality assessment (catches intermittent issues):
Path MTU discovery:
Stress test (with permission):
Long-term monitoring:
Platform-Specific Extras
Linux:
-A: Adaptive ping—adjusts interval based on round-trip time-R: Record route—shows up to 9 hops in the packet's path
macOS:
-a: Audible ping—beeps for each reply-o: Exit after first successful reply
Windows:
-r count: Record route for specified hops-s count: Add timestamps for specified hops
Frequently Asked Questions About Ping Options
Was this page helpful?