The other weekend I wrote some notes on how to quickly spin up an IPv6 test lab. The idea for this was to allow me to write a custom tool to enumerate hosts that respond to IPv6 neighbour discovery on my local network. I then wanted that tool to identify the corresponding IPv4 address for that host (if there is one). And finally, identify if the IPv6 address is a router as it responds to Router Solicitation requests.

I wanted to do this with minimal dependencies, the only one currently is arp-scan, however there’s the likelihood that I can remove this dependency by coding it manually in the future. I’ve purposely not coded with RFC4862 in mind as SLAAC (Stateless Address Autoconfiguration) as some devices such as OS X adhere to RFC4941 and randomise the link local address as a privacy feature.

Another thing I wanted to ensure was that this tool worked on both OS X and Linux, so I’ve tried to ensure that’s the case.

I’m not one for writing much, so here’s an example run as a picture describes a thousand words:

One thing to note, this works for IPv6 to IPv4, if the host doesn’t have an IPv6 address it won’t be shown in the list…

The code can be found here for those that want it: https://github.com/phillips321/phillips321/blob/master/ipv6finder.sh

Leave a Reply