Skip to content

/31 subnet: point-to-point links under RFC 3021

Runs in your browser — nothing you paste leaves this page. How we prove that

Subnet Calculator playground

Examples

IPv4 or IPv6, with or without a prefix — 10.0.0.0/8, 2001:db8::/48, or a dotted netmask like 192.168.1.0 255.255.255.0. A bare address means one host (/32 or /128).

Results update as you type — press Enter to run now.

fig. 10 — subnet-calculator · networking /31 — 2 usable hosts (RFC 3021)
Result
IPv410.0.0.0/31
Usable hosts2Point-to-point — RFC 3021
Usable range10.0.0.0 – 10.0.0.1
Total addresses2

Addressing

Network address
10.0.0.0
Last address
10.0.0.1
Usable host range
10.0.0.0 – 10.0.0.1

Masks

Netmask
255.255.255.254
Wildcard maskInverse of the netmask — the match form Cisco ACLs and OSPF expect.
0.0.0.1
Netmask (binary)The mask bit by bit — the 1s are the network part.
11111111.11111111.11111111.11111110

Details

Address type
Private (RFC 1918)
Network (integer)The network address as a single 32-bit number, as scripts and databases store it.
167 772 160

A /31 has netmask 255.255.255.254 and exactly 2 addresses, and both are usable. RFC 3021 defines it for point-to-point links, where a network and broadcast address serve no purpose.

Why the minus-two rule does not apply

With one host bit, mask 255.255.255.254 and wildcard 0.0.0.1, the block is only two addresses. Applied blindly, the 2^n − 2 formula gives zero hosts. RFC 3021 (2000) observed that a link with exactly two endpoints never needs to broadcast to "everyone else", so it drops the network and broadcast reservations for /31.

In 10.0.0.0/31 the two ends are 10.0.0.0 and 10.0.0.1. The calculator labels 10.0.0.1 as the last address rather than a broadcast, because a /31 has none.

Where /31 is used

Router-to-router links in data-centre fabrics and ISP backbones: a leaf-spine network can have thousands of links, and /31 halves the address space they consume compared with /30. Cisco IOS, Juniper Junos, Arista EOS and the Linux kernel support it.

Do not use a /31 on a segment with more than two devices, or where one end is a host OS or appliance that treats the lower address as the network and refuses it. Test with the actual kit before standardising.

Related sizes

Two /31s make a /30, the older four-address link format. One step smaller is /32, a single host route used for loopbacks rather than links. Cloud VPCs do not offer /31 subnets.

Configuring a /31

On Cisco IOS the interface takes ip address 10.0.0.0 255.255.255.254 and the router notes that this is a point-to-point /31; on Linux, ip addr add 10.0.0.0/31 dev eth1 works as expected. Give the even address to one end and the odd address to the other.

Routing protocols run over a /31 unchanged. OSPF should use the point-to-point network type on such links, which also skips the designated-router election that is pointless with two neighbours.

Some monitoring and IPAM tools still compute zero usable hosts for /31, so check that they report the link correctly before relying on them.

The space saving adds up in a fabric: a leaf-spine design with 32 leaves and 4 spines has 128 links, which fit in one /24 of /31s but need two /24s of /30s.

FAQ

Questions, answered.

Tap a question to expand the answer.

No. Under RFC 3021 both addresses of a /31 are host addresses, one per end of the link.

Only if exactly two devices share it and both support RFC 3021. It is meant for point-to-point links.

More free, private DevOps tools.

The Subnet Calculator is one tool in OpsCanopy — a growing canopy of browser-based validators, converters and testers that never touch a server.

New to Networking?  Read the Networking guide →

42 free tools, every one offline-capable — opscanopy.com works with no signup and nothing uploaded.

More networking: the IP Address Converter, the CIDR / Subnet Checker and the Subnet Splitter, or browse the full tools directory.

Provided as-is for convenience; always confirm critical network changes against your own authority. OpsCanopy is free and open.