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

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
  • 62,573
  • 32
  • 113
  • 225
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
  • 850
  • 6
  • 18