/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.
| Network | First address | Last address | Broadcast |
|---|---|---|---|
| 192.168.1.0/31 | 192.168.1.0 | 192.168.1.1 | — |
| 192.168.1.2/31 | 192.168.1.2 | 192.168.1.3 | — |
| 192.168.1.4/31 | 192.168.1.4 | 192.168.1.5 | — |
| 192.168.1.6/31 | 192.168.1.6 | 192.168.1.7 | — |
| 192.168.1.8/31 | 192.168.1.8 | 192.168.1.9 | — |
| 192.168.1.10/31 | 192.168.1.10 | 192.168.1.11 | — |
| 192.168.1.12/31 | 192.168.1.12 | 192.168.1.13 | — |
| 192.168.1.14/31 | 192.168.1.14 | 192.168.1.15 | — |
| 192.168.1.254/31 | 192.168.1.254 | 192.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.
| Where | Usable addresses |
|---|---|
| Ordinary network | 2 |
Worked example: 192.168.1.77/31
The block-size method, the way you would do it in an exam without a calculator.
- /31 means a mask of 255.255.255.254, leaving one host bit and two addresses.
- 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.