openharmony 鸿蒙 kernel-small-debug-shell-net-ping

2022-08-09 浏览 (755)

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

ParameterDescriptionValue Range
--helpDisplays the parameters supported by the ping command.N/A
-4Forcibly pings the destination address using the IPv4 protocol.0-65500
-c CNTSpecifies the number of execution times. The default value is 3.1-65535
-fPings an IPv4 address in implicit mode. The default parameter configuration is equivalent to -c 15 -i 0.2.N/A
-i intervalSpecifies the interval (in ms) for sending a ping packet.1-200
-qImplicitly pings an IPv4 address. If the host is still alive, the ping stops after true is returned.N/A
-s SIZESpecifies the size of a ping packet, in bytes. The default size is 56 bytes.0-4088
IPSpecifies the IPv4 address of the network to test.N/A

Usage Guidelines

  • 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 protocol stack is enabled.

Example

Run ping 192.168.1.3.

Output

Ping 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

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Kernel

harmony 鸿蒙Kernel Coding Specification

harmony 鸿蒙Standard Libraries

harmony 鸿蒙Interrupt Management

harmony 鸿蒙Event

harmony 鸿蒙Mutex

harmony 鸿蒙Queue

harmony 鸿蒙Semaphore

harmony 鸿蒙Doubly Linked List

harmony 鸿蒙Memory Management

  • 所属分类: 后端技术
  • 本文标签: 鸿蒙 软件
  • 版权声明: 本文链接 https://seaxiang.com/blog/94bc91f1d1884b679b826c044b0500bf