What /24 Means
CIDR notation writes an address and the length of its network part together: 192.0.2.10/24. An IPv4 address has 32 bits. With a prefix of 24, 24 bits are fixed for the network and 8 bits are left for hosts. Eight bits give 256 combinations:
- Network address:
192.0.2.0, the first address, names the subnet itself. - Broadcast address:
192.0.2.255, the last address, reaches every host in the subnet. - Usable hosts:
192.0.2.1to192.0.2.254, 254 addresses. The gateway uses one of them, often the first.
The Mask in Binary
The mask has a 1 for every network bit and a 0 for every host bit:
/24 = 11111111.11111111.11111111.00000000 = 255.255.255.0
/26 = 11111111.11111111.11111111.11000000 = 255.255.255.192Each extra bit in the prefix halves the subnet.
Prefix Table from /16 to /32
| Prefix | Mask | Usable hosts |
|---|---|---|
| /16 | 255.255.0.0 | 65,534 |
| /17 | 255.255.128.0 | 32,766 |
| /18 | 255.255.192.0 | 16,382 |
| /19 | 255.255.224.0 | 8,190 |
| /20 | 255.255.240.0 | 4,094 |
| /21 | 255.255.248.0 | 2,046 |
| /22 | 255.255.252.0 | 1,022 |
| /23 | 255.255.254.0 | 510 |
| /24 | 255.255.255.0 | 254 |
| /25 | 255.255.255.128 | 126 |
| /26 | 255.255.255.192 | 62 |
| /27 | 255.255.255.224 | 30 |
| /28 | 255.255.255.240 | 14 |
| /29 | 255.255.255.248 | 6 |
| /30 | 255.255.255.252 | 2 |
| /31 | 255.255.255.254 | 2, point-to-point links |
| /32 | 255.255.255.255 | 1, a single address |
The rule behind the table: a prefix of n leaves 32 minus n host bits, and usable hosts are 2 to that power, minus 2 for the network and broadcast addresses. A /31 is the exception (RFC 3021): on a point-to-point link both addresses are host addresses, with no network or directed broadcast address. A /32 is a single host address.
Calculate a Range by Hand
- Take the last mask octet that is not 255. For a /26 it is 192.
- Subtract it from 256 to get the block size: 256 minus 192 is 64.
- Subnets start at multiples of the block size: .0, .64, .128, .192.
- For
198.51.100.77/26, the block that contains 77 starts at 64. The network is198.51.100.64, the broadcast is198.51.100.127, and the usable hosts are .65 to .126.
Check It with ipcalc
sudo apt install ipcalc # Debian and Ubuntu
sudo dnf install ipcalc # AlmaLinux and Rocky Linux
ipcalc 198.51.100.77/26The two families ship different programs under the same name: Debian and Ubuntu package a Perl tool, and the Red Hat family packages a separate C program that is often installed already. The output layout differs, but both print the network, broadcast, and host range. If the shell cannot find the command, see command not found in Linux.
Read the Subnet in ip a Output
ip a
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 ...
inet 203.0.113.10/24 brd 203.0.113.255 scope global eth0The inet line gives the address and prefix together. brd is the broadcast address. ip route shows the gateway on the line that starts with default via; that gateway must be inside the subnet. Addresses on a server are often assigned by DHCP, as described in what is PXE boot.
Private Ranges (RFC 1918)
10.0.0.0/8: about 16.7 million addresses.172.16.0.0/12: 172.16.0.0 to 172.31.255.255.192.168.0.0/16: common in home and office networks.
These ranges are not routed on the public internet. Use them for private networks between servers and for VPNs, and pick a range that does not overlap the networks your users connect from.
IPv6 Prefixes
IPv6 uses the same slash notation but no dotted mask: 2001:db8:10::/64 fixes the first 64 of 128 bits. A single IPv6 subnet is normally a /64, and IPv6 has no broadcast address. To test the routes to an address from another network, see what is a looking glass.
Updated:
Linux VPS with Full Root Access
MUVCloud cloud servers run on KVM with Enterprise NVMe SSD storage and full root access, in Turkey, the Netherlands, and the USA.
More Guides
No Limits on Service or Support
You are not on your own as your projects grow. Our support engineers are ready 24/7, on several channels, whenever you need them.

- 100% customer satisfaction goal
- Our own hardware
- 24/7 ticket and email support
- 4 countries with locations