An IPv6 /64 holds 2^64 = 18,446,744,073,709,551,616 addresses: the first four groups name the subnet and the last four are each host’s interface ID. It’s the standard size for one LAN, VLAN or cloud subnet, because RFC 4291 makes unicast interface IDs 64 bits long and stateless address autoconfiguration (SLAAC, RFC 4862) builds each host’s address from one.
The numbers
Network 2001:db8:0:1::/64
First host 2001:db8:0:1::1
Last host 2001:db8:0:1:ffff:ffff:ffff:ffff
Addresses 18446744073709551616
Usable hosts 18446744073709551615
IPv6 has no broadcast address (RFC 4291 uses multicast instead), so nothing comes off the end. The first address, 2001:db8:0:1::, is reserved, so the tool counts 18,446,744,073,709,551,615 usable hosts, starting at 2001:db8:0:1::1.
How it fits
A /56 holds 256 /64s and a /48 holds 65,536. A LAN isn’t subnetted below /64, but a /64 does split into 9,223,372,036,854,775,808 /127s, the size RFC 6164 recommends for links between routers.
How hosts fill in the other 64 bits
With SLAAC, the router advertises the /64 and each host picks its own interface ID:
- Modified EUI-64 derives it from the MAC address:
08:00:27:4e:66:a1becomesa00:27ff:fe4e:66a1, withff:feinserted in the middle and the universal/local bit flipped, so08becomes0a. The tool below confirms2001:db8:0:1:a00:27ff:fe4e:66a1is inside the /64. - Stable privacy addresses (RFC 7217) and temporary addresses (RFC 8981) use IDs that don’t reveal the MAC; most current operating systems use one or both by default.
Gotchas
- Don’t make a LAN smaller than /64. On a /80 or a /112, hosts that rely on SLAAC get no global address. If a segment really must be smaller, use DHCPv6 or static addresses, but a /64 is almost always the better fix.
- The first address is reserved.
2001:db8:0:1::, the all-zeros interface ID, is the Subnet-Router anycast address (RFC 4291 section 2.6.1), so don’t give it to a host. The tool’s First host and Python’shosts()both start after it. - Platforms fix the size. Azure IPv6 subnets must be exactly /64. On Google Cloud a dual-stack subnet gets a /64 and each VM a /96 from it. Kubernetes gives each node a /64 of the IPv6 pod range by default (
--node-cidr-mask-size-ipv6=64).
In your stack
# Terraform: the second /64 of a /56, and its first host address
cidrsubnet("2001:db8::/56", 8, 1) # "2001:db8:0:1::/64"
cidrhost("2001:db8:0:1::/64", 1) # "2001:db8:0:1::1"
import ipaddress
lan = ipaddress.ip_network("2001:db8:0:1::/64")
lan.num_addresses # 18446744073709551616
ipaddress.ip_address("2001:db8:0:1:a00:27ff:fe4e:66a1") in lan # True
next(lan.hosts()) # IPv6Address('2001:db8:0:1::1')
# radvd.conf: advertise the /64 so hosts can use SLAAC
interface eth1 {
AdvSendAdvert on;
prefix 2001:db8:0:1::/64 {
AdvOnLink on;
AdvAutonomous on;
};
};