Skip to main content

IPv4 guide

How to Identify an IPv6 Prefix and Prefix Length

How-to-Identify-an-IPv6-Prefix-thumbnail-ilease

IPv6 prefix: the short answer

An IPv6 prefix is the leftmost part of an address selected by its prefix length. In CIDR notation, the decimal number after the slash is the prefix length. For 2001:db8:1234:5678:abcd:ef01:2345:6789/64, the first 64 bits identify the subnet prefix, so the corresponding network prefix is 2001:db8:1234:5678::/64.

Do not count written zeros, hextets, or characters to discover a prefix length. IPv6 text can compress consecutive zero fields with ::, and leading zeros inside a field can be omitted. The prefix length must come from the slash notation or trusted interface, router, address-management, Router Advertisement, or DHCPv6 Prefix Delegation configuration.

IPv6 address, prefix length, and network prefix

An IPv6 address contains 128 bits and identifies an interface. A prefix length says how many contiguous bits, starting at the left, belong to the prefix. The bits after that boundary remain part of the interface address. These related terms answer different questions.

IPv6 terms that should not be treated as interchangeable
TermExampleWhat it tells you
Interface address2001:db8:1234:5678:abcd:ef01:2345:6789One 128-bit address assigned to an interface; by itself it does not state a prefix boundary.
Address with prefix length2001:db8:1234:5678:abcd:ef01:2345:6789/64The address plus a 64-bit boundary supplied by configuration.
Subnet prefix2001:db8:1234:5678::/64The first 64 bits retained and the remaining bits set to zero for the network notation.
Delegated prefix2001:db8:1234:5600::/56A larger prefix a provider or upstream router delegates so a downstream router can create subnets.

RFC 4291 defines the form ipv6-address/prefix-length: the length is a decimal value for the leftmost contiguous prefix bits. RFC 5952 recommends one canonical way to write an IPv6 address, but text compression never changes the 128-bit value or reveals a missing prefix length.

How do you calculate the IPv6 network prefix?

  1. Obtain the prefix length. Read the number after / or the trusted configuration field. If the source shows only an address, stop: the boundary is missing.
  2. Expand the address conceptually. IPv6 has eight 16-bit hexadecimal fields. You do not need to write all 128 binary digits, but you must account for every compressed field.
  3. Keep the leftmost prefix bits. Preserve exactly the number of bits named by the prefix length.
  4. Set all remaining bits to zero. Then write the result with the same slash length, using normal IPv6 compression.
  5. Validate against the source of truth. Compare the result with the interface, route, Router Advertisement, DHCPv6-PD lease, or IP address management record that supplied the boundary.

For the address 2001:db8:1234:56ab:abcd:ef01:2345:6789/56, the first 56 bits end after the first two hexadecimal digits of the fourth field. Keep 2001:0db8:1234:56, zero the remaining eight bits of that field and all later fields, and write the network as 2001:db8:1234:5600::/56.

A non-hextet boundary works the same way. For a /60, the first 12 bits of the fourth field belong to the prefix and its final four bits must be zero in the network notation. An IPv6-aware calculator or standard library can reduce transcription risk, but its input still needs the correct prefix length.

How to find the IPv6 prefix length on a device

Operating systems normally report an interface address together with a prefix length. Choose the active interface and distinguish global, unique-local, link-local, temporary, and deprecated addresses. The presence of an IPv6 address does not prove that a router received a larger delegated prefix.

  • Windows PowerShell: run Get-NetIPAddress -AddressFamily IPv6 | Format-Table InterfaceAlias,IPAddress,PrefixLength,AddressState. The PrefixLength field belongs to each listed interface address. Microsoft documents the cmdlet and its IPv6 address-family filter.
  • Windows command prompt: ipconfig /all can display IPv6 addresses and connection details, but PowerShell exposes the prefix length more directly. Do not infer the prefix from the number of written address fields.
  • Linux: run ip -6 address show. An entry such as inet6 2001:db8:1234:5678::20/64 scope global includes the slash length. Confirm the interface, scope, and address state.
  • macOS: run ifconfig and read the active interface's inet6 entries and prefixlen value. The command ipconfig getifaddr en0 queries an IPv4 address and is not an IPv6-prefix test.
  • Android or iOS: network details may show one or more IPv6 addresses but may omit the prefix length or upstream delegation. If the boundary is not shown, use the managed device profile, router, or provider configuration instead of guessing.

Interface prefix vs delegated IPv6 prefix

A host usually learns an on-link prefix through Router Advertisements or receives address configuration through an operating-system or network-management mechanism. A customer-edge router may separately receive a larger prefix through DHCPv6 Prefix Delegation. The router can then divide that delegated space into prefixes for downstream links.

A host address does not reveal the larger prefix delegated to the router. Seeing 2001:db8:1234:5601::25/64 on a laptop establishes the configured /64 for that interface. It does not prove whether the router received a /56, a /48, several unrelated prefixes, or no delegated prefix at all. Inspect the router's WAN or prefix-delegation status and preserve the delegated prefix, preferred lifetime, valid lifetime, and source.

RFC 8415 defines the IA_PD mechanism used to carry delegated prefixes. An IA_NA address assignment and an IA_PD prefix delegation are separate objects; do not substitute one for the other in an address plan.

What do common IPv6 prefix lengths mean?

IPv6 prefix lengths can range from /0 through /128. A /64 is the normal boundary for many general-purpose IPv6 LANs and is important to common Stateless Address Autoconfiguration behavior, but it is not the minimum legal IPv6 prefix length. Allocation and delegation sizes depend on registry, provider, architecture, and link requirements.

Common IPv6 lengths and the question each one answers
LengthTypical roleImportant boundary
/48An end-site or organizational allocation in some policies and designsNot guaranteed for every customer; verify the provider or registry policy and the actual delegation.
/56A delegated site prefix that can contain 256 distinct /64 subnetsThe router must show that the prefix was delegated; one host address cannot prove it.
/64A common general-purpose IPv6 subnet with a 64-bit interface-identifier fieldDo not describe it as IPv6's minimum prefix or assume every special link uses it.
/127A prefix used in documented point-to-point router-link designsApply the operational guidance for that link type; it is not a general LAN substitute.
/128One exact IPv6 address, often in a host route or loopback contextIt identifies no additional addresses and does not describe a delegated network.

RFC 7421 explains why the 64-bit boundary is deeply embedded in IPv6 architecture. Treat /64 as a strong default for ordinary host subnets while still following the current standard and product requirements for the specific link.

Validate the prefix before using it

  • Confirm the address, slash length, interface, scope, and source at the same observation time.
  • Check that the calculated network contains the address and that host bits are zero in the network notation.
  • Distinguish fe80::/10 link-local addresses from global or unique-local addresses; link-local reachability stops at the link.
  • Expect one interface to have multiple IPv6 addresses. Stable, temporary, link-local, and deprecated addresses can coexist and may share a subnet prefix.
  • Compare Router Advertisement information and installed routes with the intended subnet. An address can remain configured while a route or lifetime changes.
  • For delegated space, inspect the router's DHCPv6-PD state rather than a downstream host. Record renewals and lifetimes so an address plan does not outlive the delegation.
  • Use RFC 5952 canonical text when storing or comparing addresses, while accepting other valid input forms.

Common IPv6 prefix mistakes

  • Counting zeros: written zeros depend on compression and have no relationship to the prefix length.
  • Using the number of hextets: a compressed address can omit several zero fields, and boundaries such as /56 can end inside a 16-bit field.
  • Treating every address as global: link-local, unique-local, multicast, loopback, and global addresses have different scopes and uses.
  • Confusing an address with a delegation: the /64 shown on a client does not reveal the site's upstream /56 or /48.
  • Reading a DNS AAAA record as a subnet: an AAAA record publishes an address, not its interface prefix length, route, or delegated range.
  • Assuming text order proves ownership or reachability: a syntactically valid prefix still needs authorized allocation, routing, security policy, and lifecycle checks.

Plan IPv4 and IPv6 as separate resources

An IPv6 prefix does not provide IPv4 reachability, and an IPv4 block does not define an IPv6 plan. For dual-stack services, record each address family, prefix, route, DNS record, security control, monitoring path, and rollback separately. Test clients that have both families, only IPv6, and only IPv4 rather than assuming one successful path proves the other.

If a service still needs public IPv4 capacity alongside IPv6, define the exact endpoint count, prefix filters, routing model, geography, term, and continuity requirements before reviewing managed IPv4 leasing. The IPv4 and IPv6 comparison explains why deployment is usually coexistence rather than a one-step replacement.

IPv6 prefix FAQ

What is an IPv6 prefix?

An IPv6 prefix is the leftmost contiguous part of an address identified by a prefix length. In 2001:db8:1234:5678::/64, the slash value says that the first 64 bits form the prefix.

How do I find an IPv6 prefix length?

Read the slash value attached to the address or the prefix-length field in trusted interface, router, Router Advertisement, DHCPv6-PD, or address-management configuration. You cannot derive a missing length by counting zeros or hexadecimal fields.

Can I identify a delegated IPv6 prefix from one address?

No. An interface address and its on-link length do not disclose the larger prefix, if any, delegated to the router. Inspect the router or provider's DHCPv6-PD and allocation records.

Is every IPv6 subnet a /64?

No. A /64 is the normal choice for many general-purpose host subnets and supports common SLAAC behavior, but IPv6 permits other lengths and some special links use them. Follow the applicable standard and product requirements.

What does /128 mean in IPv6?

A /128 selects all 128 bits, so it identifies one exact address. It is commonly seen in host routes or loopback contexts and does not represent a pool of addresses.

Can two IPv6 addresses have the same prefix?

Yes. If their leftmost bits match for the configured length, they belong to the same prefix. One interface can also hold multiple addresses in that prefix, including temporary and stable addresses.

Primary standards and platform source

Tags

  • #ipv6