跳到正文
ipaddress.tr

IPv4 转 IPv6

IPv4 地址无法“转换”为 IPv6,但有标准方法在 IPv6 中表示它。

IPv4 映射 IPv6
::ffff:192.0.2.33
::ffff:c000:221
6to4 前缀
2002:c000:221::/48
NAT64 (64:ff9b::/96)
64:ff9b::192.0.2.33
64:ff9b::c000:221

此内容尚无中文(中国)版本。在发布译文之前以英语显示。

There is no way to “convert” an IPv4 address into an IPv6 address — they are separate address spaces. What does exist are standard representations of IPv4 addresses inside IPv6:

  • IPv4-mapped ::ffff:0:0/96 — how dual-stack software represents an IPv4 peer on an IPv6 socket. These never appear on the wire.
  • 6to4 2002::/16 — a deprecated transition mechanism that derived a /48 from a public IPv4 address.
  • NAT64 64:ff9b::/96 — the well-known prefix IPv6-only networks use to reach IPv4 hosts through a NAT64 gateway, usually together with DNS64.

常见问题

Can I convert my IPv4 address to IPv6?

No. Your IPv6 address is assigned separately by your provider. The forms shown here only embed an IPv4 address in IPv6 notation for specific mechanisms.

Why do I see ::ffff: addresses in my server logs?

Your server listens on an IPv6 socket that also accepts IPv4. IPv4 clients then appear as IPv4-mapped addresses such as ::ffff:203.0.113.5.

Is 6to4 still used?

Rarely. RFC 7526 deprecated the 6to4 anycast relay prefix in 2015; native IPv6 has replaced it.