{"id":40,"date":"2010-12-17T20:41:32","date_gmt":"2010-12-17T20:41:32","guid":{"rendered":"http:\/\/blogs.gentoo.org\/eva\/?p=40"},"modified":"2023-07-31T07:05:19","modified_gmt":"2023-07-31T07:05:19","slug":"things-you-didnt-known-about-ipv6-link-local-address","status":"publish","type":"post","link":"https:\/\/blogs.gentoo.org\/eva\/2010\/12\/17\/things-you-didnt-known-about-ipv6-link-local-address\/","title":{"rendered":"Things you didn&#8217;t known about IPv6 link-local address"},"content":{"rendered":"<p>I regained interest in trying IPv6 at home since my ISP provides the option to switch to IPv6 (also some might say it&#8217;s not IPv6 to the end user as it is intended in IPv6 design documents). But before ticking the appropriate box on the router interface, I wanted to give a shot at serverless network configuration.<\/p>\n<p>I&#8217;m running ftp, nfs, afp, ntp, http, smtp, imap and some other servers at home and as I have a couple of machines to run that on, I soon needed a dns and a ldap server for good measure. For reasons I won&#8217;t detail, I wanted to give a shot at dns-less (bind) network but still keep name resolution with mdns (avahi, yay auto-discovery of services).<\/p>\n<p>Now to get back to IPv6, I&#8217;ve seen MacOS X do a couple of things out of the box with link-local addresses and naive as I am at times, I thought GNU\/Linux would do the same. I&#8217;ve had IPv6 enabled for a long time in my kernels but never managed to ping others machines without starting a dhcp v6 server (radvd). So digging a bit, I soon discovered that basic tools you find on a GNU\/Linux system are <em><strong>useless<\/strong><\/em> with link-local address. Take ping6 for example, you want to ping a host you have the address of so you type:<br \/>\n<code><br \/>\n$ ping6 fe80::21b:63ff:feab:e6a6<br \/>\nconnect: Invalid argument<br \/>\n<\/code><\/p>\n<p>Meh ??? It&#8217;s a valid address, WTF is it telling me. Google to the rescue, you have to specify the network interface you want to use to send the packet. It&#8217;s ok ping6 has a -I parameter that allows you to select the one you want, and you also find that there is a weird syntax that allows you to do that inline:<br \/>\n<code><br \/>\n$ ping6 -I eth0 fe80::21b:63ff:feab:e6a6<br \/>\nPING fe80::21b:63ff:feab:e6a6%eth0(fe80::21b:63ff:feab:e6a6) 56 data bytes<br \/>\n64 bytes from fe80::21b:63ff:feab:e6a6: icmp_seq=1 ttl=64 time=0.041 ms<br \/>\n$ ping6 fe80::21b:63ff:feab:e6a6%eth0<br \/>\nPING fe80::21b:63ff:feab:e6a6%eth0(fe80::21b:63ff:feab:e6a6) 56 data bytes<br \/>\n64 bytes from fe80::21b:63ff:feab:e6a6: icmp_seq=1 ttl=64 time=0.041 ms<br \/>\n<\/code><\/p>\n<p>You&#8217;re all happy now that you sent your first ping over IPv6, now since avahi tells the local world about this machine&#8217;s address, you want to try using it&#8217;s hostname:<br \/>\n<code><br \/>\n$ ping6 -I eth0 shinobu.local<br \/>\nPING shinobu.local(shinobu.local) from fe80::21b:63ff:feab:e6a6 eth0: 56 data bytes<br \/>\n64 bytes from shinobu.local: icmp_seq=1 ttl=64 time=0.377 ms<br \/>\n$ ping6 shinobu.local%eth0<br \/>\nunknown host<br \/>\n<\/code><\/p>\n<p>Hu ho, what&#8217;s going on here. This post is getting way longer than I expected so let&#8217;s jump to the conclusion.<\/p>\n<p>I have found no trick to make a program know about the network interface I want to use when using hostnames so if you want to use ssh or wget that don&#8217;t have a way to specify the network interface you&#8217;re screwed. Ho yes, there is a solution, you can write wrapper scripts that will resolve the address for you and rewrite the command with the address%iface format, but that&#8217;s crazy. Os X seems to do this just fine, how come free software can&#8217;t ? (this is a rethorical question in case you wonder).<\/p>\n<p>Finally, having a dhcp v6 server providing a global scope address solves these issues but to the cost of having a device to run it on. A device you depend on and that must be online all the time. Say good bye to auto-discovery, etc on your network.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I regained interest in trying IPv6 at home since my ISP provides the option to switch to IPv6 (also some might say it&#8217;s not IPv6 to the end user as it is intended in IPv6 design documents). But before ticking the appropriate box on the router interface, I wanted to give a shot at serverless &hellip; <a href=\"https:\/\/blogs.gentoo.org\/eva\/2010\/12\/17\/things-you-didnt-known-about-ipv6-link-local-address\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Things you didn&#8217;t known about IPv6 link-local address<\/span><\/a><\/p>\n","protected":false},"author":73,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[3],"tags":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/blogs.gentoo.org\/eva\/wp-json\/wp\/v2\/posts\/40"}],"collection":[{"href":"https:\/\/blogs.gentoo.org\/eva\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.gentoo.org\/eva\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.gentoo.org\/eva\/wp-json\/wp\/v2\/users\/73"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.gentoo.org\/eva\/wp-json\/wp\/v2\/comments?post=40"}],"version-history":[{"count":4,"href":"https:\/\/blogs.gentoo.org\/eva\/wp-json\/wp\/v2\/posts\/40\/revisions"}],"predecessor-version":[{"id":74,"href":"https:\/\/blogs.gentoo.org\/eva\/wp-json\/wp\/v2\/posts\/40\/revisions\/74"}],"wp:attachment":[{"href":"https:\/\/blogs.gentoo.org\/eva\/wp-json\/wp\/v2\/media?parent=40"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/eva\/wp-json\/wp\/v2\/categories?post=40"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/eva\/wp-json\/wp\/v2\/tags?post=40"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}