« The Mouse is Mightier... |  main  | The mouse that still had one button... »

IPv6 link-local addresses

Posted by dom on Thu Aug 04 08:14:47 +0200 2005

In IPv6 the link-local addresses are really link-local. What I mean by that is, that the addresses, like fe80::230:65ff:fe1b:f0ad are ambiguous. If you try to ping one of your local interfaces via ping6 and the IPv6 address reported by ifconfig of say, en0, it doesn’t work. You have to specify the link (interface) to which the address is local. In the case of en0 it is e.g. fe80::203:93ff:fe98:a624%en0 – for link-local addresses the interface is added with a % sign. So far so ugly. Nevertheless ping6 fe80::203:93ff:fe98:a624%en0 doesn’t work either. Because ping6 doesn’t understand this format. (Maybe this is something I should patch in darwin? ;-) ). What you have to do is specify the interface via the -I en0 option. Then everything works as expected.

Not so in telnet. In telnet the fe80::203:93ff:fe98:a624%en0 syntax works. And interestingly enough, if you look at my last post, then you could see that the IPv6 link-local addresses SubEthaEdit connected to didn’t start with fe80:: but with fe80:4::. The 4 is the number that ifconfig shows as scopeid. As far as I could find out up to now this is an internal implementation detail, and should not be using this.

Now to my final observations: When you use the % representation in an URL (as specified in RFC 2732 ) then things get ugly. You know, in an URL you have to escape % so, % becomes %25, so e.g. the address above translates into http://[fe80::203:93ff:fe98:a624%25en0]/. As ugly as it might get.

And one more thing: if you thought you could just change the interface name to mean the same computer on the other interface, then you’re wrong. You can’t. That would have been nice IMHO, but the design of IPv6 link-local addressing works by encoding the MAC-address of the interface into the address. And even more, as far as I understood the interface that is specified is the one on your local machine. So if you change en0 into en1 on a powerbook, then you ping the same remote interface, but with the former you try from your wired network, and with the latter you try from your airport interface.

If anyone can enlighten me some more on the subject, I’d be delighted to read / listen.

no responses to 'IPv6 link-local addresses'

write a comment.... (textile enabled)