Lay out non-overlapping IPv4 subnets for a branch
A branch has 192.0.2.0/24 for a paper design. It needs one conventional LAN with 50 usable addresses and another with 24. How can both fit without overlap?
Lay out non-overlapping IPv4 subnets for a branch
Treat the prefix as the number of fixed bits. For a conventional /27 LAN the remaining five bits give 32 addresses. The first is the network address and the last is the directed broadcast. Point-to-point /31 links and /32 host routes are special cases outside that LAN calculation.
In the transcript
The subnetting lesson counts how a change in network bits changes the number of equal-sized blocks and the host addresses available within each.
Work through the decision
A branch has 192.0.2.0/24 for a paper design. It needs one conventional LAN with 50 usable addresses and another with 24. How can both fit without overlap?
Check your reasoning
Allocate the larger LAN first. A /26 has 64 addresses, of which 62 are usable on a conventional broadcast LAN. Assign 192.0.2.0/26 and then 192.0.2.64/27. The second broadcast is .95 and the next free address is .96. These documentation addresses are for the exercise.
Calculating IPv4 Subnets and Hosts · video start · Read the instructor’s transcript
Decisions and tradeoffs
- A /25 prefix
- A conventional IPv4 /25 broadcast LAN holds 128 addresses and 126 usable host addresses.
- A /26 prefix
- A /26 contains 64 addresses and normally provides 62 usable host addresses. Boundaries in the last octet are multiples of 64.
- A /27 prefix
- A /27 contains 32 addresses and normally provides 30 usable hosts. The block size is 32.
- A /28 prefix
- A /28 contains 16 addresses and normally provides 14 usable hosts. The block size is 16.
Practice the guide skills
- Classify private, public, loopback and IPv4 link-local examples.
- Calculate the mask, network, broadcast and usable endpoints of each candidate.
- Use VLSM to place the largest requirement first and check overlap.
- Distinguish historical classful ranges from CIDR prefix length.
Official objectives for this lesson
Videos and transcripts for objective 1.7
Allocate and verify two branch LANs
Save this fixture as subnets.py and run it with Python 3. Use the documentation block 192.0.2.0/24 on paper. Choose the smallest conventional LAN for 50 interfaces and a second one for 24. Predict the first and last usable addresses and verify overlap before assigning either block.
from ipaddress import ip_network
parent = ip_network("192.0.2.0/24")
plan = [(ip_network("192.0.2.0/26"), 50),
(ip_network("192.0.2.64/27"), 24)]
for subnet, required in plan:
usable = subnet.num_addresses - 2
print(subnet, usable, subnet.network_address + 1,
subnet.broadcast_address - 1)
assert subnet.subnet_of(parent) and usable >= required
print("overlap:", plan[0][0].overlaps(plan[1][0]))
Check the result
192.0.2.0/26 62 192.0.2.1 192.0.2.62 192.0.2.64/27 30 192.0.2.65 192.0.2.94 overlap: False
Move the second network to 192.0.2.32/27. It still has 30 usable addresses, but overlap now prints True. Restore the original and add a third 12-host LAN at 192.0.2.96/28. Check its last usable address is .110 and compare it with each earlier block.
Related lesson · Trace the effective network route
Lay out non-overlapping IPv4 subnets for a branch quiz
Answer 3 questions. Check each answer for an explanation.
Worked example · Lay out non-overlapping IPv4 subnets for a branch