That’s the right mindset, Jamil!
Let’s go step-by-step and break down the whole subnetting
problem deeply, so you fully understand how and why each step is done.
🔹 Background: What is Subnetting?
Subnetting is dividing a large IP network into smaller sub-networks (subnets). Each subnet
has:
A Network Address
A Subnet Mask
A range of Valid Host IPs
A Broadcast Address
For example, [Link]/24 is a network that gives you 256 IP addresses (from
[Link] to [Link]). But you can't use all 256 for devices (VMs) because:
.0 is reserved for network address
.255 is the broadcast address
So, usable IPs = 256 - 2 = 254
🔹 Step 1: Understand the Requirements
You’re given:
A single IP block: [Link]/24 (256 addresses)
4 departments with different number of VMs (hosts):
o IT: 50
o HR: 30
o Finance: 20
o Marketing: 10
Each department must be on its own subnet — they cannot share IPs or overlap.
🔹 Step 2: Find the Minimum Subnet Size for Each
We need to find the smallest possible subnet for each department that can still fit the
required number of VMs + 2 (network and broadcast).
To do this, we find the nearest power of 2 that fits the number of hosts:
VMs +2 for Net/Broadcast Needed Nearest Power of 2 Subnet Size CIDR
IT: 50 52 64 2⁶ = 64 /26
HR: 30 32 32 2⁵ = 32 /27
Finance: 20 22 32 2⁵ = 32 /27
Marketing: 10 12 16 2⁴ = 16 /28
Why "power of 2"? Because IP addressing works in binary, and subnetting divides the
address space by powers of 2.
Why subtract 2 from total size? Because:
1 IP is reserved for network address
1 IP is reserved for broadcast address
🔹 Step 3: Allocate Subnets
Now we allocate the IP space from [Link]/24 starting with the largest subnet first
to avoid overlap.
✴ IT Department (Needs 64 IPs) → /26
Subnet Address: [Link]
Mask: [Link] → /26
IPs: [Link] – [Link]
o Network: [Link]
o Usable: [Link] – [Link]
o Broadcast: [Link]
✴ HR Department (Needs 32 IPs) → /27
Next free address: [Link]
/27 gives 32 IPs: [Link] – [Link]
o Network: [Link]
o Usable: [Link] – [Link]
o Broadcast: [Link]
✴ Finance Department (Needs 32 IPs) → /27
Next free block: [Link]
IPs: [Link] – [Link]
o Network: [Link]
o Usable: [Link] – [Link]
o Broadcast: [Link]
✴ Marketing Department (Needs 16 IPs) → /28
Next free block: [Link]
/28 gives 16 IPs: [Link] – [Link]
o Network: [Link]
o Usable: [Link] – [Link]
o Broadcast: [Link]
And we still have more space left: [Link] – [Link] is unused.
🔹 Step 4: Visualize How CIDR Works
Here's a breakdown of how many hosts each CIDR notation supports:
CIDR Subnet Mask IPs in Subnet Usable IPs
/24 [Link] 256 254
/25 [Link] 128 126
/26 [Link] 64 62
/27 [Link] 32 30
/28 [Link] 16 14
/29 [Link] 8 6
Always remember:
Subnet size = 2^(32 - CIDR)
Usable hosts = 2^(32 - CIDR) - 2
🔹 Summary: How to Do It Yourself Next Time
1. List how many hosts each department/device needs
2. Add 2 to each count (network + broadcast)
3. Find nearest power of 2
4. Convert it to CIDR (32 - log2(subnet size))
5. Start from the base IP, allocate largest subnet first
6. Avoid overlapping ranges
7. Fill a table with:
o Subnet Address
o Subnet Mask (CIDR)
o Valid Host Range
o Broadcast Address
Would you like me to quiz you with a few small subnetting questions to test your
understanding?