SaveMyCert
IPv4 reference

/31 subnet mask (255.255.255.254)

A /31 is the subnet mask 255.255.255.254: 31 network bits and 1 host bit, giving 2 addresses, both usable on a point-to-point link. Its wildcard mask is 0.0.0.1.

Subnet mask
255.255.255.254
Wildcard
0.0.0.1
Addresses
2
Usable hosts
2
Block size
2

The /31 mask in binary

The prefix is the number of 1 bits at the start of the mask. Ones mark the network part of an address, zeros the host part.

11111111.11111111.11111111.11111110

31 network bits, 1 host bit.

Every /31 in 192.168.1.0/24

A /24 holds 128 /31 subnets. The first eight and the last are listed; the rest follow the same step.

/31 subnets of 192.168.1.0/24
NetworkFirst addressLast addressBroadcast
192.168.1.0/31192.168.1.0192.168.1.1—
192.168.1.2/31192.168.1.2192.168.1.3—
192.168.1.4/31192.168.1.4192.168.1.5—
192.168.1.6/31192.168.1.6192.168.1.7—
192.168.1.8/31192.168.1.8192.168.1.9—
192.168.1.10/31192.168.1.10192.168.1.11—
192.168.1.12/31192.168.1.12192.168.1.13—
192.168.1.14/31192.168.1.14192.168.1.15—
192.168.1.254/31192.168.1.254192.168.1.255—

Where a /31 is used

A /31 has only 2 addresses and no network or broadcast address. RFC 3021 allows both to be used on a point-to-point link, so a router link needs half the addresses of a /30.

The usual "minus 2" rule does not apply: a /31 has 2 usable addresses, not 0.

Usable addresses in a /31
WhereUsable addresses
Ordinary network2

Worked example: 192.168.1.77/31

The block-size method, the way you would do it in an exam without a calculator.

  1. /31 means a mask of 255.255.255.254, leaving one host bit and two addresses.
  2. The pair is 192.168.1.76 and 192.168.1.77. RFC 3021 lets a point-to-point link use both, so there is no network or broadcast address to subtract.

Try another address in the subnet calculator, or practise without one on the subnetting practice questions.

/31 subnet mask: your questions

The subnet mask for /31 is 255.255.255.254. The prefix counts the 1 bits in the mask: 11111111.11111111.11111111.11111110 has 31 ones. The wildcard mask, used in Cisco ACLs and OSPF, is 0.0.0.1.

Other prefixes