By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,793 Members | 1,257 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,793 IT Pros & Developers. It's quick & easy.

Convert IPv4 to IPv6

P: n/a
Hi,

is there a straight forward way of converting IPv4 to IPv6?

I thought that it was just a matter of converting 32 bits to 128 bits, (by
adding 96 leading 0s), but that does not seem right in some/most cases.

For example, 127.0.0.1, (IPv4 localhost), does not convert ::1, (IPv6
localhost)

so, is there a function/script/technique to convert IPv4 to IPv6?

Thanks

Simon

Aug 13 '08 #1
Share this Question
Share on Google+
14 Replies


P: n/a
I don't know the math as I don't deal with networking anymore. You
could try splitting IP4 into it's octets and apply the math like that
then reassemble.

Aug 13 '08 #2

P: n/a
..oO(Simon)
>is there a straight forward way of converting IPv4 to IPv6?
Have a look at the IPv6 RFC and/or its Wikipedia entry. IIRC there's an
address range reserved for mapping the old IPv4 addresses.
>I thought that it was just a matter of converting 32 bits to 128 bits, (by
adding 96 leading 0s), but that does not seem right in some/most cases.
It's a totally different numbering system.

Micha
Aug 13 '08 #3

P: n/a
>
>>is there a straight forward way of converting IPv4 to IPv6?

Have a look at the IPv6 RFC and/or its Wikipedia entry. IIRC there's an
address range reserved for mapping the old IPv4 addresses.
Yes, I had a look at it, and my impression was that IPv6 was the successor
of IPv4 so 32bits had been reserved to allow for backward compatibilities.
>
>>I thought that it was just a matter of converting 32 bits to 128 bits, (by
adding 96 leading 0s), but that does not seem right in some/most cases.

It's a totally different numbering system.
I wouldn't go as far as asying 'totally'.

127.0.0.1 -01111111.00000000.00000000.00000001 ->
0111111100000000:0000000000000001 - 7f00:0001
Micha
Simon

Aug 13 '08 #4

P: n/a
>I don't know the math as I don't deal with networking anymore. You
could try splitting IP4 into it's octets and apply the math like that
then reassemble.
That was my first impression.
But given that the range 127.0.0.0/8 is reserved for loopback and ::1 does
fall within the range 127.0.0.0/8.
it makes me think that the conversion is not as straight forward as I would
have thought, (as 127.0.0.1 is ::7f00:1)

Simon

Aug 13 '08 #5

P: n/a
..oO(Simon)
>>>is there a straight forward way of converting IPv4 to IPv6?

Have a look at the IPv6 RFC and/or its Wikipedia entry. IIRC there's an
address range reserved for mapping the old IPv4 addresses.

Yes, I had a look at it, and my impression was that IPv6 was the successor
of IPv4 so 32bits had been reserved to allow for backward compatibilities.
Reserving 32 bits would drastically reduce the address space. But the
range ::ffff:0:0/96 seems to be reserved for the old IPv4 addresses. It
shouldn't be too difficult to do the mapping.

http://en.wikipedia.org/wiki/IPv4_mapped_address
>>>I thought that it was just a matter of converting 32 bits to 128 bits, (by
adding 96 leading 0s), but that does not seem right in some/most cases.

It's a totally different numbering system.

I wouldn't go as far as asying 'totally'.

127.0.0.1 -01111111.00000000.00000000.00000001 ->
0111111100000000:0000000000000001 - 7f00:0001
Sure, but in IPv6 the loopback device is ::1, which has nothing to do
with 127.0.0.1 or 7f00:0001 (which is not even valid IPv6, BTW). The
same applies to the old local addresses like 192.168.x.y for example.

Micha
Aug 13 '08 #6

P: n/a
On Wed, 13 Aug 2008 22:00:28 +0200, Michael Fesser wrote:
.oO(Simon)
>>>>is there a straight forward way of converting IPv4 to IPv6?

Have a look at the IPv6 RFC and/or its Wikipedia entry. IIRC there's
an address range reserved for mapping the old IPv4 addresses.

Yes, I had a look at it, and my impression was that IPv6 was the
successor of IPv4 so 32bits had been reserved to allow for backward
compatibilities.

Reserving 32 bits would drastically reduce the address space. But the
range ::ffff:0:0/96 seems to be reserved for the old IPv4 addresses. It
shouldn't be too difficult to do the mapping.

http://en.wikipedia.org/wiki/IPv4_mapped_address
>>>>I thought that it was just a matter of converting 32 bits to 128 bits,
(by adding 96 leading 0s), but that does not seem right in some/most
cases.

It's a totally different numbering system.

I wouldn't go as far as asying 'totally'.

127.0.0.1 -01111111.00000000.00000000.00000001 ->
0111111100000000:0000000000000001 - 7f00:0001

Sure, but in IPv6 the loopback device is ::1, which has nothing to do
with 127.0.0.1 or 7f00:0001 (which is not even valid IPv6, BTW). The
same applies to the old local addresses like 192.168.x.y for example.
Things that are different aren't the same.

--
I told you this was going to happen.

Aug 13 '08 #7

P: n/a
>>
>Sure, but in IPv6 the loopback device is ::1, which has nothing to do
with 127.0.0.1 or 7f00:0001 (which is not even valid IPv6, BTW). The
same applies to the old local addresses like 192.168.x.y for example.

Things that are different aren't the same.
???

Simon
Aug 13 '08 #8

P: n/a
>>>>is there a straight forward way of converting IPv4 to IPv6?
>>>
Have a look at the IPv6 RFC and/or its Wikipedia entry. IIRC there's an
address range reserved for mapping the old IPv4 addresses.

Yes, I had a look at it, and my impression was that IPv6 was the successor
of IPv4 so 32bits had been reserved to allow for backward compatibilities.

Reserving 32 bits would drastically reduce the address space. But the
range ::ffff:0:0/96 seems to be reserved for the old IPv4 addresses. It
shouldn't be too difficult to do the mapping.

http://en.wikipedia.org/wiki/IPv4_mapped_address
yeah, but some source say that the notation has been deprecated.
in fact my Vista picks up ping ::7f00:1 as ping 127.0.0.1
but it does the same for ping ::ffff:7f00:1
>>
127.0.0.1 -01111111.00000000.00000000.00000001 ->
0111111100000000:0000000000000001 - 7f00:0001

Sure, but in IPv6 the loopback device is ::1, which has nothing to do
with 127.0.0.1 or 7f00:0001 (which is not even valid IPv6, BTW). The
same applies to the old local addresses like 192.168.x.y for example.
Si was converting as an example from decimal to binary and so forth, and
there were only 32 bits in my example not 128,
So the whole thing was not really going to be valid IPv6.
Micha
Simon

Aug 13 '08 #9

P: n/a
..oO(Simon)
>Reserving 32 bits would drastically reduce the address space. But the
range ::ffff:0:0/96 seems to be reserved for the old IPv4 addresses. It
shouldn't be too difficult to do the mapping.

http://en.wikipedia.org/wiki/IPv4_mapped_address

yeah, but some source say that the notation has been deprecated.
in fact my Vista picks up ping ::7f00:1 as ping 127.0.0.1
but it does the same for ping ::ffff:7f00:1
According to RFC 4291 the first version is deprecated.

http://tools.ietf.org/html/rfc4291#section-2.5.5

Micha
Aug 13 '08 #10

P: n/a
On Wed, 13 Aug 2008 23:23:23 +0200, Simon wrote:

>>Sure, but in IPv6 the loopback device is ::1, which has nothing to do
with 127.0.0.1 or 7f00:0001 (which is not even valid IPv6, BTW). The
same applies to the old local addresses like 192.168.x.y for example.

Things that are different aren't the same.

???

Simon
There is no correlation between the special addresses or ranges in IPv4
and IPv6 so I'm not sure how there could be a meaningful mathematical
conversion.
--
I told you this was going to happen.

Aug 13 '08 #11

P: n/a
>>
>???

Simon

There is no correlation between the special addresses or ranges in Ivy
and Ivy so I'm not sure how there could be a meaningful mathematical
conversion.
You are mistaken, room was made for Ivy in Ivy, they are not poles apart.
Look at some of the links given in this thread.

Simon
Aug 13 '08 #12

P: n/a
>>Reserving 32 bits would drastically reduce the address space. But the
range ::ffff:0:0/96 seems to be reserved for the old IPv4 addresses. It
shouldn't be too difficult to do the mapping.

http://en.wikipedia.org/wiki/IPv4_mapped_address

yeah, but some source say that the notation has been deprecated.
in fact my Vista picks up ping ::7f00:1 as ping 127.0.0.1
but it does the same for ping ::ffff:7f00:1

According to RFC 4291 the first version is deprecated.

http://tools.ietf.org/html/rfc4291#section-2.5.5
Thanks for the links,
that should keep me going for now.
>
Micha
Simon
Aug 13 '08 #13

P: n/a
On Thu, 14 Aug 2008 00:58:04 +0200, Simon wrote:

>There is no correlation between the special addresses or ranges in Ivy
and Ivy so I'm not sure how there could be a meaningful mathematical
conversion.
You are mistaken, room was made for Ivy in Ivy, they are not poles
apart. Look at some of the links given in this thread.
Pardon... that should have said "If".

It seems odd that googling for the bitwise equation yields nothing of
value.

--
I told you this was going to happen.

Aug 14 '08 #14

P: n/a
>
>>There is no correlation between the special addresses or ranges in Ivy
and Ivy so I'm not sure how there could be a meaningful mathematical
conversion.
You are mistaken, room was made for Ivy in Ivy, they are not poles
apart. Look at some of the links given in this thread.

Pardon... that should have said "If".
'If' what?
What are you talking about?

You clearly don't know what you are talking about and you think that giving
some semi-cryptic replies will make me think you do.
So, as I said, have a look at some of the pages given in this thread and you
might learn something.
>
It seems odd that googling for the bitwise equation yields nothing of
value.
No it does not seem odd, you probably did something wrong, I am not also
going to teach you how to use Google as well.
Tell me what terms you used and I might be able to help you.

Otherwise I am tired of guessing what you are trying to say.

Simon

Aug 14 '08 #15

This discussion thread is closed

Replies have been disabled for this discussion.