ping
Command Function
This command is used to test an IPv4 connection.
Syntax
ping [-4] [-c cnt] [-f] [-i interval] [-q] [-s size] <IP>
Parameters
Table 1 Parameter description
Usage
- The ping command is used to check whether the destination IP address is reachable.
- If the destination IP address is unreachable, the system displays a message indicating that the request times out.
- If no route is available to the destination IP address, an error message is displayed.
- This command can be used only after the TCP/IP stack is enabled.
Example
Run ping 192.168.1.3.
Output
Pinging a TFTP server IP address:
OHOS:/$ ping 192.168.1.3
Ping 192.168.1.3 (192.168.1.3): 56(84) bytes.
84 bytes from 192.168.1.3: icmp_seq=0 ttl=0 time=0 ms
84 bytes from 192.168.1.3: icmp_seq=0 ttl=0 time=1 ms
84 bytes from 192.168.1.3: icmp_seq=0 ttl=0 time=0 ms
--- 192.168.1.3 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss
round-trip min/avg/max = 0/0/0 ms