2

My Raspberry Pi runs ArchLinux and since I enabled IPv6 in our local router config, the pi only fires up an IPv6 connection in LAN. But I have trouble to find out the address.

Once I connected a display and found out the address is fe80::ba27:ebff:fe4a:6a12. I was able to connect to the pi with the following command:

ssh -6 user@fe80::ba27:ebff:fe4a:6a12%wlp3s0

Where wlp3s0 is the wifi device of my local client. Update: I removed that part as it was confusing. I have no display available. I need to find out the IPv6 address from remote!

For IPv4 I use nmap, but I have trouble to translate that command to work with a local IPv6 network. I understand nmap also offers an --ipv6 or -6 flag, but what is the correct subnet string? And, does that even work? Is that even possible?

Here is my client's ip a output:

 user@computer ~ $ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether d4:3d:7e:**:**:** brd ff:ff:ff:ff:ff:ff
    inet 192.168.178.28/24 brd 192.168.178.255 scope global eno1
       valid_lft forever preferred_lft forever
    inet6 2002:5dc4:6c0e:*:****:****:****:****/64 scope global mngtmpaddr noprefixroute dynamic 
       valid_lft 7191sec preferred_lft 3591sec
    inet6 fe80::1543:f119:fbae:743b/64 scope link 
       valid_lft forever preferred_lft forever

Is it even possible to scan an IPv6 network?

q9f
  • 221
  • 3
  • 4
  • 11
  • I would check router administrative interface, if it can list connected devices and their IP addresses. It will be probably faster than scanning the whole subnet. – Jakuje Mar 28 '16 at 19:21
  • @Jakuje it somehow only lists ipv4 addresses. – q9f Mar 28 '16 at 19:22
  • Did you tried already

    ip -6 addr show dev YOURDEVICENAME

    • or -

    ifconfig YOURDEVICENAME

    • examples: ip -6 addr show dev eth0 / ifconfig eth0

    • ?

    – DLLDevStudio Mar 28 '16 at 19:43
  • @DLLDevStudio this shows the ipv6 of my workstation, but not the pi. I'm trying to connect from remote. – q9f Mar 28 '16 at 19:46
  • if i got you right you connected a display to the pi, isnt it? so you can type in the commands i provided to hopefully get the correct information. if all this failes go for my nmap answer and try the huge scan... good luck – DLLDevStudio Mar 28 '16 at 20:21
  • addition. lets say the address is correct that you saw on the display. try to connect from localhost to the ip. means directly from the raspberry with display and keyboard connected... also you are sure that ssh is running? and what about your firewall? – DLLDevStudio Mar 28 '16 at 20:24
  • @DLLDevStudio sorry that was confusing. I have no display available. Trying to determine the address from remote. – q9f Mar 28 '16 at 20:27
  • ok then finally you have two options. scan the whole network. so try my commands i provided or check your router. a bunch of routers show connected devices somehwere in its administration panel. depending on what router you have that may work. the only other alternative way that maybe works could be if you switch off ipv6 in your router to gain ipv4 access to the device. then you will be able to setup the raspberry in a way that will help you after reswitch back to ipv6 to connect to. – DLLDevStudio Mar 28 '16 at 20:39
  • Have you switched from "private" to "hardware" for the slaac address that's used for your IPv6 address? That's done in /etc/dhcpcd.conf. That way you can calculate the IPv6 EUI-64 address from the MAC-48 address. – Dougie Sep 14 '23 at 16:26

5 Answers5

5

Send a ping to the link-local all-nodes multicast address, and you'll receive a response from the address of every device connected to that link that responds to pings.

Note that this will only be reliable on Ethernet (as Wi-Fi routers are often not configured to forward multicast packets), and only if you did not disable IPv6 on the Raspberry Pi for some bizarre reason.

From a different Linux machine on the same LAN:

$ ping6 -c1 ff02::1%enp4s0
PING ff02::1%br0(ff02::1) 56 data bytes
64 bytes from fe80::5054:ff:fe6f:ac50: icmp_seq=1 ttl=64 time=0.187 ms
64 bytes from fe80::5054:ff:fe07:7153: icmp_seq=1 ttl=64 time=0.198 ms (DUP!)
64 bytes from fe80::5054:ff:fe15:8cb6: icmp_seq=1 ttl=64 time=0.209 ms (DUP!)
64 bytes from fe80::5054:ff:fe4d:fd2c: icmp_seq=1 ttl=64 time=0.256 ms (DUP!)
64 bytes from fe80::c6e9:84ff:fe6e:3eb6: icmp_seq=1 ttl=64 time=0.288 ms (DUP!)

(Obviously you should use the actual interface on the computer you're using, rather than enp4s0.)

One of the responders should be your Raspberry Pi.

Michael Hampton
  • 153
  • 1
  • 10
0

The easiest way is have mDNS advertise the SSH service:

sudo cp /usr/share/doc/avahi-daemon/examples/*ssh*.service /etc/avahi/services/
sudo systemctl restart avahi-daemon

You can also set this up on the SD card before the first boot.

On the source host you may need to alter /etc/nsswitch.conf to replace mdns4_minimal with mdns_minimal.

On the source host now say

ssh raspberrypi.local

(or whatever hostname you chose, followed by .local).

Avahi will advertise a global IPv6 address if one is available on the interface, otherwise will advertise the link-local IPv6 address of the interface.

vk5tu
  • 151
  • 1
  • 2
0

Try to scan the following range:

fe80:0000:0000:0000:0000:0000:0000:0000/112

This should scan 65536 ipv6 addresses in your IPv6 network.

This scan can take a lot of time to complete. Alternatively you can try:

nmap -6 --script=targets-ipv6-multicast-*

to scan all IPv6 devices in your subnet.

q9f
  • 221
  • 3
  • 4
  • 11
0

Unless you have a router or network which allocates ipv6 addresses (or you manually allocate them) you will NOT have an ipv6 address.

The addresses you listed are link-local addresses. These are used (similarly to ipv4 link-local addresses) as part of the allocation process.

As the name applies these are NOT routable adresses. They only work on a single link.

Wiki has good articles describing these.

Milliways
  • 59,890
  • 31
  • 101
  • 209
0
  1. Tools I used this tool for windows its called IPScan http://www.eusing.com/ipscan/free_ip_scanner.htm

  2. Through router find the list of connected devices. Attached devices/DHCP Clients Table.

  3. In windows i used arp -a and then look for the mac address of my Raspberry pi. since I had gitbash the below command worked for my windows

    arp -a |grep -i "01.00.5e.7f.ff.fa"

[EDIT]: Corrected grep in arp -a |grep -i "01.00.5e.7f.ff.fa" to use regex for mac devides

Leif
  • 3
  • 2
Varad A G
  • 848
  • 6
  • 17