Lesson 3 of 4 · 9 min
How to subnet a network
Split a /24 into four /26 networks, check the boundaries, and choose a size for your hosts.
By Calxo AI · Updated
Your office has four teams. Let’s give each one a subnet.
Imagine you’re setting up a small office. Design, Engineering, Support, and Operations each need their own network segment. You have one address block, 192.168.1.0/24, and each team needs room for 50 devices plus a gateway.
This is where subnetting earns its keep. We’ll divide that block into four smaller blocks that don’t overlap. A /24 has 256 addresses, so four equal portions give us 64 addresses each.
192.168.1.0/26Last octet: 0–6362 usable host addresses192.168.1.64/26Last octet: 64–12762 usable host addresses192.168.1.128/26Last octet: 128–19162 usable host addresses192.168.1.192/26Last octet: 192–25562 usable host addressesThis picture is an address plan. To make it work on real equipment, you would also configure the interfaces, VLANs, routing, and security rules. Let’s get the addresses right first.
Step 1: turn one block into four
We need two more bits to label four subnets: 00, 01, 10, and 11. We take those bits from the host portion and make them part of the network. That’s what people mean by borrowing bits.
Start at /24, add two network bits, and we get /26. Six host bits remain. Here is the arithmetic in one place:
Required subnets: 4 = 2^2 New prefix: 24 + 2 = /26 Host bits left: 32 − 26 = 6 Addresses per subnet: 2^6 = 64 Conventional usable hosts: 64 − 2 = 62
Does it fit our teams? Yes: 62 usable addresses cover 50 devices and one gateway, with 11 left over. The gateway uses one of the usable addresses; don’t subtract it twice.
Step 2: mark where each block begins and ends
Our mask is 255.255.255.192. For these /26 blocks inside a /24, count up by 64 in the last octet: 0, 64, 128, 192. Those are our four starting points.
| Network | Usable host range | Broadcast |
|---|---|---|
192.168.1.0/26 | 192.168.1.1–62 | 192.168.1.63 |
192.168.1.64/26 | 192.168.1.65–126 | 192.168.1.127 |
192.168.1.128/26 | 192.168.1.129–190 | 192.168.1.191 |
192.168.1.192/26 | 192.168.1.193–254 | 192.168.1.255 |
Check the joins: .63 ends the first block, .64 starts the second. No gaps, no overlaps. Together they still cover .0 through .255. Each smaller block now needs its own network and broadcast addresses, so our four subnets offer 4 × 62 = 248 conventional host addresses overall.
Step 3: find a home for .130
A Support laptop gets 192.168.1.130/26. Look at the table: 130 sits between 128 and 191, so it belongs to the third subnet. Its network is 192.168.1.128/26, broadcast is .191, and usable hosts run from .129 to .190.
Want a shortcut? Divide 130 by 64 and ignore the remainder. You get 2. Multiply back: 2 × 64 = 128. That is the start of the block. In a formula, ignoring the fractional part is called floor: floor(130 ÷ 64) × 64 = 128.
This shortcut works in the last octet for our example. For a prefix below /24, the boundary reaches into an earlier octet. Use the full 32-bit address or apply the mask across all four octets; the explorer below does that for you.
Step 4: what if you only know the device count?
Work backwards. We need 51 usable addresses: 50 devices plus a gateway. Try five host bits: 2^5 − 2 = 30. Too small. Try six: 2^6 − 2 = 62. That fits. Six host bits leave 32 − 6 = 26 network bits, so choose /26.
The general rule is to choose the smallest host-bit count h where 2^h − 2 ≥ H, with H being your required usable addresses. Then your prefix is 32 − h.
For a real office, count printers, servers, gateways, reserved leases, and some growing room too. A /27 is too small for our example; a /25 fits but uses a larger block. Managed cloud networks can reserve extra addresses, so check their rules before finalising your plan.
Common mistakes
- Choosing /27 because 32 total addresses seems close to a requirement of 30 devices plus a gateway. That needs 31 usable addresses, so /27 is insufficient.
- Assigning the network or broadcast address to a host on a conventional broadcast subnet.
- Starting a /26 at .70. The valid boundaries in this /24 are multiples of 64.
- Assuming subnetting alone isolates traffic. Routing and security policy determine communication between segments.
Try it yourself
IPv4 subnet explorer
Change the address or prefix. Watch the network bits and host range update.
Blue = network bits (26). Amber = host bits (6).
- Network
- 192.168.1.128/26
- Subnet mask
- 255.255.255.192
- Total addresses
- 64
- Usable host addresses
- 62
- Host range
- 192.168.1.129 – 192.168.1.190
- Broadcast address
- 192.168.1.191
6 host bits → 2^6 = 64 addresses → 62 usable after the network and broadcast reservations. This is address arithmetic; special-use ranges and your network configuration may impose other restrictions.
Check your understanding
Choose an answer for every question, then check your work. You can retry as often as you like.
Sources and scope
These lessons explain IPv4 address arithmetic using IETF specifications. Host counts use conventional network and broadcast reservations, with /31 and /32 exceptions. Address availability also depends on special-use ranges, provider rules, and your configuration.
- RFC 791 — IPv4 address format
- RFC 4632 — CIDR prefixes and address blocks
- RFC 1918 — Private IPv4 address space
- RFC 3021 — /31 point-to-point links