- A /31 has two addresses and both are usable on point-to-point links (RFC 3021).
- A /31 has no network address and no broadcast address.
- A /32 is exactly one address, used for loopbacks and host routes.
- The IPv6 equivalent of a /31 link is a /127 (RFC 6164).
Network, host range, broadcast, mask and wildcard for any IPv4 block
The old rule and why it breaks
The usual formula for usable hosts is 2host bits − 2. The two subtracted addresses are the network address (all host bits 0) and the broadcast address (all host bits 1). Apply it to a /31, which has one host bit, and you get 2 − 2 = 0. Apply it to a /32 and you get 1 − 2, which makes no sense at all.
The formula assumes a subnet with many hosts that need a broadcast. A link between exactly two routers does not need one: there is only one other device to talk to.
What RFC 3021 changed
RFC 3021, published in December 2000, defines how to use 31-bit prefixes on point-to-point links. On a /31 there is no network address and no broadcast address. Both addresses are ordinary host addresses, one for each end of the link.
| Prefix | Addresses | Usable | Network | Broadcast |
|---|---|---|---|---|
| /30 | 4 | 2 | Yes | Yes |
| /31 | 2 | 2 | No | No |
| /32 | 1 | 1 | No | No |
The saving is real. A /30 spends four addresses to number two interfaces, and a /31 spends two. On a backbone with hundreds of links, /31 halves the address space used for links.
Configuring a /31
Each router takes one of the two addresses. For 10.0.0.0/31:
! Router A (Cisco IOS) interface GigabitEthernet0/0 ip address 10.0.0.0 255.255.255.254 ! Router B (Junos) set interfaces ge-0/0/0 unit 0 family inet address 10.0.0.1/31
Most current router operating systems accept /31 addresses on point-to-point links. Some platforms limit them to certain interface types or print a warning on broadcast media such as Ethernet, so check your platform's documentation before rolling them out.
Where /32 is used
A /32 identifies a single address. It never describes a LAN, but it is everywhere in routing and security:
- Loopback interfaces. Routers use a /32 loopback as a stable router ID and as the source for management and BGP sessions.
- Host routes. A /32 route sends traffic for one address somewhere specific, such as a load balancer VIP or an anycast service.
- Firewall and ACL rules.
203.0.113.10/32orhost 203.0.113.10matches one machine. - Cloud security groups. Allowing SSH from
your-ip/32is the common way to limit access to one address.
IPv6: /127 and /128
IPv6 has no broadcast at all, so the question is simpler. RFC 6164 recommends /127 for router-to-router links, which gives two addresses, one per side. A /128 is a single address, used the same way as an IPv4 /32. The IPv6 calculator shows /127 as two addresses.
Why calculators disagree
Several popular subnet calculators still show 0 usable hosts for /31 and /32, or refuse those prefixes entirely. They apply the minus-two rule to every prefix. Our calculator follows RFC 3021: a /31 shows 2 usable addresses with no broadcast, and a /32 shows 1. If you are answering an older exam question that expects the classic answer, note that the question is testing the formula rather than modern practice.
Sources
- RFC 3021: Using 31-Bit Prefixes on IPv4 Point-to-Point Links
- RFC 6164: Using 127-Bit IPv6 Prefixes on Inter-Router Links
- RFC 950: Internet Standard Subnetting Procedure