IPv6 - Where’s my RPi?

A while back I posted my script for scanning your local network in search of your Raspberry Pi, IP address!
It works great and every time the DHCP changes the assigned IP finding it is a breeze (I have no monitor or else attached to my Pis).
Most recently I added a wireless adapter to my Pi and for reasons that are not totally clear to me while the ethernet interface gets an IPv4 address, the wlan0 gets an IPv6. At the time that I am writing this, a few folks over several forums are telling that’s “normal” followed by a various interpretations/explanations.
That made my life complicated since the script wasn’t built to support IPv6 and nmap at the time I wrote that script (ages) didn’t support IPv6 either.
This morning I set to learn more about the protocol, fix the script and share my experience. I am not a network engineer, I get by just fine but take that in account if my story doesn’t align with yours. And if you are a network guru please share away, I will be happy to update the post with your insights.
I do realize that just like in programming there are many ways of doing the same thing, the one below is what I choose to use.


I updated it and you find that on Github, I basically added a switch -6 on the command line to add the scanning support for IPv6. It’s basically a shortcut to a long typing struggle if yo would use just nmap from terminal :-)
If you need a cheat sheet for nmap, in my attempt to understand how to deal with this problem, I found this article very useful for both IP protocols. 



It’s a completely new beast to most of us common network engineers of the weekend. Below you find a few basics that I learned during my messing around with my RPis.
All your local IPs, the equivalent of 192.168.x.x are based on this weirdo:
The traditional ping, ssh and so on, also need some extra love to work under those conditions. I found that most people agree in using the -6 parameter to leverage existing commands name, the one exception was ping that is a completely different filename for the same job.
Basic Tools
To ping an address you use
ping6 <address>
To remote through a secure shell for iPv6 you use
ssh -6 <user>@<address>%<interface>
for example: ssh -6 user1@fe80::21b:21ff:fe22:e865%eth1
To ping sweep all your subnet
ping6 -I en0 ff02::1

Happy Networking -6 to you all.



Popular posts from this blog

Zen-inification - The art of decluttering

Postgres on Synology

Bring Boxee Box back to life