CIDR & Subnetting
/24, /28, usable hosts, planning subnets.
Learning objectives
- Read CIDR notation (/24, /28, etc.)
- Calculate usable host counts
- Split a network into subnets for VLANs
CIDR notation
CIDR (Classless Inter-Domain Routing) writes the prefix length after a slash: 192.168.10.0/24 means the first 24 bits are the network; the remaining 8 bits are hosts.
| Prefix | Subnet mask | Total addresses | Usable hosts* |
|---|---|---|---|
| /24 | 255.255.255.0 | 256 | 254 |
| /25 | 255.255.255.128 | 128 | 126 |
| /28 | 255.255.255.240 | 16 | 14 |
| /30 | 255.255.255.252 | 4 | 2 (point-to-point links) |
*Usable hosts exclude network and broadcast addresses on typical LAN subnets.
Formula
Host bits = 32 − prefix. Total addresses = 2host bits. Usable ≈ total − 2 for /24 and larger LANs.
Worked example — split Workshop Co. /24
Starting network 192.168.10.0/24 (254 hosts). Workshop Co. needs three isolated segments:
| VLAN | Subnet | Usable hosts | Use |
|---|---|---|---|
| Office | 192.168.10.0/26 | 62 | Staff laptops, printers |
| Shop floor | 192.168.10.64/26 | 62 | POS, tool booking kiosk |
| Cameras | 192.168.10.128/27 | 30 | NVR + 4 cameras |
| Guest Wi‑Fi | 192.168.20.0/24 | 254 | Separate /24 on guest VLAN |
Two VLANs cannot use the same subnet on the same router without bridging. Guest uses 192.168.20.0/24 deliberately — not overlapping 10.0/26 ranges inside 10.0/24 unless you carve carefully.
Try it yourself — /28 for IoT
Workshop Co. wants a tiny subnet for 8 smart dust-collector sensors. Is /28 enough? What is the network address if carved from 192.168.10.192/28?
Answer
/28 gives 14 usable hosts — enough for 8 sensors plus room to grow. Network: 192.168.10.192, broadcast 192.168.10.207, usable .193–.206.
Spot the mistake
Admin assigns gateway 192.168.10.255 on a /24. What is wrong?
Answer
.255 is the broadcast address on /24 — not valid for a host. Use 192.168.10.1 or another host address in range.
Quick quiz
- How many usable hosts in a /26?
- What does /24 mean in terms of bits?
- Why use a /30?
Answers
- 62 usable (64 − 2).
- 24 network bits, 8 host bits.
- Point-to-point links between routers — only two usable IPs needed.