IPv6 - IPv4-mapped IPv6 address
IPv4-mapped IPv6 addresses are a special type of IPv6 addresses used to represent an IPv4 address in an IPv6 format. This can be particularly useful in a dual-stack environment where both IPv4 and IPv6 are in use, and some form of intercommunication is necessary.
The syntax for an IPv4-mapped IPv6 address is ::FFFF:w.x.y.z
, where w.x.y.z
is the decimal representation of the IPv4 address. For example, the IPv4-mapped IPv6 address of 192.0.2.128
is ::FFFF:192.0.2.128
.
One key use of IPv4-mapped IPv6 addresses is when using both IPv4 and IPv6 in a BGP topology where MP-BGP is in use. Specifically, you can create an IPv4 adjacency and exchange IPv6 prefixes. This would result in a BGP table that looks something like this:
R1#show ip bgp ipv6 unicast BGP table version is 2, local router ID is 192.168.12.1 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, r RIB-failure, S Stale, m multipath, b backup-path, x best-external, f RT-Filter Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path *> 2001:DB8::1/128 :: 0 32768 i * 2001:DB8::2/128 ::FFFF:192.168.12.2 0 0 2 i
When exchanging IPv6 prefixes over an IPv4 peering link, the next hop address for IPv6 routes will be indicated using an IPv4-mapped IPv6 address as shown above. This is because the BGP session itself is established using IPv4, so the next hop for IPv6 routes must be represented in a form that’s compatible with the underlying IPv4 transport, hence the use of IPv4-mapped IPv6 addresses.
While useful for certain scenarios like the one described above, IPv4-mapped IPv6 addresses can also be a potential security concern. An attacker might attempt to bypass security policies by accessing IPv4 services via IPv6 using an IPv4-mapped address. Because of this, many systems allow IPv4-mapped IPv6 traffic to be disabled or filtered.
It's also worth noting that while IPv4-mapped IPv6 addresses can help with the transition to IPv6, they are not intended as a permanent solution or a replacement for full IPv6 connectivity. As more of the Internet moves to IPv6, the need for such transition technologies should decrease.
Links:
https://forum.networklessons.com/t/multiprotocol-bgp-mp-bgp-configuration/1177/72?u=lagapides
https://networklessons.com/bgp/multiprotocol-bgp-mp-bgp-configuration