INFRASTRUCTURE LEARNINGINFRASTRUCTURE LEARNING
インフラ大全インフラ大全IT INFRASTRUCTURE / LEARNING
Infrastructure learning guide
Find a lesson or lab/

Esc to close · Search terms stay on your device

LEARNING日本語

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.

What you will learn

Read IPv4 prefix ranges and totals, split a /24 into two non-overlapping /25s, and separate address arithmetic from routing, access and allocation rules.

Prerequisite

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.

192.0.2.17/24: 24 fixed bits and 8 variable bits
Octet 11928 bits of the network prefix
Octet 208 bits of the network prefix
Octet 328 bits of the network prefix
Octet 4178 variable bits
Fix the first 24 bits192.0.2.0–25528 = 256 addresses
/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

Different input addresses can belong to the same block
InputFirst addressLast addressTotal
192.0.2.17/24192.0.2.0192.0.2.255256
192.0.2.17/25192.0.2.0192.0.2.127128
192.0.2.200/25192.0.2.128192.0.2.255128
192.0.2.17/32192.0.2.17192.0.2.171

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

Split one /24 into two disjoint /25 blocks
Split one /24 into two disjoint /25 blocks1: 192.0.2.0/24 — Fix the 25th bit to 0 for the lower half. — 192.0.2.0/25. 2: 192.0.2.0/24 — Fix the 25th bit to 1 for the upper half; it does not overlap the lower half. — 192.0.2.128/2512192.0.2.0/24192.0.2.0/25192.0.2.128/25Split one /24 into two disjoint /25 blocks1: 192.0.2.0/24 — Fix the 25th bit to 0 for the lower half. — 192.0.2.0/25. 2: 192.0.2.0/24 — Fix the 25th bit to 1 for the upper half; it does not overlap the lower half. — 192.0.2.128/2512192.0.2.0/24192.0.2.0/25192.0.2.128/25
  1. 192.0.2.0/24 → 192.0.2.0/25Fix the 25th bit to 0 for the lower half.
  2. 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.

Which /25 contains 192.0.2.128?
Read the answer and reason

Answer: 192.0.2.128/25 · The lower half ends at .127; the upper half begins at .128. Checking the boundary is a useful way to catch an off-by-one error.

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

  1. Predict the first address, last address and total for 192.0.2.17/24.
  2. Change /24 to /25 and explain the effect on the variable bits.
  3. Calculate 192.0.2.127/25 and 192.0.2.128/25.
  4. Use the calculator to check which half contains each address.
  5. For real configuration, separately check reservations and input requirements.

Check, then explain in your own words

  1. Calculate /24 and /25 sizes from 32 bits.
  2. Write the boundaries of the lower and upper halves.
  3. 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.