--- title: ping โ€” Check connection reachability date: 2026-10-18 time: 12:00 model: admin category: programs author_type: human summary: A basic command that checks target host reachability and response latency and loss using ICMP. tags: program, Network and Firewall, ping --- **๐Ÿ’ฌ "ping command"** ping checks **reachability and latency**. It is the first step in diagnosing network problems. In environments where ICMP is blocked, a ping failure may not indicate a service problem. - **Concept**: Measures round-trip time using ICMP echo request/response. - **time**: Round-trip latency. A sudden increase indicates a segment problem. - **packet loss**: Loss rate. 0% is normal. - **Statistics**: Summarizes minimum/average/maximum latency and loss on exit. ## Commonly used options | Option | Description | | --- | --- | | -c | Sends the specified number of packets (essential for automation) | | -i | Adjusts the interval between sends | | -W | Limits the response wait time | | -s | Specifies the packet size to check MTU issues | ## 3 essential command combinations - `ping -c 4 10.0.0.9` โ€” Check internal server reachability - `ping -c 10 -i 0.2 8.8.8.8` โ€” Check external connectivity and loss - `ping -M do -s 1472 10.0.0.9` โ€” Check MTU (fragmentation) issues **๐Ÿ’ฌ "Show me an example of checking with minimal commands in an emergency"** Here are common situations on production servers, organized in order. ### Step 1 ยท Gateway Start by checking the closest target. ``` ping -c 3 10.0.1.1 ``` ### Step 2 ยท Target server Check reachability to the target server. ``` ping -c 4 10.0.0.9 ``` ### Step 3 ยท Latency trend Observe latency/loss trends by repeating measurements. ``` ping -c 20 -i 0.2 10.0.0.9 ``` ## How this is used in practice ### 1. Service connection latency **Situation** โ€” Web responses are intermittently slow. ``` ping -c 20 -i 0.2 10.0.0.9 ``` **Result** โ€” Check whether average latency and packet loss are within normal ranges. **Point** โ€” If ping works but the service is slow, look at the application/DB segment. ### 2. ICMP-blocked environments **Situation** โ€” Ping does not work, but the service is fine. ``` ping -c 3 -W 2 10.0.0.9 ; curl -sI -m 3 https://10.0.0.9 | head -1 ``` **Result** โ€” Confirm that ICMP is blocked, but HTTPS responds. **Point** โ€” Checking reachability via the actual service port (TCP) is more accurate. ## Important notes - In ICMP-blocked environments, ping failure does not mean an outage. - An endless ping never terminates, so use -c for automation. - Sending excessive ICMP traffic can lead to blocking or warnings. ## Actual execution output This is the result of checking internal server reachability and latency. ![ping command execution result: reachability and latency](https://games.aidebatehub.com/assets/ping-demo.png) Production server --- Source (HTML): https://games.aidebatehub.com/programs/linux/network/ping.html This file is an auto-generated Markdown twin of the DevHub document.