Question: I'm playing with IPv6 and converting it to IPv4 and vice-versa.
I wanted to access http://127.0.0.1/
And did the standard ipv4 to ipv6 calculation: AA = 127 BB = 0 CC = 0 DD = 1
with the schema
0000:0000:0000:0000:0000:ffff:AABB:CCDD
which got me:
0000:0000:0000:0000:0000:ffff:7F00:0001
so I tried
http://[:::::ffff:7F00:1]
But it didn't display anything. With a bit of googling, I found out that i need
http://[::1]/
to access the loopback interface with IPv6.
Now I wasn't too much surprised, since the loopback interface might be a special case. But then I tried to access my public file server at:
http://88.84.21.77/
Which I calculated the IPv6 address to be
http://[::ffff:5854:154d]/
But it did not resolve, too.
Now my question: Am I doing anything wrong with the conversion, or does it not work that way.
Or might that be because of my server or ISP not supporting IPv6 ? My server runs under Ubuntu 9.04, with all the necessary patches.
IPv6 is not just another way to write IPv4 addresses, and you cannot convert between them as you've done. A server that does speak v6 will have a v6 address that is quite different from its v4 address. For example the host
orange.kame.net
has the v4 address203.178.141.194
and the v6 address2001:200:dff:fff1:216:3eff:feb1:44d7
.To successfully use IPv6 you need either support for it from your ISP (unusual, unfortunately) or a device that does tunneling for you. The later is built in Windows 7, Mac OS X, and a few other OS:es.
Yes, absolutely. Either your ISP has to support IPv6 natively or you setup a 6in4 tunnel with one of the known tunnel brokers (e. g. http://tunnelbroker.net/).
The prefix you're trying to use (::ffff:0:0/96) is for IPv4 mapped addresses. It's an API mechanism that lets software open a single socket and accept IPv4 and IPv6 requests. On my IPv6-enabled hosts addresses in OpenSSH, vsftp and lighttpd are logged in that format, e.g.
You shouldn't see this prefix in any live traffic; it'll show up on the wire as IPv4. There is a similar prefix (::ffff:0:0:0/96, note the extra "0") that was proposed for a form of 6to4 translation. I don't know if it's in use. I haven't seen any "::ffff" addresses in any live network traffic.
As a couple of other people have pointed out, IPv6 isn't a backward-compatible superset of IPv4. This is one of the biggest complaints people have about it. You either run it independently by dual-stacking or tunneling, or you translate it.
I started experimenting with IPv6 by creating a tunnel. Once I was comfortable I dual-stacked my public facing servers. Luckily my hosting provider uses native IPv6.