Linux – Why add an IPv6 address as /64

ipv6linuxnetworking

In many tutorials I see examples to add an IPv6 address on Linux like

ip -6 addr add 2001:0db8:0:f101::1/64 dev eth0

Since an IPv6 address has 128 bits and this is only supposed to add a single IP, why is it done /64 and not /128 ?

Best Answer

The IPv6 addressing architecture (RFC4291) requires all unicast addresses always have a prefix length of 64 bits. Using something other than a /64 will break a number of IPv6 features such as neighbor discovery, secure neighbor discovery (SEND), privacy extensions, mobile IPv6, embedded-RP (multicast), etc.

The current IPv6 address assignment guidelines call for allocating a /64 only when it is known that one and only one subnet is needed, otherwise a /56 should be allocated to small sites that are "expected to need only a few subnets over the next 5 years", or a /48 for larger sites. (ARIN policy 6.5.4.1)

A number of free tunnel brokers currently offer /48s. You could easily set up 65,536 globally routed /64s at home right now if you wanted to. (e.g. Hurricane Electric will give anyone a /48)

If that seems wasteful, consider that there are over 16 million times as many /48s possible as IPv4 /24s. And twice as many /48s as there are square centimeters of landmass on the earth. (2.8✕1014 versus 1.4✕1014 cm2).