Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ipv6 ping connect: invalid argument on android

Tags:

android

ipv6

ping

Why ping6 doesn't work on my Android dev?

ping6 on the Android dev.

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

ifconfig on the Android dev.

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 on my desktop.

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 on my desktop.

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 on my desktop. broadcast addr

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!)
like image 855
Andrey Egorov Avatar asked Jun 21 '17 08:06

Andrey Egorov


1 Answers

use the following syntax on Android:

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

You must add %wlan0 since it is a link-local address, and your android device has multiple interfaces (Wi-Fi and mobile at least), so you need to tell your device the interface/link you want to use with this link-local address.

like image 88
Alexandre Fenyo Avatar answered Oct 17 '22 16:10

Alexandre Fenyo