/24 subnet mask (255.255.255.0)
A /24 is the subnet mask 255.255.255.0: 24 network bits and 8 host bits, giving 256 addresses and 254 usable hosts. Its wildcard mask is 0.0.0.255 and its block size is 256.
- Subnet mask
- 255.255.255.0
- Wildcard
- 0.0.0.255
- Addresses
- 256
- Usable hosts
- 254
- Block size
- 256
The /24 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.00000000
24 network bits, 8 host bits.
Every /24 in 172.16.0.0/16
A /16 holds 256 /24 subnets. The first eight and the last are listed; the rest follow the same step.
| Network | First host | Last host | Broadcast |
|---|---|---|---|
| 172.16.0.0/24 | 172.16.0.1 | 172.16.0.254 | 172.16.0.255 |
| 172.16.1.0/24 | 172.16.1.1 | 172.16.1.254 | 172.16.1.255 |
| 172.16.2.0/24 | 172.16.2.1 | 172.16.2.254 | 172.16.2.255 |
| 172.16.3.0/24 | 172.16.3.1 | 172.16.3.254 | 172.16.3.255 |
| 172.16.4.0/24 | 172.16.4.1 | 172.16.4.254 | 172.16.4.255 |
| 172.16.5.0/24 | 172.16.5.1 | 172.16.5.254 | 172.16.5.255 |
| 172.16.6.0/24 | 172.16.6.1 | 172.16.6.254 | 172.16.6.255 |
| 172.16.7.0/24 | 172.16.7.1 | 172.16.7.254 | 172.16.7.255 |
| 172.16.255.0/24 | 172.16.255.1 | 172.16.255.254 | 172.16.255.255 |
Where a /24 is used
A /24 (255.255.255.0) is the default mask of the old class C range and still the default size for a home or office LAN: 254 usable hosts, with the network decided by the first three octets.
AWS and Azure both reserve five addresses in every subnet, so a /24 subnet in either cloud has 251 usable addresses.
| Where | Usable addresses |
|---|---|
| Ordinary network | 254 |
| AWS VPC subnet (5 reserved) | 251 |
| Azure subnet (5 reserved) | 251 |
Worked example: 172.16.45.9/24
The block-size method, the way you would do it in an exam without a calculator.
- /24 means a mask of 255.255.255.0.
- The mask ends exactly on an octet boundary, so the fourth octet onwards is all host bits: zero it for the network, set it to 255 for the broadcast.
- Network address = 172.16.45.0; broadcast = the next block minus one = 172.16.45.255.
- Usable hosts run from the network plus one to the broadcast minus one: 172.16.45.1 to 172.16.45.254, which is 2^8 − 2 = 254 addresses.
Try another address in the subnet calculator, or practise without one on the subnetting practice questions.