Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
add comment

3 Answers 3

up vote 5 down vote accepted

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 address 203.178.141.194 and the v6 address 2001: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.

share|improve this answer
    
Sure, it's 128 bit vs. 32 bit. But if that's true, which it looks like it is, how can IPv6 interoperate with IP v4? That means it completely breaks backwards compatibility. And if that's true, why the ff: xy combination from IPv4 to IPv6 ? It's pointless. –  Quandary Aug 22 '10 at 14:22
    
How can I get to orange.kame.net from 2001:200:dff:fff1:216:3eff:feb1:44d7 in my browser? –  Lazer Aug 22 '10 at 19:05
1  
@Quandary There is no backwards compatibility. The notation you describe if for local sockets and suchlike, and has nothing to do with communication between IPv4 and IPv6 stacks (which is impossible, without someone translating in between). –  Jakob Borg Aug 23 '10 at 9:05
    
@Lazer You make sure you have working IPv6, that your browser hasn't specifically disabled it, and you simply surf there. :) –  Jakob Borg Aug 23 '10 at 9:06
add comment

Or might that be because of my server or ISP not supporting IPv6 ?

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/).

share|improve this answer
add comment

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.

auth.log.0:Aug 20 07:01:18 my_host sshd[19411]: refused connect from ::ffff:60.190.31.214 (::ffff:60.190.31.214)

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.