/31 Subnet
2 host addresses — RFC 3021 P2P
A /31 (defined in RFC 3021) uses both addresses as host addresses — there is no network or broadcast address. This makes it more efficient than /30 for point-to-point links. Cisco IOS and many modern routers support /31 on interfaces.
Common Use Cases
- → Point-to-point link (more efficient than /30)
- → Router interface addressing with RFC 3021 support
- → BGP peering links
Example /31 Networks
| CIDR | Network | First Usable | Last Usable | Broadcast | Hosts |
|---|---|---|---|---|---|
| 10.0.0.0/31 | 10.0.0.0 | 10.0.0.0 | 10.0.0.1 | 10.0.0.1 | 2 |
| 172.16.0.0/31 | 172.16.0.0 | 172.16.0.0 | 172.16.0.1 | 172.16.0.1 | 2 |
| 172.31.0.0/31 | 172.31.0.0 | 172.31.0.0 | 172.31.0.1 | 172.31.0.1 | 2 |
| 192.168.0.0/31 | 192.168.0.0 | 192.168.0.0 | 192.168.0.1 | 192.168.0.1 | 2 |
| 192.168.1.0/31 | 192.168.1.0 | 192.168.1.0 | 192.168.1.1 | 192.168.1.1 | 2 |
| 10.0.1.0/31 | 10.0.1.0 | 10.0.1.0 | 10.0.1.1 | 10.0.1.1 | 2 |
How /31 Compares
| Prefix | Total IPs | Usable Hosts | Subnet Mask | Typical Use |
|---|---|---|---|---|
| /28 | 16 | 14 | 255.255.255.240 | AWS NAT/endpoint dedicated subnet |
| /29 | 8 | 6 | 255.255.255.248 | Tiny server cluster or infra segment |
| /30 | 4 | 2 | 255.255.255.252 | WAN point-to-point link |
| /31 ◀ | 2 | 2 | 255.255.255.254 | Modern P2P links (RFC 3021) |
| /32 | 1 | 1 | 255.255.255.255 | Single host — firewall rules, host routes |
Frequently Asked Questions
How many IPs are in a /31?
A /31 subnet contains 2 total IP addresses and 2 usable host addresses. RFC 3021 allows both addresses to be used as host addresses on point-to-point links.
What is the subnet mask for /31?
The subnet mask for a /31 is 255.255.255.254.
In CIDR notation, the prefix length /31 means
the first 31 bits of the address are the network portion.
The wildcard (inverse) mask is 0.0.0.1.
How many /31 subnets fit in a /30?
Exactly 2 — a /30 can be split into two /31 subnets of equal size. Each /31 subnet has 2 usable hosts, compared to 2 in the parent /30.