GUIDE

IPv6 Subnetting Explained: Prefix Lengths, /64 and a CIDR Chart

An IPv6 prefix length tells you how many bits identify the network and how many are left for subnets and interfaces. This guide explains the /64 convention, shows how many subnets fit in each common prefix size, and walks through address ranges and notation, with the counts checked against the IPv6 Subnet Calculator.

Short answer: an IPv6 address has 128 bits. A prefix of n bits identifies the network, and the remaining 128 − n bits identify the interface. Ordinary subnets are /64, so the useful question is how many /64s a block holds: 264 − n. A /48 holds 65,536 /64 subnets. A /36 holds 4,096 /48s or 268,435,456 /64s.

Jump to: How a prefix works · CIDR chart · Worked example · Address ranges · Notation · Sizing a block

How an IPv6 prefix works

An IPv6 address is 128 bits, written as eight 16-bit groups in hexadecimal. A prefix such as 2001:db8::/32 fixes the first 32 bits; the number after the slash says how many bits are fixed. The IPv6 addressing architecture (RFC 4291) divides a unicast address into n bits of subnet prefix followed by 128 − n bits of interface identifier.

For all unicast addresses except those that start with the binary value 000, RFC 4291 requires interface identifiers to be 64 bits long. That is why a normal subnet, such as a LAN, is a /64. RFC 7136 later updated RFC 4291, clarifying that the universal/group bits of an interface identifier are significant only when it is derived from an IEEE link-layer address; the 64-bit length is what matters for subnetting. Routing itself is not limited to /64: RFC 7421, an analysis of the 64-bit boundary, notes that all IPv6 routing protocols support prefixes of any length up to /128, and it names one documented exception to 64-bit identifiers: the 127-bit prefixes that RFC 6164 standardises for inter-router links.

Rule of thumb: do not subnet an ordinary LAN below /64. RFC 7421 says that, given the design of stateless address autoconfiguration, an interface identifier shorter than 64 bits with a subnet prefix longer than 64 bits is outside the current IPv6 specifications, so results may vary.

IPv6 CIDR chart: how many subnets fit in each prefix

Each bit you add to the prefix halves the block, and each bit you remove doubles it. A /n block holds 264 − n /64 subnets, and, when n is 48 or less, 248 − n /48 blocks.

Prefix/64 subnets/48 blocks
/324,294,967,29665,536
/36268,435,4564,096
/4016,777,216256
/441,048,57616
/4865,5361
/524,096—
/56256—
/6016—
/641—
  • /48: traditionally the per-site assignment. RFC 3177 argued for /48 in most cases, and RFC 6177 obsoleted that recommendation.
  • /64: the standard subnet size: 64 bits of network and 64 bits of interface identifier.

These counts use the same calculation as the IPv6 Subnet Calculator, which also splits any prefix into subnets and shows the range of each one.

Worked example: splitting 2001:db8::/32

2001:db8::/32 is the prefix reserved for documentation (RFC 3849), so it is safe to use in examples; RFC 9637 later reserved 3fff::/20 as an additional documentation prefix. It contains 65,536 /48 blocks. The first is 2001:db8::/48, the second is 2001:db8:1::/48, and the last is 2001:db8:ffff::/48.

Each /48 in turn contains 65,536 /64 subnets. For 2001:db8::/48 they run from 2001:db8::/64, then 2001:db8:0:1::/64, up to 2001:db8:0:ffff::/64.

Finding the range of a prefix

The first address of a prefix is its network address, with every host bit set to zero. The last address has every host bit set to one. For 2001:db8:abcd::/48, the range runs from 2001:db8:abcd:: to 2001:db8:abcd:ffff:ffff:ffff:ffff:ffff.

Prefixes that stop in the middle of a hexadecimal group are where mistakes happen. In 2001:db8::/36 only the first hexadecimal digit of the third group is fixed (here it is 0), so the range runs from 2001:db8:: to 2001:db8:fff:ffff:ffff:ffff:ffff:ffff, and the last /48 inside it is 2001:db8:fff::/48. The IPv6 Subnet Calculator shows the range and the binary boundary for any prefix you enter.

Writing addresses the standard way

RFC 5952 recommends a single canonical text form. Leading zeros in each 16-bit field are omitted, and a single zero field is written as 0. The longest run of zero fields is replaced by ::, and :: is not used for just one zero field. When two runs tie, the first one is shortened. Hexadecimal letters are lowercase. So 2001:0DB8:0000:0000:0000:0000:0000:0001 is written 2001:db8::1, and 2001:db8:0:0:1:0:0:1 is written 2001:db8::1:0:0:1.

Sizing a block: why "/36" has no single answer

From the chart, a /36 is 4,096 /48s or 268,435,456 /64s. How a provider or registry hands out space is a policy decision that the prefix length does not tell you. RFC 6177, which obsoletes the /48-in-most-cases recommendation of RFC 3177, says that a one-size-fits-all recommendation of /48 is not nuanced enough for the broad range of end sites and is no longer recommended as a single default.

To size a plan, choose the smallest unit you need to assign and count the sub-blocks: 2(new prefix − old prefix). A /36 split into /56s gives 1,048,576 blocks; split into /48s, 4,096; split into /64s, 268,435,456.

Related

References

Last reviewed: . The counts and examples are calculated, not quoted. The rule of thumb about not subnetting a LAN below /64 and the sizing method are this site's own editorial notes, based on the RFCs listed above.

Relevant, Not Routine

New tools and anything else worth knowing — sent occasionally, only when there's something real to say.