ipv6 ping connect:android上的参数无效

时间:2017-06-21 08:31:58

标签: android ping ipv6

为什么ping6不能在我的Android开发工具上运行?

Android dev上的ping6。

bullhead:/ # ping6 fe80::405a:e0a5:e054:cbde
connect: Invalid argument
2|bullhead:/ # ping6 -I wlan0 fe80::405a:e0a5:e054:cbde                                                                                                                                                           
PING fe80::405a:e0a5:e054:cbde(fe80::405a:e0a5:e054:cbde) from fe80::7af8:82ff:fea2:3210 wlan0: 56 data bytes
ping: sendmsg: Invalid argument
^C
--- fe80::405a:e0a5:e054:cbde ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 0ms

1|bullhead:/ # ping6 -I wlan0 fe80::405a:e0a5:e054:cbde@20                                                                                                                                                        
unknown host

Android dev上的ifconfig。

wlan0     Link encap:Ethernet  HWaddr 78:f8:82:a2:32:10
          inet addr:192.168.0.101  Bcast:192.168.0.255  Mask:255.255.255.0 
          inet6 addr: fe80::7af8:82ff:fea2:3210/64 Scope: Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:5174 errors:0 dropped:0 overruns:0 frame:0 
          TX packets:2951 errors:0 dropped:0 overruns:0 carrier:0 
          collisions:0 txqueuelen:3000 
          RX bytes:1883684 TX bytes:628725 

我桌面上的ifconfig。

wlp8s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.105  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 fe80::405a:e0a5:e054:cbde  prefixlen 64  scopeid 0x20<link>
        ether 30:52:cb:6d:b1:2f  txqueuelen 1000  (Ethernet)
        RX packets 681081  bytes 913125757 (913.1 MB)
        RX errors 0  dropped 1  overruns 0  frame 0
        TX packets 375064  bytes 49389468 (49.3 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

ping6 fe80 :: 7af8:82ff:桌面上的fea2:3210。

andrey@andrey-Lenovo-ideapad-Y700-17ISK:~$ ping6 fe80::7af8:82ff:fea2:3210
PING fe80::7af8:82ff:fea2:3210(fe80::7af8:82ff:fea2:3210) 56 data bytes
64 bytes from fe80::7af8:82ff:fea2:3210%wlp8s0: icmp_seq=1 ttl=64 time=268 ms
64 bytes from fe80::7af8:82ff:fea2:3210%wlp8s0: icmp_seq=2 ttl=64 time=91.8 ms
在我的桌面上运行ping6。广播地址

andrey@andrey-Lenovo-ideapad-Y700-17ISK:~$ ping6 FF02::1
PING FF02::1(ff02::1) 56 data bytes
64 bytes from fe80::405a:e0a5:e054:cbde%wlp8s0: icmp_seq=1 ttl=64 time=0.046 ms
64 bytes from fe80::8616:f9ff:fe48:7a06%wlp8s0: icmp_seq=1 ttl=64 time=107 ms (DUP!)
64 bytes from fe80::b6ce:f6ff:fedf:b4af%wlp8s0: icmp_seq=1 ttl=64 time=112 ms (DUP!)
64 bytes from fe80::7af8:82ff:fea2:3210%wlp8s0: icmp_seq=1 ttl=64 time=200 ms (DUP!)

2 个答案:

答案 0 :(得分:5)

在Android上使用以下语法:

ping6 fe80 :: 405a:e0a5:e054:cbde%wlan0

您必须添加%wlan0,因为它是一个链接本地地址,并且您的Android设备有多个接口(至少是Wi-Fi和移动设备),因此您需要告诉您的设备您要使用的接口/链接这个链接本地地址。

答案 1 :(得分:-1)

使用此逗号ping将帮助您ping ipv6地址

"system/bin/ping6 -c " + pingCount + " " + "2405:200:1601:c2ff::86"

ipv6地址为-2405:200:1601:c2ff :: 86