Main Contents

IPv6 with Bonjour/Zeroconf in Ubuntu

January 6, 2009

I’ve decided that 2009 is the year I go IPv6, so I’ve been getting all my machines ready. The Macs were no problem, of course: they work with IPv6 without doing anything. Linux is more problematic.

Ubuntu 8.10 and up support IPv6, but come with it turned off in places. The first place is /etc/avahi/avahi-daemon.conf where the line

use-ipv6=no

needs to be changed to

use-ipv6=yes

The second place is /etc/nsswitch.conf where the hosts line should read

hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4 mdns

After doing this, you should find that you can ping6 -I eth0 macname.local and have it work.

However, your regular IPv4 ping may have stopped working; mine did. It seems that Avahi doesn’t always advertise both protocol versions by default. So you need to go into all your Avahi service definition files in /etc/avahi/services and make sure that the <service> element explicitly identifies which protocols should be advertised as supported. For example:

&lt;?xml version="1.0" standalone='no'?&gt;
&lt;!DOCTYPE service-group SYSTEM "avahi-service.dtd"&gt;
&lt;service-group&gt;
&lt;name&gt;hostname-goes-here&lt;/name&gt;
&lt;service protocol="any"&gt;
&lt;type&gt;_ssh._tcp&lt;/type&gt;
&lt;port&gt;22&lt;/port&gt;
&lt;host-name&gt;whatever.local&lt;/host-name&gt;
&lt;/service&gt;
&lt;/service-group&gt;

One exception is netatalk, which doesn’t appear to support IPv6 at all yet. For that service, you’ll want to use &lt;service protocol="ipv4"&gt;

A few other application notes:

LigHTTPd requires server.use-ipv6 = “enable” in lighthttpd.conf.

OpenSSH has no way to specify interface, so your Avahi IPv6 addresses won’t work.

Filed under: Linux, Macintosh, System administration | Comments (0)

Leave a comment

Login