Why /64? Interface identifiers and the subnet boundary
Explain the 64-bit interface identifier rule of RFC 4291 and its exceptions. Predict what breaks when a LAN uses a prefix longer than /64. Evaluate the host address availability recommendations of RFC 7934 and choose how hosts get their addresses. Size a network in /64s and round the result to a nibble boundary.
Take the quiz · pass mark 70% · 10 questions
Explanation
Coming from IPv4, a /64 for every LAN looks wasteful. A LAN with 30 hosts "only needs" a /123. This lesson explains why IPv6 LANs still use /64, where the rule comes from, and the few places where other lengths are correct.
The rule
RFC 4291 (section 2.5.1) says that for all unicast addresses, except those starting with binary 000, interface identifiers (IIDs) are 64 bits long. With 128-bit addresses, that leaves 64 bits for the subnet prefix. RFC 7136 later clarified that the IID is an opaque value: nobody should read meaning into its bits (for example the old "u" and "g" bits of Modified EUI-64), but the length rule stays.
Drawing diagram…
The prefix length is not baked into routers: forwarding works on any length (L2.05 covers RFC 7608). The 64-bit rule is about hosts on a LAN and the protocols that build addresses.
What depends on the 64-bit IID
RFC 7421 analysed the 64-bit boundary in detail. The main dependencies are:
- SLAAC. RFC 4862 forms an address from the advertised prefix plus an IID, and the prefix length plus the IID length must equal 128. The IID length is defined per link type. For Ethernet it is 64 bits (RFC 2464). A host that receives a Prefix Information Option with the A flag set and a /72 prefix ignores it for autoconfiguration. Linux does this silently; a "prefix with wrong length" message appears only if kernel debug logging is enabled.
- Privacy and stable addresses. Stable opaque IIDs (RFC 7217, recommended by RFC 8064 instead of MAC-based IIDs) and temporary addresses produce 64-bit IIDs.
- Hosts without DHCPv6 address assignment. Some operating systems (notably Android) do not support stateful DHCPv6 addresses at all. On a LAN without SLAAC they get no global address.
- Other protocols that assume a /64: Cryptographically Generated Addresses (RFC 3972), unicast-prefix-based multicast addresses (RFC 3306) and embedded-RP multicast (RFC 3956) all assume the prefix is at most 64 bits.
- Implementations. RFC 7421 also notes that some devices handle prefixes between /65 and /126 badly, and that operators and code often assume /64.
"But it wastes addresses"
The bits to the right of /64 are not "wasted" in any way that matters. The scarce resource is prefixes, not addresses, and prefixes are plentiful:
- A /48 holds 65,536 /64 LANs, and a /56 holds 256. This is more than almost any site will use.
- A full /64 has 2^64 = 18,446,744,073,709,551,616 addresses. At one million probes per second, scanning it takes about 585,000 years. Sparse addresses make blind scanning of a LAN impractical, which is a security advantage that a /120 gives away.
The real costs of a large subnet are layer-2 issues: Neighbor Discovery cache exhaustion and broadcast domain size. You solve those with router protections (Level 5) and by limiting the number of hosts per VLAN, not by making the prefix longer.
Host address availability (RFC 7934)
Modern hosts use several addresses per prefix: a stable address, one or more temporary addresses, and addresses for containers, VMs or tethering. RFC 7934 (BCP 204) recommends that networks:
- give general-purpose hosts multiple addresses from each prefix, with no hard limit, and in particular not just one address per prefix;
- let hosts form new addresses without asking each time, either with SLAAC or by giving each host its own /64. A /64 per host can be delivered with DHCPv6 prefix delegation, a VLAN per device, or the "unique prefix per host" approach of RFC 8273.
For an ISP or hosting provider this is a design choice:
| Approach | Good for | Watch out for |
|---|---|---|
| Shared /64 with SLAAC | Office LANs, Wi-Fi, homes | ND cache size, rogue RAs, and many addresses per host to log |
| DHCPv6 IA_NA only | Environments that need a lease log | Breaks Android and limits hosts to the addresses the server gives |
| /64 per host or per VM | Hosting (one routed /64 per VPS), shared Wi-Fi, mobile | Uses more prefixes, so plan the space (L2.04, L2.05) |
In the ictNetworks scenario, each Proxmox VPS gets its own routed /64. The customer can then run SLAAC for containers or add as many addresses as they like, and abuse handling can block or rate-limit one prefix without touching other customers.
The exceptions
Lengths other than /64 are correct in a few specific places:
- /127 on point-to-point links between routers (RFC 6164). No hosts, no SLAAC, and it avoids an ND exhaustion attack on the link. You still reserve a /64 for each link in the plan (L2.05).
- /128 for loopbacks, service addresses and anycast addresses on a single node.
- Prefixes shorter than /64 for routing and aggregation, such as a /56 summary route.
- Addresses starting with binary
000(for example::ffff:0:0/96IPv4-mapped addresses) are outside the rule.
On a LAN with hosts, use /64. If you think you need something else on a LAN, you have almost certainly been given too little space, and the fix is to ask for more (RFC 6177).
Worked examples
Example 1: Addresses in a /64
2^64 = 18,446,744,073,709,551,616. Scanning at 10^6 probes per second takes 2^64 / 10^6 seconds, which is about 584,542 years ("about 585,000 years").
Example 2: A /72 advertised on a LAN
A router advertises 2001:db8:3000:2::/72 with A=1 and L=1. A Linux host computes 128 − 72 = 56 bits for the IID. Ethernet requires 64, so the host ignores the prefix for SLAAC. Because L=1, it still installs an on-link route for the /72, but it gets no address from it.
Example 3: Sizing a data centre
A data centre needs 2,000 VLANs, each a /64. 2^10 = 1,024 is too small and 2^11 = 2,048 is enough, so it needs 11 bits: a /53. Rounded to the next nibble boundary (a shorter prefix, which gives more space) that becomes a /52, with 4,096 /64s and room to grow.
Example 4: VPS capacity
A Proxmox cluster has a /48 and gives one routed /64 to each VPS. It can serve 2^16 = 65,536 VPSs. A /56 would serve only 256.
Lab
Goal: See for yourself what hosts do with a /64 and with a /72 prefix.
You need: Linux with root, iproute2, radvd (apt install radvd) and optionally tcpdump or Wireshark. The lab uses network namespaces from L1.03 and the course block 2001:db8:3000::/44.
Step 1: Build a router and a host
sudo ip netns add r1; sudo ip netns add h1
sudo ip link add veth-r type veth peer name veth-h
sudo ip link set veth-r netns r1; sudo ip link set veth-h netns h1
sudo ip -n r1 link set veth-r up; sudo ip -n h1 link set veth-h up
sudo ip -n r1 addr add 2001:db8:3000:1::1/64 dev veth-r
sudo ip netns exec r1 sysctl -w net.ipv6.conf.all.forwarding=1
sudo ip netns exec h1 sysctl -w net.ipv6.conf.veth-h.accept_ra=2
Step 2: Advertise two prefixes
Create /tmp/radvd-r1.conf:
interface veth-r {
AdvSendAdvert on;
MinRtrAdvInterval 3;
MaxRtrAdvInterval 10;
prefix 2001:db8:3000:1::/64 { AdvOnLink on; AdvAutonomous on; };
prefix 2001:db8:3000:2::/72 { AdvOnLink on; AdvAutonomous on; };
};
Start it with sudo ip netns exec r1 radvd -C /tmp/radvd-r1.conf -n -m stderr -p /tmp/radvd-r1.pid and note any warnings that radvd prints about the /72.
Step 3: Observe the host
sudo ip -n h1 -6 addr show dev veth-h
sudo ip -n h1 -6 route show
# optional: make the kernel explain itself (needs debugfs and dynamic debug)
echo 'file net/ipv6/addrconf.c +p' | sudo tee /sys/kernel/debug/dynamic_debug/control
sudo dmesg | tail -20
Record which prefix produced an address and which prefixes have on-link routes. If you enabled dynamic debug, look for the "prefix with wrong length 72" message.
Step 4: Try it with DHCPv6 instead
Optional: run Kea or dnsmasq in r1 to hand out an address from the /72 with stateful DHCPv6, and set the RA M flag. Show that the host gets a /128 address from the /72 this way, then explain why that still fails for an Android phone and why RFC 7934 recommends against one-address-per-host designs.
What to submit
The host's addresses and routes, the kernel debug line if you enabled it, and a paragraph that explains the result using RFC 4862 and RFC 2464.
Summary
- RFC 4291 makes interface identifiers 64 bits for unicast addresses not starting with
000. RFC 7136 says IIDs are opaque. - SLAAC needs prefix + IID = 128, with a 64-bit IID on Ethernet (RFC 2464). Hosts ignore a /72 for SLAAC, and hosts without DHCPv6 address support get no global address. Several other protocols also assume /64 (RFC 7421).
- Prefixes, not addresses, are the resource to manage. A /48 holds 65,536 /64s, and a sparse /64 resists scanning.
- RFC 7934: give hosts many addresses without per-address requests, using SLAAC or a /64 per host (for example a routed /64 per VPS).
- Exceptions: /127 router links (RFC 6164) with a /64 reserved per link, /128 loopbacks, and shorter prefixes for aggregation.
- Next lesson (L2.04): putting it all together in an addressing plan.
Quiz imported · 10 questions · pass mark 70%. Lab questions are not auto-marked.