Zero Config Raspberry Pi on IPv6

Thanks to this post and a little tinkering, I demonstrated how to set up a zero config raspberry pi with IPv6 running a Django web application. The use case here is that I want to find my device using a web browser, without having to set it up at all, and without needing DHCP. In other words, with this configuration you could connect a machine with a browser and an ethernet directly to the raspberry pi, and access its functions with no configuration at all. I started with the ubuntu release for the raspberry pi, and added the avahi daemon as described in the post. I added ipv6 to the /etc/modules file. I added the xml description of the ssh service as described for the file /etc/avahi/services/ssh.service. I rebooted and verified the service description using “Bounjour Browser“. Because I left the default user and system name, the login is “ssh -6 ubuntu@ubuntu.local”. By running my Django server with an IPv6 flavor:

sudo python manage.py runserver [::]:80

I am able to access the instance at
http://ubuntu.local
– running over ipv6. I can do this with a direct connection to my iMac with no DHCP service.  The iMac can talk directly to the Raspberry pi through a switch if the ipv6 configuration is set to “autmatically” or “link local only”.   The manual IPv6 configuration requires an IPv6 router which isn’t needed for my use case (and I don’t have).

The challenge came with windows7 and Ubuntu as a host to access the Raspberry Pi over the link local address.   If I manually configure a static IPv6 address for both Raspberry Pi and the host, the connection works.   If I manually configure just the Raspberry Pi and try to access it from the iMac using a link local address, it says there is no route to the Raspberry Pi.

ping6 -I en0 ubuntu.local
PING6(56=40+8+8 bytes) fe80::426c:8fff:fe1d:562e%en0 --> 2001:db88:1:77::1
ping6: sendmsg: No route to host
ping6: wrote ubuntu.local 16 chars, ret=-1
ping6: sendmsg: No route to host

The challenge I have had with Ubuntu is getting it to understand which interface to use, as described here.  I note that when the iMac pings a link local address, it resolves it and appends the interface name:

ping6 ubuntu.local
PING6(56=40+8+8 bytes) fe80::426c:8fff:fe1d:562e%en0 --> fe80::ba27:ebff:fe1a:74e5%en0
16 bytes from fe80::ba27:ebff:fe1a:74e5%en0, icmp_seq=0 hlim=64 time=0.699 ms

That seems to be a missing piece for Ubuntu. Yes, you can configure a static IPv6 address on both sides of the connection, but that completely defeats the purpose. I’ll continue to look for a way to get Ubuntu to work as a host and update once I figure it out. In the meantime, I’ve turned on IPv4 over DHCP in /etc/network/interfaces and that works on my local network

auto lo
iface lo inet loopback
allow-hotplug eth0
iface eth0 inet dhcp
iface eth0 inet6 auto

Just follow changes to the interfaces file with “sudo ifdown eth0; sudo ifup eth0”.

Leave a Reply