Topic lessonTopic: Networking foundations
CIDR and subnetting explained: prefixes, ranges and splitting a /24
CIDR (Classless Inter-Domain Routing) writes an address range as an address followed by a prefix length. An IPv4 /24 contains 256 addresses; a /25 contains 128. Learn how a prefix defines a range, how to split it, and how to detect overlap. The number of addresses in a range is separate from the number a particular network lets you assign.
Read IPv4 prefix ranges and totals, split a /24 into two non-overlapping /25s, and separate address arithmetic from routing, access and allocation rules.
Recognize an IPv4 address such as 192.0.2.17. Examples use the documentation block 192.0.2.0/24 and are not instructions to configure a live network.
A /24 fixes the first 24 bits
IPv4 addresses contain 32 bits. A /24 fixes the first 24, leaving 8 variable bits: 2 to the power of 8, or 256 addresses. Increasing the prefix length by one halves the range. A larger prefix number means a smaller block.
- /24: 24 + 8 bits
- 24 fixed bits and 8 variable bits; 256 addresses.
- /25: 25 + 7 bits
- 25 fixed bits and 7 variable bits; 128 addresses.
Distinguish an address from its containing network
| Input | First address | Last address | Total |
|---|---|---|---|
| 192.0.2.17/24 | 192.0.2.0 | 192.0.2.255 | 256 |
| 192.0.2.17/25 | 192.0.2.0 | 192.0.2.127 | 128 |
| 192.0.2.200/25 | 192.0.2.128 | 192.0.2.255 | 128 |
| 192.0.2.17/32 | 192.0.2.17 | 192.0.2.17 | 1 |
192.0.2.17/24 does not mean “256 addresses starting at .17.” The canonical network is 192.0.2.0/24. Some configuration fields reject host bits instead of normalizing them, so distinguish the calculated network from an input field’s acceptance rules.
Worked example: split a /24 into two /25s
- 192.0.2.0/24 → 192.0.2.0/25Fix the 25th bit to 0 for the lower half.
- 192.0.2.0/24 → 192.0.2.128/25Fix the 25th bit to 1 for the upper half; it does not overlap the lower half.
- 192.0.2.0/24
- The parent spans .0 through .255: 256 addresses.
- 192.0.2.0/25
- The lower half spans .0 through .127: 128 addresses.
- 192.0.2.128/25
- The upper half spans .128 through .255: 128 addresses.
Choose an option to see the result and explanation.
Check overlap, total size and usable capacity separately
192.0.2.0/25 overlaps 192.0.2.64/26: the latter’s .64–.127 range lies inside the former. Different names or purposes do not remove an address overlap. Compare each block’s first and last addresses.
CIDR notation is also used for route destinations and traffic-rule peers. Address arithmetic, route selection and traffic permission are distinct tasks. A correct prefix does not prove connectivity or application success.
Practice by changing a boundary
- Predict the first address, last address and total for 192.0.2.17/24.
- Change /24 to /25 and explain the effect on the variable bits.
- Calculate 192.0.2.127/25 and 192.0.2.128/25.
- Use the calculator to check which half contains each address.
- For real configuration, separately check reservations and input requirements.
Check, then explain in your own words
- Calculate /24 and /25 sizes from 32 bits.
- Write the boundaries of the lower and upper halves.
- Separate prefix arithmetic from routes, permissions and reservations.
Check your understanding: Does changing /25 to /24 make the block smaller?
No. It doubles the range from 128 to 256 addresses.
Reducing the fixed prefix by one bit adds one variable bit. That doubles the possible addresses; a smaller prefix number denotes a larger block.
Sources and conditions checked
Primary references are collected here with their scope, conditions and corresponding sections. Independent expert review and live-environment validation have not been performed.
- RFC 4632 — CIDRChecked:
Scope and conditionsIPv4 32-bit prefix notation, masks and total power-of-two address counts; not usable-host allocation rules.
Used in this lessonA /24 fixes the first 24 bits Distinguish an address from its containing network Worked example: split a /24 into two /25s Check overlap, total size and usable capacity separately
Scope and conditions192.0.2.0/24, 198.51.100.0/24 and 203.0.113.0/24 are documentation examples, not live networks
Used in this lessonDistinguish an address from its containing network