Accessing non-port80 web server using IPv6

Solution 1:

First of all: I am no IPv6 expert.

If you cannot add a DNS name (or want to ensure IPv6 is used1), then why not use the actual address, rather than the fe80 link-local one? On a Mac with OS X, and on Windows XP Home edition, this (with an actual IPv6 address2) works fine for me, in all browsers:

http://[2001:db8::216:cbff:xx:xx]:8080/

(Note that some browsers do not automatically prefix the http:// part for IPv6 addresses. Adding a dummy name in your hosts file for only the IPv6 address makes life even easier.)

For fe80 addresses, it's probably not just the port number that is giving you problems; when using the default port 80, you probably cannot connect either, unless you also specify the zone index. (Thus: the outgoing interface that should make the connection, like wired ethernet or wireless, which might be different on each computer you use.)

On Windows XP Home edition, with both wired ethernet and wireless (the latter being inactive), the following works fine for me in Firefox 3.5 and 3.6. Here, 4 is my network interface index3:

http://[fe80::216:cbff:xx:xx%4]/
http://[fe80::216:cbff:xx:xx%4]:8080/

In Internet Explorer 8, the percent character must be percent-encoded into %25:

http://[fe80::216:cbff:xx:xx%254]:8080/

(For me, this does not work without the %4 or %254; if it does on other installations then maybe Windows or IE prefers external connections, and that installation only has a single network interface?)

On a Mac, the following works fine in Firefox:

http://[fe80::216:cbff:xx:xx%en0]:8080/

Specifying a zone index using the percent notation is troublesome, given the conflict with URL notations4. I could not get the above to work in Chrome 8 and 9 on Windows XP, nor in Safari or Chrome on a Mac.

On a Mac, instead of the % syntax, you can (ab)use the scope index (the 2nd word, or 3rd and 4th bytes) to specify the network interface index. Like fe80:0004 works fine in all my browsers:

http://[fe80:4::216:cbff:xx:xx]/
http://[fe80:4::216:cbff:xx:xx]:8080/

Note, however, that I doubt this is officially supported, as this does not work on my Windows XP, and some documentation claims that alternatives should always be used instead. Like:

ping6 -I en0 fe80::216:cbff:xx:xx  (en0 = wired ethernet on my Mac)
ping6 fe80::216:cbff:xx:xx%en1     (en1 = wireless)

...rather than:

ping6 fe80:4::216:cbff:xx:xx
ping6 fe80:6::216:cbff:xx:xx

Final note: one might be fooled into using :: or ::ffff: followed by an IPv4 address, as specified in RFC 4291. But, this does not actually use IPv6, though it gives a response on my Mac:

http://[::ffff:192.168.178.25]:8080/

This can also use a hexadecimal notation, and some browsers will rewrite it automatically:

http://[::ffff:c0a8:b219]:8080/

But no matter what: this uses an IPv4 connection on my Macs. On my Macs, [::192.168.178.25] does not work. I could not get any form to work on Windows XP.


1 Some browsers prefer IPv4 over IPv6. See test-ipv6.com. This also is platform dependent.
2 In IPv6, web servers might see the MAC address of your computer, being 216:cbff:xx:xx in these examples. I'd rather not publish this super cookie on the net. See also How to avoid exposing my MAC address when using IPv6?
3 On a Mac: look for the value for scopeid in the output of ifconfig. On Windows: see the value for Idx in the output of netsh interface ipv6 show interface. I have seen this number change after reboots!
4 It seems this once led to an RFC which never made it out of draft. This draft proposes to use the plus-character instead, but this does not work on my Macs or Windows XP either.