ipv6 ping 连接:android 上的参数无效

ipv6 ping connect: invalid argument on android

为什么 ping6 在我的 Android dev 上不起作用?

ping6 在 Android 开发者上。

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 开发者上的 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!)

在 Android 上使用以下语法:

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

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

使用此命令ping 将帮助您ping ipv6 地址

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

其中 ipv6 地址是 - 2405:200:1601:c2ff::86