Skip to content
Tape and Square

N-01 · Subnet · IPv6 /126

/126 IPv6 subnet

A /126 IPv6 prefix fixes the first 126 of 128 bits and leaves 2. Its size, how it splits, where it sits among the usual allocation sizes and the RFC rules that apply to it.

Short answer

Addresses
42 bits after the prefix
Fit in one /64
2^62Smaller than a /64 by 62 bits
Fit in one /48
2^78302,231,454,903,657,293,676,544

IPv6 has no broadcast address and all-zeros and all-ones are ordinary values (RFC 4291 §2), so all 4 addresses count. A /126 is longer than /64, so SLAAC doesn't work on it; RFC 6164 standardizes /127, not /126, for router links.

What a /126 holds

Longer prefixes inside one /126. Each extra bit halves the block.

PrefixIn one /126
/1272
/1284

Where a /126 sits

How many /126 blocks the larger sizes hold.

Block/126 blocks in it
::/0, all of IPv685,070,591,730,234,615,865,843,651,857,942,052,864 (2^126)
2000::/3, global unicast10,633,823,966,279,326,983,230,456,482,242,756,608 (2^123)
2001:db8::/3219,807,040,628,566,084,398,385,987,584 (2^94)
2001:db8:abcd::/48302,231,454,903,657,293,676,544 (2^78)
2001:db8:abcd:3400::/561,180,591,620,717,411,303,424 (2^70)
2001:db8:abcd:3412::/644,611,686,018,427,387,904 (2^62)

IANA assigns unicast space only from 2000::/3, which holds 10,633,823,966,279,326,983,230,456,482,242,756,608 (2^123) /126 blocks; the example blocks in the table are the ones around 2001:db8:abcd:3412:1e:5:a:7, all inside the documentation prefix 2001:db8::/32 (RFC 3849).

Rules for a /126

A /126 has 4 addresses. Its first is the Subnet-Router anycast address (RFC 4291 §2.6.1); Python's ipaddress module, for one, leaves that address out and counts the other three as hosts.

RFC 6164 standardizes /127, not /126, for point-to-point links between routers, and requires routers to turn off Subnet-Router anycast on a /127. RFC 7421 calls /127 the only documented exception to 64-bit interface identifiers, so a /126 is outside the current specifications, and SLAAC won't use it. A /64 holds 4,611,686,018,427,387,904 (2^62) /126 blocks.

Check an address

Pre-filled with 2001:db8:abcd:3412:1e:5:a:7/126. Change the address or the prefix.

/126

Also accepts 192.168.1.130 255.255.255.192, 192.168.1.0 60 hosts or IPv6 like 2001:db8::/48.

Result

2001:db8:abcd:3412:1e:5:a:4/126

4 addresses

First address
2001:db8:abcd:3412:1e:5:a:4
Last address
2001:db8:abcd:3412:1e:5:a:7
Prefix length
/126
Broadcast
None in IPv6

Longer than /64: SLAAC needs a /64, so devices here need addresses set by hand or by DHCPv6. IPv6 has no broadcast address; the first address is the subnet-router anycast address (RFC 4291).

DOCUMENTATION

Inside 2001:db8::/32, reserved for documentation and examples (RFC 3849). Not routed.

Hex view

Address
2001:0db8:abcd:3412:001e:0005:000a:0007
Network
2001:0db8:abcd:3412:001e:0005:000a:0004
Last
2001:0db8:abcd:3412:001e:0005:000a:0007

Each hex digit is 4 bits. Bold digits are fixed for the network; orange digits number the interfaces; the underlined digit is split between the two.

2001:db8:abcd:3412:1e:5:a:0/112 split into /126 · 16,384 blocks

  1. 2001:db8:abcd:3412:1e:5:a:4/126◂
  2. … 16,376 more

Worked example

Take 2001:db8:abcd:3412:1e:5:a:7/126, written out in full as 2001:0db8:abcd:3412:001e:0005:000a:0007. A /126 keeps 31 hex digits and 2 bits of the next one. That digit is 7 = 0111; keeping 2 bits gives 0100 = 4. The network is 2001:db8:abcd:3412:1e:5:a:4/126 and the last address 2001:db8:abcd:3412:1e:5:a:7.

The block holds 4 addresses. Its first address, 2001:db8:abcd:3412:1e:5:a:4, is the Subnet-Router anycast address for the prefix (RFC 4291 §2.6.1).

2001:db8:abcd:3412:1e:5:a:4/126 splits into 4 /128 single addresses. Every address in it:

#/128
12001:db8:abcd:3412:1e:5:a:4/128
22001:db8:abcd:3412:1e:5:a:5/128
32001:db8:abcd:3412:1e:5:a:6/128
42001:db8:abcd:3412:1e:5:a:7/128

References

  • RFC 4291, IP Version 6 Addressing Architecture: §2 (no broadcast), §2.3 (prefix notation), §2.6.1 (Subnet-Router anycast).
  • RFC 3849, IPv6 Address Prefix Reserved for Documentation: 2001:db8::/32.
  • RFC 5952, A Recommendation for IPv6 Address Text Representation.
  • RFC 4862, IPv6 Stateless Address Autoconfiguration, §5.5.3.
  • RFC 6164, Using 127-Bit IPv6 Prefixes on Inter-Router Links, with erratum 3422.
  • RFC 7421, Analysis of the 64-bit Boundary in IPv6 Addressing; RFC 7608 (BCP 198), prefix lengths in forwarding.

Other IPv6 prefixes