ping function

Latest reply: Sep 5, 2018 14:19:00 292 1 0 0
ping [ ip ] [ -a source-ip-address | -c count | -d | { -f | ignore-mtu } | -h ttl-value | -nexthop nexthop-ip-address | -i interface-type interface-number | -m time | -n | -name | -p pattern | -q | -r | { -s packetsize | -range [ min min-size | max max-size | step step-size ] * } | -system-time | -t timeout | -tos tos-value | -v | -vpn-instance vpn-instance-name ] * host [ ip-forwarding ]


ParameterDescriptionValue
ipIndicates the IPv4 protocol. If ip is not specified, the IPv4 protocol is used.-
-a source-ip-addressSpecifies the source IP address of the ICMP Echo Request message. If the source IP address is not specified, the IP address of the outbound interface is used as the source IP address of the ICMP Echo Request message.The value is in dotted decimal notation.
-c countSpecifies the number of times for sending ICMP Echo Request messages.

The ping command labels each ICMP Echo Request message with a sequence ID that starts from 1 and is increased by 1. By default, five ICMP Echo Request messages are sent. You can set the number of ICMP Echo Request messages to send by specifying the parameter count.

In the case of poor network quality, you can set this parameter to a comparatively large value to check the network quality based on the packet loss rate.

The value is an integer that ranges from 1 to 4294967295. The default value is 5.
-dIndicates that the socket works in debug mode.By default, the socket works in non-debug mode.
-fIndicates that packets are not fragmented during transmission.
NOTE:

After this parameter is specified, ICMP packets are not fragmented. If the ICMP packet size exceeds the link MTU, the ICMP packet is discarded. If you do not want ICMP packets to be discarded, do not specify this parameter or increase the link MTU.

-
-h ttl-valueSpecifies the TTL value.

If the TTL field is reduced to 0 during message forwarding, the Layer 3 device that the message reaches sends an ICMP timeout message to the source host, indicating that the destination host is unreachable.

The value is an integer that ranges from 1 to 255. The default value is 255.
-nexthopnexthop-ip-address

Specifies an IP address for the next hop.

If you have specified this parameter, the device no longer searches the routing table before sending ICMP Echo Response packets. This process prevents ping failures caused by incorrect routing entries.

The value is in dotted decimal notation.

NOTE:
  • The specified next hop address must be the next hop address of a directly connected physical interface.

  • When you specify a next hop address, you can configure -iinterface-type interface-number to specify an outbound interface. The following conditions must be met to ensure a test success:

    • The specified next hop address must match the outbound interface.
    • The specified outbound interface cannot be a logical interface's member interface.
  • If you have specified a next hop address, you cannot specify a VPN.

-i interface-typeinterface-numberSpecifies the outbound interface for sending ICMP Echo Request messages.-
-m timeSpecifies the time to wait before sending the next ICMP Echo Request message.

Each time the source sends an ICMP Echo Request message using the ping command, the source waits a period of time (500 ms by default) before sending the next ICMP Echo Request message. You can set the time to wait before sending the next ICMP Echo Request message using the parameter time. In the case of poor network condition, the value should be equal to or larger than 500, in milliseconds.

The value is an integer that ranges from 1 to 10000, in milliseconds. The default value is 500.
-nUses the value of host as the IP address to spare domain name resolution.-
-nameDisplays the name of the destination host.-
-p pattern

Specifies pad characters for ICMP Echo Request messages.

By configuring pad characters for ICMP Echo Request messages, you can identify a specific message among the large number of received ICMP Echo Reply messages.

The value is a hexadecimal integer that ranges from 0 to FFFFFFFF. By default, the padding starts from 0x01, and continues in ascending order.
-qDisplays only the statistics. If the ping command carries this parameter, the system displays only the statistics information such as the number of sent and received packets, packet loss rate, and minimum, average, and maximum RTTs of the packet.By default, the system displays all statistics information.
-rRecords the route along which an IP packet is forwarded.

When -r is specified, during the transmission of an IP packet, the IP address of each Layer 3 device that the IP packet passes through is added to the Options field. When the IP packet reaches the destination, all IP addresses recorded in the Options field are copied to the ICMP Echo Reply message. In addition, the IP address of each Layer 3 device that the returned IP packet passes through is added to the message. When the ping program receives the ICMP Echo Reply message, IP addresses of the passed Layer 3 devices are displayed.

By default, the route along which an IP packet is forwarded is not recorded.
-spacketsizeSpecifies the length of an ICMP Echo Request message, excluding the IP header and ICMP header.The value is an integer that ranges from 20 to 9600, in bytes. The default value is 56.
-rangeEnables the device to send ICMP Echo Request messages with variable payload lengths.
  • If the -range parameter is not specified, the payload length of an ICMP Echo Request message is equal to the length specified by the -s packetsize parameter. The default value is 56, in bytes.
  • If the -range parameter is specified, the payload length of the first ICMP Echo Request message is min min-size, and that of the second ICMP Echo Request message is min min-size plus step step-size. The payload length increases incrementally by step step-size for subsequent ICMP Echo Request messages until max max-size is reached. After that, the device will not send ICMP Echo Request messages any more.

    By default, the payload length of an ICMP Echo Request message ranges from 56 to 9600 bytes, and the step length is 1 byte.

    NOTE:
    • The command execution takes a long period if a large number of ICMP Echo Request messages need to be sent. If you want to terminate the command execution, press Ctrl+C.
    • To change the number of ICMP Echo Request messages to be sent, change the values of minmin-size and max max-size. The value of min min-size must be smaller than that of max max-size.
    • If both the -range and -c count parameters are specified, the device sends ICMP Echo Request messages of the same payload length for the number of times specified by the -c countparameter.
min min-sizeSpecifies the minimum payload length of an ICMP Echo Request message.The value is an integer ranging from 20 to 9600, in bytes. The default value is 56.
max max-sizeSpecifies the maximum payload length of an ICMP Echo Request message.The value is an integer ranging from 20 to 9600, in bytes. The default value is 9600.
step step-sizeSpecifies the step length of an ICMP Echo Request message.The value is an integer ranging from 1 to 1000, in bytes. The default value is 1.
-system-timeDisplays the system time when the ping packet is sent.-
-t timeout

Specifies the timeout period to wait for an ICMP Echo Reply message after an ICMP Echo Request message is sent.

After the ping command is run, the source sends an ICMP Echo Request message to a destination and waits for an ICMP Echo Reply message. If the destination, after receiving the ICMP Echo Request message, returns an ICMP Echo Reply message to the source within the period specified by the parameter timeout, the destination is reachable. If the destination does not return an ICMP Echo Reply message within the specified period, the source displays that the message times out.

Normally, the source receives an ICMP Echo Reply message within 1 to 10 seconds after sending an ICMP Echo Request message. If the transmission speed is low, properly prolong the timeout period.

The value is an integer that ranges from 0 to 65535, in milliseconds. The default value is 2000.
-tos tos-valueSpecifies the ToS value of the sent ICMP Echo Request messages. The ToS value is used to set the packet priority.The value is an integer that ranges from 0 to 255. The default value is 0.
-vDisplays all received ICMP Echo Reply messages.
  • If -v is not specified, the system displays only the ICMP Echo Reply messages received by the local user.
  • If -v is specified, the system displays all received ICMP Echo Reply messages.
By default, only ICMP Echo Reply messages for the local user are displayed.
-vpn-instancevpn-instance-nameSpecifies the name of a VPN instance.The value must be an existing VPN instance name.
ignore-mtuIndicates that the system does not check the interface MTU when a packet is sent.-
hostSpecifies the domain name or IP address of the destination host.The value is a string of 1 to 255 case-sensitive characters with spaces not supported. When double quotation marks are used around the string, spaces are allowed in the string. Alternatively, the value can be a valid IPv4 address in dotted decimal notation.
ip-forwardingIndicates that the ping packets are forcibly forwarded through IP on the first node.-
  • x
  • convention:

Sergio93
Created Sep 5, 2018 14:19:00 Helpful(0) Helpful(0)

Thanks, good post.
  • x
  • convention:

BEST%20ANSWER!%20If%20you%20think%20I%20earn%20it!%3Cbr%2F%3E%3Cbr%2F%3EIf%20this%20post%20was%20useful%20to%20you%2C%20please%20click%20the%20%3Cimg%20id%3D%22aimg_eYhFO%22%20onclick%3D%22zoom(this%2C%20this.src%2C%200%2C%200%2C%200)%22%20class%3D%22zoom%22%20src%3D%22https%3A%2F%2Fforum.huawei.com%2Fenterprise%2Fen%2Fstatic%2Fimage%2Fcommon%2Fsupport01.png%22%20onmouseover%3D%22img_onmouseoverfunc(this)%22%20onload%3D%22thumbImg(this)%22%20border%3D%220%22%20alt%3D%22%22%20%2F%3E%20%3Cfont%20color%3D%22DarkOrange%22%3EHelpful%3C%2Ffont%3E%20button%20and%20flag%20my%20post%20as%20a%20%26quot%3BBEST%20ANSWER%26quot%3B%20so%20others%20can%20benefit.%20Thank%20you%20%3Cimg%20id%3D%22aimg_H808i%22%20onclick%3D%22zoom(this%2C

Comment

Reply
You need to log in to reply to the post Login | Register

Notice Notice: To protect the legitimate rights and interests of you, the community, and third parties, do not release content that may bring legal risks to all parties, including but are not limited to the following:
  • Politically sensitive content
  • Content concerning pornography, gambling, and drug abuse
  • Content that may disclose or infringe upon others ' commercial secrets, intellectual properties, including trade marks, copyrights, and patents, and personal privacy
Do not share your account and password with others. All operations performed using your account will be regarded as your own actions and all consequences arising therefrom will be borne by you. For details, see " Privacy."
If the attachment button is not available, update the Adobe Flash Player to the latest version!
Login and enjoy all the member benefits

Login and enjoy all the member benefits

Login