IPv6 Address – Use-Case of Including IPv4 Address

ip addressipv6

It is possible to include the IPv4 address into IPv6 address. For example, 2001:db8::c0a8:6301 where last 32 bits are IPv4 address 192.168.99.1. There is even a special notation of IPv6 address where last 32 bits are in dot-decimal notation. Example from Juniper router:

root@mx> show configuration interfaces ge-0/0/0 unit 0 family inet6
address 2001:db8::192.168.99.1/64;

root@mx> 

Under which circumstances it makes sense to include the IPv4 address into IPv6 address? Has anyone seen this in practice?

Best Answer

There are some common use cases:

  • ::ffff:192.168.0.1

    This is used in software that uses IPv6 sockets even for handling IPv4 connections. That makes it easier to write software because everything looks like IPv6.

  • 64:ff9b::192.168.0.1

    This is the NAT64 well-known-prefix. These addresses are NATed to IPv4 by a NAT64 gateway. It is used to let devices that only have IPv6 reach IPv4 destinations.

It can be used with other prefixes as well. For example not all NAT64 gateways use the well-known-prefix. And there are other protocols that embed IPv4 addresses in IPv6 addresses or prefixes. The two mentioned above are the most common though.