IPv6 Subnetting Without the Headache
Learn to split an IPv6 prefix into subnets by counting hex digits, with worked plans for a home and a small organization.
Key takeaways
- Give every LAN or VLAN a /64, because automatic address configuration depends on it.
- The number of subnets you can create is 2 raised to the difference between 64 and your prefix length.
- Splitting on multiples of four bits keeps every boundary on a whole hex digit, so you can read subnets by eye.
- Spend subnet bits on a scheme people can remember, since you have far more of them than you need.
IPv6 subnetting is mostly a matter of numbering. You receive a prefix from your provider, you give each network segment its own /64 out of it, and the digits between your prefix and the /64 boundary are yours to use as subnet numbers. With a /56 you get 256 subnets. With a /48 you get 65,536.
You rarely need to count hosts, compute odd masks or squeeze a segment into the smallest block that fits. If you have wrestled with IPv4 subnetting, the main skill is learning to stop doing most of it.
The address in two halves
An IPv6 address is 128 bits, written as eight groups of four hex digits. For ordinary LANs, think of it as two halves of 64 bits.
The left half is the network prefix. It says where the packet should be routed. The right half is the interface identifier, which picks one interface on that segment. Devices usually create their own interface identifiers, so you do not hand them out.
In that example the full prefix for one LAN is 2001:db8:abcd:1234::/64. The 2001:db8::/32 block used here is reserved for documentation. If zeros and double colons still slow you down, see how to read and shorten an IPv6 address.
Why /64 is the LAN size
IPv4 teaches you to size each subnet to its population. In IPv6, a segment with three devices and a segment with three thousand both get a /64.
The reason is practical. Stateless address autoconfiguration, usually called SLAAC, expects a 64-bit prefix so the device can supply the other 64 bits. Give a LAN a /80 and many devices will not configure an address at all. Privacy features and parts of Neighbor Discovery are also designed around that size. SLAAC and DHCPv6 shows the mechanism.
A /64 holds about 18 quintillion addresses, so nearly all of it stays empty. That is intended. The abundance is spent on simplicity.
There are two common exceptions, both for router infrastructure. Point-to-point links between routers are often configured as /127 (RFC 6164), and a router's loopback address is typically a /128, meaning a single address. Many organizations still reserve a whole /64 for each link and configure the /127 inside it, which keeps the plan tidy.
Counting subnets
The only formula you need is this: subnets available equals 2 to the power of (64 minus your prefix length).
| Your prefix | Subnet bits | Number of /64s | Hex digits you control |
|---|---|---|---|
| /64 | 0 | 1 | none |
| /60 | 4 | 16 | 1 |
| /56 | 8 | 256 | 2 |
| /52 | 12 | 4,096 | 3 |
| /48 | 16 | 65,536 | 4 |
Every row steps by four bits, and four bits is exactly one hex digit. That is called a nibble boundary, and it is the reason IPv6 subnetting can be done in your head.
Hypothetical example: the numbers are made up to show the method, not a quote or an average.
A home example
Say your provider delegates 2001:db8:abcd:1200::/56. The first two hex digits of the fourth group (12) are fixed. The last two are yours.
| Segment | Subnet ID | Prefix |
|---|---|---|
| Main LAN | 00 | 2001:db8:abcd:1200::/64 |
| Guest Wi-Fi | 01 | 2001:db8:abcd:1201::/64 |
| Smart home devices | 02 | 2001:db8:abcd:1202::/64 |
| Home lab | 10 | 2001:db8:abcd:1210::/64 |
You can leave gaps freely. Starting the lab at 10 leaves room for more everyday segments below it.
A home router typically obtains the delegation through DHCPv6 prefix delegation and assigns a /64 to each network it manages. Some consumer routers choose the subnet numbers for you, while others let you pick. If your provider delegates only a single /64, you have one subnet and cannot properly create a second. Some providers will delegate more if the router asks for it, so check the router's requested prefix size.
An organization example
Suppose you have 2001:db8:5000::/48. The whole fourth group, four hex digits, is yours. Give those digits meaning. One approach is to use the first digit for the site, the second for the function and the last two for the individual network.
2001:db8:5000: S F NN ::/64
| | |
| | +-- network number (00-ff)
| +----- function (0 staff, 1 voice, 2 guest, 3 servers)
+-------- site (1 head office, 2 warehouse) With that layout, 2001:db8:5000:1200::/64 is guest network 00 at head office, and 2001:db8:5000:2300::/64 is server network 00 at the warehouse.
The payoff appears in firewalls and routing:
-
2001:db8:5000:1000::/52covers everything at head office. -
2001:db8:5000:1200::/56covers all guest networks at head office.
One short rule can describe a whole group. That is route summarization, and a structured plan gives it to you for free.
The trade-off is that a meaningful scheme wastes numbers. You will never use all 256 voice networks at a warehouse. With 65,536 subnets that hardly matters at small scale. A large organization should estimate growth before assigning each digit.
Splitting between nibble boundaries
Sometimes you need a split such as /49 or /62. It works the same way, but the boundary falls inside a hex digit, so you have to think in binary for that one digit.
Splitting a /60 into four /62 blocks uses two bits of the final digit:
| Block | /64s inside (last digit) |
|---|---|
...:abc0::/62 | 0, 1, 2, 3 |
...:abc4::/62 | 4, 5, 6, 7 |
...:abc8::/62 | 8, 9, a, b |
...:abcc::/62 | c, d, e, f |
This is valid and routers handle it without complaint. People handle it less well, so use it only when the supply of subnets forces you to. A typical case is delegating a few /64s each to several downstream routers out of a small prefix.
Finding the boundaries of a block
Given any address and prefix length, you can find the block it belongs to by looking at hex digits. Each digit covers four bits, so a /48 ends after the third group, a /52 after one more digit, a /56 after two and a /60 after three.
Take 2001:db8:abcd:12f7::9. Its containing blocks are:
| Prefix length | Block | Digits of the fourth group kept |
|---|---|---|
| /48 | 2001:db8:abcd::/48 | none |
| /52 | 2001:db8:abcd:1000::/52 | 1 |
| /56 | 2001:db8:abcd:1200::/56 | 12 |
| /60 | 2001:db8:abcd:12f0::/60 | 12f |
| /64 | 2001:db8:abcd:12f7::/64 | 12f7 |
Keep the digits the prefix covers and set the rest to zero. There is no broadcast address to calculate and no usable range to subtract from. The block runs from all zeros to all f in the remaining positions, and every /64 inside it is a legitimate subnet.
This is also how you check a firewall rule. If a rule names 2001:db8:abcd:1200::/56, any /64 whose fourth group starts with 12 falls inside it, and 13a0 does not.
Stable addresses inside a subnet
Servers, printers and router interfaces benefit from predictable addresses. You can set them manually, using short interface identifiers such as ::1 for the router or ::53 for a DNS server. These are easy to remember and also easy to guess, so rely on a firewall and not on obscurity. DHCPv6 reservations are another option where your devices support DHCPv6, though some popular client systems rely on SLAAC alone.
A method for any new network
When you add a segment, follow the same short routine every time.
The record is the step people skip. A simple spreadsheet with columns for subnet ID, name, VLAN number and purpose is enough for a small organization. Matching the VLAN number to the subnet ID can help, as long as you decide whether you are writing it in hex or decimal. VLAN 20 written as subnet 20 is easy to read, even though hex 20 equals decimal 32. Pick one convention and write it at the top of the sheet.
Routing between your subnets
Subnets only help if something routes between them. The router holds one interface per /64, so it already knows how to reach each one. If you add a second router behind the first, the upstream device needs to know which block lives behind it. That can be a static route pointing the delegated block, for example a /60, at the downstream router's address, or it can happen automatically when the downstream router asks for its own prefix delegation and the upstream one supports serving it. Consumer equipment varies widely here, so check the manual before buying a second router for this purpose.
Plan for renumbering
Prefixes from residential providers can change. Anything that hard-codes a full global address may then break. Three habits reduce the pain:
- Refer to devices by name, and let DNS hold the addresses.
- Keep a record of subnet IDs separately from the provider prefix, since the IDs can stay the same after a change.
- Consider adding a unique local prefix (from
fd00::/8) for internal services that need an address that never changes. It should be generated randomly as RFC 4193 describes, then used alongside your global prefix.
Organizations that need permanence can ask their provider for a static delegation or look into provider-independent space from a regional internet registry.
Common mistakes
- Making LANs smaller than /64 to "save space". There is nothing worth saving, and autoconfiguration fails.
- Using one /64 for several VLANs. Each segment needs its own prefix so routers know where to send packets.
- Copying the IPv4 scheme digit for digit. It can help memory, but remember that hex digits read like decimal only if you are careful about what they mean.
- Writing prefixes with the wrong zeros.
2001:db8:abcd:12::/64means the fourth group is0012, not1200. Leading zeros in a group can be dropped, trailing zeros cannot. - Forgetting firewall rules for new segments. A new subnet needs the same policy attention as any other, including IPv6 filtering.
Check your work by writing the fourth group with all four digits before shortening it. Most errors become obvious once the zeros are visible.