Got it

Ping Command Options

Latest reply: Sep 18, 2021 04:27:42 789 2 1 0 0

Hi,

I want to share below ping command options both for huawei vrp system and windows os

ping [ -a source-ip-address | -i interface-type interface-number | -m time | -c count | -f | -h ttl-value | { -s packetsize | -range [ min min-size | max max-size | step step-size ] * } | -t timeout ] *host

  • -a: specifies a source IP address for sending ICMP Echo Request packets. If this parameter is not specified, the device uses the IP address of the outbound interface as the source IP address of outgoing Echo Request packets.

  • -i: specifies an interface for sending ICMP Echo Request packets. If this parameter is not specified, the device uses the default outbound interface to send Echo Request packets.

  • -m: specifies the interval for sending Echo Request packets. The default value is 500 ms.

  • -c: specifies the number of Echo Request packets to be sent. The default value is 5. You can increase the number of outgoing Echo Request packets to obtain the packet loss ratio and further evaluate network quality.

  • -f: indicates that packets are not fragmented. 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: specifies the time to live (TTL) value. The default value is 255. If the value of the TTL field is reduced to 0 during packet forwarding, the device sends an ICMP Timeout packet to the source, indicating that the destination is unreachable.

  • -s: specifies the length of an ICMP Echo Request packet (excluding the IP packet header and ICMP packet header). The default packet length is 56 bytes.

  • -range: specifies the length of an ICMP Echo Request packet (excluding the IP packet header and ICMP packet header) and the packet length increment (step). If this parameter is specified, the length of the first packet is min, and the length of subsequent packets increases by step until the packet length reaches the maximum value max. By default, min is 56 bytes, max is 9600 bytes, and step is 1 byte.

  • min: specifies the minimum length of the payload in an ICMP Echo Request packet. The default value is 56 bytes.

  • max: specifies the maximum length of the payload in an ICMP Echo Request packet. The default value is 9600 bytes.

  • step: specifies the packet length increment. The default value is 1 byte.

  • -t: specifies the timeout period for an ICMP Echo Reply packet. The default value is 2000 ms. The device considers that the destination is unreachable if it does not receive an ICMP Echo Reply packet within the timeout period. You can set this parameter to a larger value to compensate for poor network quality.

  • host: specifies the domain name or IP address of the destination host.

The ping command provides a series of parameters. You can select different parameters by factors such as the detection purpose, network type, and network status.

Ping Command Supported on a PC

The ping command differs on PCs running different operating systems. The following describes the commonly used ping parameters supported on a Windows-based PC.

ping [ -a | -n number | -l number | -t | -f ] * ip-address

  • -a: indicates that the PC resolves an IP address to a host name.

  • -n: specifies the number of Echo Request packets to be sent.

  • -l: specifies the buffer size.

  • -t: indicates that the ping process continues until manual operations are performed. You can press Ctrl+Break to pause the ping command and view the statistics, or press Ctrl+C to terminate the running of the ping command.

  • -f: indicates that packets are not fragmented.

  • ip-address: specifies the IP address of the destination host.

Ping Example

The following describes ping commands on a switch.

Example of ping failure:

<SwitchA> ping 192.168.2.25

  PING 192.168.2.25: 56  data bytes, press CTRL_C to break    

    Request time out     

    Request time out      

    Request time out            

    Request time out          

    Request time out    

                  

  --- 192.168.2.25 ping statistics ---   

    5 packet(s) transmitted      

    0 packet(s) received     

    100.00% packet loss 

Example of ping success:

<SwitchA> ping -a 192.168.2.20 -c 7 -s 2048 192.168.2.21

  PING 192.168.2.21: 2048  data bytes, press CTRL_C to break   

    Reply from 192.168.2.21: bytes=2048 Sequence=1 ttl=255 time=24 ms    

    Reply from 192.168.2.21: bytes=2048 Sequence=2 ttl=255 time=6 ms     

    Reply from 192.168.2.21: bytes=2048 Sequence=3 ttl=255 time=13 ms    

    Reply from 192.168.2.21: bytes=2048 Sequence=4 ttl=255 time=6 ms    

    Reply from 192.168.2.21: bytes=2048 Sequence=5 ttl=255 time=12 ms    

    Reply from 192.168.2.21: bytes=2048 Sequence=6 ttl=255 time=6 ms     

    Reply from 192.168.2.21: bytes=2048 Sequence=7 ttl=255 time=13 ms    

              

  --- 192.168.2.21 ping statistics ---    

    7 packet(s) transmitted        

    7 packet(s) received    

    0.00% packet loss        

    round-trip min/avg/max = 6/11/24 ms 

Besides the ping command, if you are interested in the command trace/tracert/traceroute, you might refer to Difference between traceroute,tracert,tracepath and tcptraceroute - Huawei Enterprise Support Community

View more
  • x
  • convention:

Besides the ping command, if you are interested in the command trace/tracert/traceroute, you might refer to Difference between traceroute,tracert,tracepath and tcptraceroute - Huawei Enterprise Support Community

View more
  • x
  • convention:

NICE
View more
  • x
  • convention:

Comment

You need to log in to comment to the post Login | Register
Comment

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 " User Agreement."

My Followers

Login and enjoy all the member benefits

Login

Block
Are you sure to block this user?
Users on your blacklist cannot comment on your post,cannot mention you, cannot send you private messages.
Reminder
Please bind your phone number to obtain invitation bonus.