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?

up vote 12 down vote accepted

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.

  • 7
    Then there are the network admins who manually assign IPv6 addresses that have the host-part equal to the host's IPv4 address.... – Michael Hampton Nov 9 at 16:14
  • Thanks! Is there a valid use-case to manually assign IPv6 addresses that have the host-part equal to the hosts IPv4 address? I can clearly see a benefit of using the penultimate byte of the IPv4 address in IPv6 address network portion(this works only in case of /24 IPv4 networks), but I hardly see a benefit of putting the IPv4 address into host-portion of the IPv6 address. Even if there are multiple IPv4 addresses on the interface(for example 192.0.2.22/24 and 192.0.2.25/24) and same amount of IPv6 addresses are needed, then it would make sense to take those from the beginning of the network. – Martin Nov 9 at 17:21
  • 1
    @Martin They're usually assigned as extra addresses, and it's so that SSH to the IP address is easier to remember. – chrylis Nov 9 at 18:22
  • 1
    I can think of four other cases of IPv4 addresses embedded in IPv6 addresses, but none of them good candidates for using this notation. ::192.168.0.1 is an example that would usually be written using this notation, but that prefix is deprecated. 6to4 gateways and Teredo server addresses have their IPv4 address embedded in IPv6 addresses, but not in the last 32 bits, so those are not candidates for this notation. Teredo client addresses are embedded in the last 32 bits, but the bits are negated so it would just be confusing to use this notation for those. Are there any other examples? – kasperd Nov 9 at 23:04
  • 2
    @Martin The only real "benefit" is to free up space in the admin's head, but this purpose is better served by DNS, and of course the drawbacks of manual addressing are even more pronounced in IPv6 than IPv4. – Michael Hampton Nov 9 at 23:36

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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