将IPv4转换为IPv6 [英] Convert IPv4 to IPv6

查看:967
本文介绍了将IPv4转换为IPv6的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




是否有将IPv4转换为IPv6的直接方式?


我认为这只是一个问题将32位转换为128位,(通过

添加96个前导0),但在某些/大多数情况下这似乎不正确。


例如, 127.0.0.1,(IPv4 localhost),不转换:: 1,(IPv6

localhost)


所以,是否有函数/脚本/技术将IPv4转换为IPv6?


谢谢


Simon

解决方案

我不知道数学,因为我不再处理网络问题了。你可以尝试将IP4分成它的八位字节然后应用数学,然后重新组装。


..oO(西蒙)


>是否有将IPv4转换为IPv6的直接方式?



查看IPv6 RFC和/或其Wikipedia条目。 IIRC有一个

地址范围,用于映射旧的IPv4地址。


>我认为这只是一个问题将32位转换为128位(通过添加96个前导0),但在某些/大多数情况下这似乎不正确。



这是一个完全不同的编号系统。


Micha


>


>>是否有将IPv4转换为IPv6的直接方式?



查看IPv6 RFC和/或其Wikipedia条目。 IIRC有一个

地址范围,用于映射旧的IPv4地址。



是的,我看过它,我的印象是IPv6是IPv4的继承者

所以32位保留给允许向后兼容。


>


>>我认为这只是将32位转换为128位的问题,(通过添加96个前导0),但是在某些/大多数情况下似乎不对。



这是一个完全不同的编号系统。



我不会完全忘掉''完全''。


127.0.0.1 -01111111.00000000。 00000000.00000001 - >

0111111100000000:0000000000000001 - 7f00:0001


Micha



Simon


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

解决方案

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.


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


>

>>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


这篇关于将IPv4转换为IPv6的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆