# How do I compare IPv6 prefixes when the addresses use double-colon compression?

Exam: 200-301 — Implementing and Administering Cisco Solutions
Knowledge domain: Network Fundamentals
Updated: 2026-11-25T05:30:51.22836+00:00
HTML: https://learningpathx.com/faq/200-301/ccna200301-ipv6-compression-prefix-compare.html

## Also asked as

- How do I tell whether compressed IPv6 addresses share a prefix?
- How does expanding compressed IPv6 notation help identify the network prefix?

Expand each IPv6 address to eight groups of four hexadecimal digits, then compare the number of leading bits given by the prefix length. A double colon replaces one continuous run of zero groups and may appear only once per address. Leading zeros within each group are also optional.

For example, `2001:db8:10:20::5/64` expands to `2001:0db8:0010:0020:0000:0000:0000:0005/64`. A /64 covers the first four complete groups, so the network prefix is `2001:db8:10:20::/64`. The address `2001:db8:10:21::5` is outside that prefix. If a prefix cuts through a hexadecimal digit, compare only the leading bits of that digit that fall inside the prefix. On many IPv6 LANs, /64 is used for Stateless Address Autoconfiguration (SLAAC). Use the actual configured prefix when verifying a link.

**References**

* [RFC 4291 on IPv6 addressing](https://www.rfc-editor.org/rfc/rfc4291.html)
* [Cisco Catalyst 9300 IOS XE 17.15.x IPv6 guide](https://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst9300/software/release/17-15/configuration_guide/rtng/b_1715_rtng_9300_cg/configuring_ipv6_unicast_routing.html)

Source: [IPv6 Addressing, Prefixes, and Address Types](https://learningpathx.com/news/ipv6-addressing-prefixes-and-address-types.html)
