IPv6 subnetting: prefix allocation, /64 and /127
Count addresses and subnets
A prefix /p fixes the first p bits of a 128-bit address. The block contains 2^(128−p) address values. A parent /p contains 2^(q−p) child /q blocks when p ≤ q ≤ 128. For a /48 split into /64, 16 bits select the subnet and 64 bits remain within each subnet. There are 65,536 child blocks, each with 18,446,744,073,709,551,616 address values. These are mathematical sizes, not guaranteed usable endpoint counts; do not subtract two as for conventional IPv4 LANs. Reserved addresses and implementation policies still apply.
Parent: 2001:db8:1200::/48First: 2001:db8:1200::/64Second: 2001:db8:1200:1::/64Last: 2001:db8:1200:ffff::/64Allocate aligned, disjoint networks
For an example office, assign one /64 each to staff, guests and services, leaving unused IDs for future growth. The fourth group selects the subnet in this /48. To find the /64 containing 2001:db8:1200:20::abcd, clear the last four groups to obtain 2001:db8:1200:20::/64. For prefixes not divisible by 16, inspect the partial group in binary: a /60 leaves the low four bits of the fourth group variable, so :20::/60 covers IDs 0x20 through 0x2f, not :20 through :35 in decimal. Two blocks overlap if their fixed prefix bits agree through the shorter prefix length.
Staff: 2001:db8:1200:10::/64Guests: 2001:db8:1200:20::/64Services: 2001:db8:1200:30::/64Choose prefix length by link purpose
/64 is the normal choice for Ethernet LANs using stateless address autoconfiguration (SLAAC): a router advertises a prefix and hosts form addresses using interface identifiers, which are not necessarily derived from MAC addresses. Hosts may use temporary privacy addresses to reduce long-term correlation; address lifetimes and OS policy vary. Prefix delegation lets an upstream router or provider delegate an entire prefix to a downstream router for its own subnets, rather than merely assigning a single address. A /127 can be appropriate for a supported point-to-point inter-router link; a /128 matches exactly one address in a route. Do not treat every link as /64 or put /127 on a typical SLAAC LAN. No address plan alone establishes firewall policy or routing.
Point-to-point: 2001:db8:1200:ff00::a/127Endpoints: 2001:db8:1200:ff00::a 2001:db8:1200:ff00::bHost route: 2001:db8:1200:ff00::a/128Check your allocation before using it
Given 2001:db8:abcd::/48, reserve a /56 for one site and allocate three /64s inside it. Check alignment, containment and pairwise non-overlap, and leave capacity for growth. Use exact integer arithmetic: floating-point numbers cannot represent every 128-bit integer. Do not advertise documentation prefixes or assume that a prefix is assigned to you. Next, inspect what an IPv6 packet carries.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
IPv6 subnetting: prefix allocation, /64 and /127 — knowledge check
Apply IPv6 concepts to fictional offline scenarios.
How many /64 networks fit in a /56?
Which is the final /64 inside 2001:db8:1200::/48?
Which prefix is typical for Ethernet SLAAC?
What are the two address values in 2001:db8:1200:ff00::a/127?
What does a delegated /56 give a downstream router?