• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# ping6
2
3
4## 命令功能
5
6ping6用于测试IPv6网络连接是否正常。
7
8
9## 命令格式
10
11ping6 _[-c count] [-I interface / sourceAddress] destination_
12
13
14## 参数说明
15
16**表1** 参数说明
17
18| 参数                  | 参数说明                            | 取值范围 |
19| --------------------- | ----------------------------------- | -------- |
20| -c count         | 执行的次数,不带本参数则默认为4次。 | [1, 65535]  |
21| -I interface     | 指定网卡执行IPv6 ping操作。    | N/A      |
22| -I sourceAddress | 指定源IPv6地址执行ping操作。        | N/A      |
23| destination           | 目标主机地址。                      | N/A      |
24
25
26## 使用指南
27
28- 如果目的IPv6地址不可达,会显示请求超时。
29
30- 如果显示发送错误,说明没有到目的IPV6的路由。
31
32- 命令需要启动TCP/IP协议栈后才能使用。
33
34## 特殊说明
35
36shell端暂不支持。
37
38## 使用实例
39
40- ping6 2001:a:b:c:d:e:f:b
41
42- ping6 -c 3 2001:a:b:c:d:e:f:b
43
44- ping6 -I eth0 2001:a:b:c:d:e:f:b
45
46- ping6 -I 2001:a:b:c:d:e:f:d 2001:a:b:c:d:e:f:b
47
48
49## 输出说明
50
511. 输入`ping6 2001:a:b:c:d:e:f:b`
52
53   ```
54   OHOS # ping6 2001:a:b:c:d:e:f:b PING 2001:A:B:C:D:E:F:B with 56 bytes of data.
55   56 bytes from 2001:A:B:C:D:E:F:B : icmp_seq=1 time<1 ms
56   56 bytes from 2001:A:B:C:D:E:F:B : icmp_seq=2 time<1 ms
57   56 bytes from 2001:A:B:C:D:E:F:B : icmp_seq=3 time<1 ms
58   56 bytes from 2001:A:B:C:D:E:F:B : icmp_seq=4 time<1 ms
59   --- 2001:a:b:c:d:e:f:b/64 ping statistics ---
60   4 packets transmitted, 4 received, 0.00% packet loss, time 20ms
61   rtt min/avg/max = 0/0.00/0 ms
62   ```
63
642. 输入 `ping6 -c 3 2001:a:b:c:d:e:f:b`   指定3次进行网络测试
65
66   ```
67   OHOS # ping6 -c 3 2001:a:b:c:d:e:f:b    PING 2001:A:B:C:D:E:F:B with 56 bytes of data.
68   56 bytes from 2001:A:B:C:D:E:F:B : icmp_seq=1 time<1 ms
69   56 bytes from 2001:A:B:C:D:E:F:B : icmp_seq=2 time<1 ms
70   56 bytes from 2001:A:B:C:D:E:F:B : icmp_seq=3 time<1 ms
71   --- 2001:a:b:c:d:e:f:b/64 ping statistics ---
72   3 packets transmitted, 3 received, 0.00% packet loss, time 20ms
73   rtt min/avg/max = 0/0.00/0 ms
74   ```
75
763. 输入 `ping6 -I eth0 2001:a:b:c:d:e:f:b`  使用指定网卡接口eth0测试IPv6。
77
78   ```
79   OHOS # ping6 -I eth0 2001:a:b:c:d:e:f:b PING 2001:A:B:C:D:E:F:B with 56 bytes of data.
80   56 bytes from 2001:A:B:C:D:E:F:B : icmp_seq=1 time=10 ms
81   56 bytes from 2001:A:B:C:D:E:F:B : icmp_seq=2 time<1 ms
82   56 bytes from 2001:A:B:C:D:E:F:B : icmp_seq=3 time<1 ms
83   56 bytes from 2001:A:B:C:D:E:F:B : icmp_seq=4 time<1 ms
84   --- 2001:a:b:c:d:e:f:b/64 ping statistics ---
85   4 packets transmitted, 4 received, 0.00% packet loss, time 30msrtt min/avg/max = 0/2.50/10 ms
86   ```
87
884. 输入 `ping6 -I 2001:a:b:c:d:e:f:d 2001:a:b:c:d:e:f:b`   使用指定的源IPv6地址2001:a:b:c:d:e:f:d进行测试。
89
90   ```
91   OHOS # ping6 -I 2001:a:b:c:d:e:f:d 2001:a:b:c:d:e:f:b PING 2001:A:B:C:D:E:F:B with 56 bytes of data.
92   56 bytes from 2001:A:B:C:D:E:F:B : icmp_seq=1 time<1 ms
93   56 bytes from 2001:A:B:C:D:E:F:B : icmp_seq=2 time<1 ms
94   56 bytes from 2001:A:B:C:D:E:F:B : icmp_seq=3 time<1 ms
95   56 bytes from 2001:A:B:C:D:E:F:B : icmp_seq=4 time<1 ms
96   --- 2001:a:b:c:d:e:f:b/64 ping statistics ---
97   4 packets transmitted, 4 received, 0.00% packet loss, time 20msrtt min/avg/max = 0/0.00/0 ms
98   ```