12

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!)
Andrey Egorov
  • 391
  • 1
  • 4
  • 15
  • 1
    Not sure why this question was downvoted, it's a good question. It hasn't been edited, so there couldn't have been an earlier, cr*ppier version. Well, now it's back to 0. – trysis Nov 05 '18 at 11:57

2 Answers2

18

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.

Alexandre Fenyo
  • 4,526
  • 1
  • 17
  • 24
  • it doesn't work on android for some reason. `ping6 -I wlan0` is the same (see ping6 output included in the question) – Andrey Egorov Aug 30 '17 at 16:30
  • Your error messages are expected: in your question, you never write the correct command line, using `ping6 IP_ADDRESS%INTERFACE_NAME`. You write things using the -I parameter or addresses with weird format like this one: fe80::405a:e0a5:e054:cbde@20 (what is this `@20` ?). On my Android devices (Galaxy S2, Nexus 5X), the syntax I wrote works correctly. – Alexandre Fenyo Aug 30 '17 at 19:49
  • @20 is scopeid. – Andrey Egorov Aug 31 '17 at 05:08
  • Why don't you want to try, in your question, the indicated syntax **ping6 fe80::405a:e0a5:e054:cbde%wlan0**? – Alexandre Fenyo Aug 31 '17 at 05:21
  • `bullhead:/ $ ping6 fe80::405a:e0a5:e054:cbde@wlan0` `unknown host` – Andrey Egorov Sep 04 '17 at 05:22
  • Again, your command is wrong: you definitively want to write `@` instead of `%`... It may never work if you systematically deny to check exactly what people ask you to try. – Alexandre Fenyo Sep 04 '17 at 05:30
-3

ping with this commamd will help you for pinging the ipv6 address

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

Where ipv6 address is - 2405:200:1601:c2ff::86

Uwe Keim
  • 39,551
  • 56
  • 175
  • 291