Subnet mask 255.255.255.254
/31
255.255.255.254 · 2 usable hosts
| CIDR prefix | /31 |
| Subnet mask | 255.255.255.254 |
| Wildcard mask | 0.0.0.1 |
| Binary | 11111111.11111111.11111111.11111110 |
| Total addresses | 2 |
| Usable hosts | 2 |
How many hosts it holds
Two addresses and both usable. RFC 3021 removed the network and broadcast addresses for point-to-point links, which is the one case where the usual minus-two does not apply.
Reading the mask
A subnet mask is 31 one-bits followed by 1 zero-bits, written as four decimal octets. The ones mark the part of the address that identifies the network and the zeros mark the part that identifies the host, which is why the mask is always a solid run of ones — a mask with a gap in it would split the host part in two and is not valid.
11111111.11111111.11111111.11111110
255.255.255.254
The prefix length is simply the count of those ones, so 255.255.255.254 is /31 and nothing has to be calculated to convert between them.
The wildcard, and where it turns up
Cisco access lists and OSPF network statements take a wildcard mask rather than a subnet mask — the same value with every bit inverted, 0.0.0.1 here. It trips people up because the two look alike and mean opposite things: in a subnet mask a one means "this bit is the network", and in a wildcard a one means "ignore this bit".
Frequently asked questions
What CIDR prefix is 255.255.255.254?
255.255.255.254 is /31. The mask has 31 bits set, and the prefix length is that count.
How many hosts does 255.255.255.254 allow?
Two addresses and both usable. RFC 3021 removed the network and broadcast addresses for point-to-point links, which is the one case where the usual minus-two does not apply.
What is the wildcard mask for 255.255.255.254?
0.0.0.1 — the mask with every bit flipped. Cisco access lists and OSPF network statements take the wildcard rather than the mask, which is the usual reason to want it.
Other masks
- 255.255.255.255 — /32
- 0.0.0.0 — /0
- 128.0.0.0 — /1
- 192.0.0.0 — /2
- 224.0.0.0 — /3
- 240.0.0.0 — /4
- 248.0.0.0 — /5
- 252.0.0.0 — /6
- 254.0.0.0 — /7
- 255.0.0.0 — /8
- 255.128.0.0 — /9
- 255.192.0.0 — /10