1# ping<a name="EN-US_TOPIC_0000001133846496"></a> 2 3- [Command Function](#section119672573385) 4- [Syntax](#section869419010390) 5- [Parameters](#section9877183173918) 6- [Usage](#section1097046193914) 7- [Example](#section14564129113911) 8- [Output](#section1621732891215) 9 10## Command Function<a name="section119672573385"></a> 11 12This command is used to test an IPv4 network connection. 13 14## Syntax<a name="section869419010390"></a> 15 16ping_ _\[_-n cnt_\] \[_-w interval_\] \[_-l data\_len_\]_ <IP\>_ 17 18ping \[_-t_\] \[_-w interval_\] _<IP\>_ 19 20ping _-k_ 21 22## Parameters<a name="section9877183173918"></a> 23 24**Table 1** Parameter description 25 26<a name="table2664mcpsimp"></a> 27<table><thead align="left"><tr id="row2670mcpsimp"><th class="cellrowborder" valign="top" width="21%" id="mcps1.2.4.1.1"><p id="p2672mcpsimp"><a name="p2672mcpsimp"></a><a name="p2672mcpsimp"></a><strong id="b8570451611622"><a name="b8570451611622"></a><a name="b8570451611622"></a>Parameter</strong></p> 28</th> 29<th class="cellrowborder" valign="top" width="52%" id="mcps1.2.4.1.2"><p id="p2674mcpsimp"><a name="p2674mcpsimp"></a><a name="p2674mcpsimp"></a><strong id="b18214141162620"><a name="b18214141162620"></a><a name="b18214141162620"></a>Description</strong></p> 30</th> 31<th class="cellrowborder" valign="top" width="27%" id="mcps1.2.4.1.3"><p id="p2676mcpsimp"><a name="p2676mcpsimp"></a><a name="p2676mcpsimp"></a><strong id="b54224635611622"><a name="b54224635611622"></a><a name="b54224635611622"></a>Value Range</strong></p> 32</th> 33</tr> 34</thead> 35<tbody><tr id="row2677mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p2679mcpsimp"><a name="p2679mcpsimp"></a><a name="p2679mcpsimp"></a>IP</p> 36</td> 37<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p2681mcpsimp"><a name="p2681mcpsimp"></a><a name="p2681mcpsimp"></a>Specifies the IPv4 address whose network connectivity is to be tested.</p> 38</td> 39<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="entry2682mcpsimpp0"><a name="entry2682mcpsimpp0"></a><a name="entry2682mcpsimpp0"></a>N/A</p> 40</td> 41</tr> 42<tr id="row2690mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p2692mcpsimp"><a name="p2692mcpsimp"></a><a name="p2692mcpsimp"></a>-n cnt</p> 43</td> 44<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p2694mcpsimp"><a name="p2694mcpsimp"></a><a name="p2694mcpsimp"></a>Specifies the number of execution times. If this parameter is not specified, the default value is <strong id="b1339603692614"><a name="b1339603692614"></a><a name="b1339603692614"></a>4</strong>.</p> 45</td> 46<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p2696mcpsimp"><a name="p2696mcpsimp"></a><a name="p2696mcpsimp"></a>1-65535</p> 47</td> 48</tr> 49<tr id="row2697mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p2699mcpsimp"><a name="p2699mcpsimp"></a><a name="p2699mcpsimp"></a>-w interval</p> 50</td> 51<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p2701mcpsimp"><a name="p2701mcpsimp"></a><a name="p2701mcpsimp"></a>Specifies the interval (in ms) between two ping packets.</p> 52</td> 53<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p971414819577"><a name="p971414819577"></a><a name="p971414819577"></a>>0</p> 54</td> 55</tr> 56<tr id="row2703mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p2705mcpsimp"><a name="p2705mcpsimp"></a><a name="p2705mcpsimp"></a>-l data_len</p> 57</td> 58<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p2707mcpsimp"><a name="p2707mcpsimp"></a><a name="p2707mcpsimp"></a>Specifies the data length of the ICMP echo request packet, excluding the ICMP packet header.</p> 59</td> 60<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p2710mcpsimp"><a name="p2710mcpsimp"></a><a name="p2710mcpsimp"></a>0-65500</p> 61</td> 62</tr> 63<tr id="row2711mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p2713mcpsimp"><a name="p2713mcpsimp"></a><a name="p2713mcpsimp"></a>-t</p> 64</td> 65<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p2715mcpsimp"><a name="p2715mcpsimp"></a><a name="p2715mcpsimp"></a>Specifies a permanent ping thread, which will be killed until the <strong id="b153129414503"><a name="b153129414503"></a><a name="b153129414503"></a>ping -k</strong> command is executed.</p> 66</td> 67<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p20501182215720"><a name="p20501182215720"></a><a name="p20501182215720"></a>N/A</p> 68</td> 69</tr> 70<tr id="row2718mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p2720mcpsimp"><a name="p2720mcpsimp"></a><a name="p2720mcpsimp"></a>-k</p> 71</td> 72<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p2722mcpsimp"><a name="p2722mcpsimp"></a><a name="p2722mcpsimp"></a>Kills the ping thread and stops the ping operation.</p> 73</td> 74<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="p940472325719"><a name="p940472325719"></a><a name="p940472325719"></a>N/A</p> 75</td> 76</tr> 77</tbody> 78</table> 79 80## Usage<a name="section1097046193914"></a> 81 82- Run the **ping** command by setting a destination IP address to check whether the network connection to the destination IP address is normal. 83- If the destination IP address is unreachable, the system displays a message indicating that the request times out. 84- If no route is available to the destination IP address, an error message is displayed. 85- This command can be used only after the TCP/IP protocol stack is enabled. 86 87## Example<a name="section14564129113911"></a> 88 89Run **ping 192.168.1.10**. 90 91## Output<a name="section1621732891215"></a> 92 93**Figure 1** Output of pinging the IP address of the TFTP server<a name="fig525762695417"></a> 94 95 96 97 98