How to find all IPv6 IP addresses on LAN

1.7k Views Asked by At

Still getting used to this, but anyone out there that knows the best way to retrieve all IP addresses on a network segment that are IPV6?

1

There are 1 best solutions below

0
Per Johansson On

Pinging ff02::1 on a particular interface is a way to ask all the nodes on that interface to reply to the ping. It is of course up to each node to determine if they indeed do reply.

ff02 is the prefix for the link-local multicast scope, and ::1 is the "all nodes" destination. In practice, you probably also have to add interface number, e.g. ff02::1%3 for interface number 3. This is because you have to specify which interface to send the ping on.

I don't know how to do this in C# though, nor could I get it to work on Windows 10 cmd.exe, ping would just say there's no reply. But on my OS X laptop, it works:

:; ping6 ff02::1%en0
PING6(56=40+8+8 bytes) fe80::xxxx:xxxx:xxxx:xxxx%en0 --> ff02::1%en0
16 bytes from fe80::xxxx:xxxx:xxxx:xxxx%en0, icmp_seq=0 hlim=64 time=0.089 ms
16 bytes from fe80::yyyy:yyyy:yyyy:yyyy%en0, icmp_seq=0 hlim=64 time=2.160 ms
16 bytes from fe80::zzzz:zzzz:zzzz:zzzz%en0, icmp_seq=0 hlim=64 time=2.238 ms

If you're looking to connect to your own program running on other nodes in the LAN, you should probably setup a specific multicast address for that purpose, or use ff02::1 with a specific udp port. This works mostly the same on IPv4 and IPv6.

Edit: Just noticed that it seems at least by default, Windows 10 will also not answer these pings.