On Thu, Jan 19, 2012 at 10:00 AM, Michael Mol <[email protected]> wrote: > On Thu, Jan 19, 2012 at 10:46 AM, Paul Hartman > <[email protected]> wrote: >> On Thu, Jan 19, 2012 at 8:43 AM, Grant Edwards >> <[email protected]> wrote: >>> How do you specify a link-local ipv6 address in /etc/hosts? >>> >>> For example, I can ping/telnet/ssh to fe80::02c0:4eff:fe07:0005%eth1, >>> but I can't figure out how to put that address in /etc/hosts so I can >>> access it by name. >> >> Just put the address without the %iface. Then you must specify the >> interface in your program, for example: >> >> in /etc/hosts: >> fe80::02c0:4eff:fe07:0005 foobar >> >> ping6 -I eth0 foobar >> >> should work. > > Works here with ping6. Sucks, though, because most network clients > don't allow you to specify the interface, so those won't work.
Yeah, the real solution is like Felix suggests, to use site-local (or global) addresses instead of link-local. >>> Similarly, how do you enter an ipv6 link-local address in Firefox or >>> Opera? curl seems to accept such an address and return the proper web >>> page, but I can't find any interactive browser (graphical or >>> command-line) that will accept a link-local address. So far I've >>> tried Firefox Opera w3m links. According to RFC2732 it looks like the >>> format should be >>> >>> http://[fe80::02c0:4eff:fe07:0005%eth1]:80/ >> >> % in a URL must be escaped, so you probably need to replace the % >> symbol with %25. Try this: >> >> http://[fe80::02c0:4eff:fe07:0005%25eth1]:80/ >> >> I didn't try it. Good luck. :) >> > > Doesn't seem to work with wget. Don't have a GUI web browser on IPv6 > to play with here. I know MSIE on Windows does (since version 7-ish) and I think wget from Busybox does, other browsers/programs are hit and miss... According to RFC 3986: "A host identified by an IPv6 literal address is represented inside the square brackets without a preceding version flag. The ABNF provided here is a translation of the text definition of an IPv6 literal address provided in [RFC3513]. This syntax does not support IPv6 scoped addressing zone identifiers." Key being the last sentence. :) So, some browsers support that syntax, but it's not required. So I would not depend on that feature existing. Best to avoid using those addresses for web stuff if you can help it.

