Mapping IPv4 IP range in CIDR notation to IPv6

Viewed 386

I want to convert an IPv4 range in CIDR notation to IPv6. Apart from prefixing them with "::ffff:", is it just a matter of adding 96 to the number of network bits? E.g.

1.2.3.4/32 -> ::ffff:1.2.3.4/128
1.2.3.0/24 -> ::ffff:1.2.3.0/112

Is there more to it than this? I haven't found a library method or a web tool that does this that I can check against.

1 Answers

Yep, that's pretty much it. This is how IPv4 addresses and prefixes are represented in an IPv6 application.

Related