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, 192.168.10.0/24 is a network that gives you 256 IP addresses (from
192.168.10.0 to 192.168.10.255). 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: 192.168.10.0/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 192.168.10.0/24 starting with the largest subnet first
to avoid overlap.
✴ IT Department (Needs 64 IPs) → /26
Subnet Address: 192.168.10.0
Mask: 255.255.255.192 → /26
IPs: 192.168.10.0 – 192.168.10.63
o Network: 192.168.10.0
o Usable: 192.168.10.1 – 192.168.10.62
o Broadcast: 192.168.10.63
✴ HR Department (Needs 32 IPs) → /27
Next free address: 192.168.10.64
/27 gives 32 IPs: 192.168.10.64 – 192.168.10.95
o Network: 192.168.10.64
o Usable: 192.168.10.65 – 192.168.10.94
o Broadcast: 192.168.10.95
✴ Finance Department (Needs 32 IPs) → /27
Next free block: 192.168.10.96
IPs: 192.168.10.96 – 192.168.10.127
o Network: 192.168.10.96
o Usable: 192.168.10.97 – 192.168.10.126
o Broadcast: 192.168.10.127
✴ Marketing Department (Needs 16 IPs) → /28
Next free block: 192.168.10.128
/28 gives 16 IPs: 192.168.10.128 – 192.168.10.143
o Network: 192.168.10.128
o Usable: 192.168.10.129 – 192.168.10.142
o Broadcast: 192.168.10.143
And we still have more space left: 192.168.10.144 – 192.168.10.255 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 255.255.255.0 256 254
/25 255.255.255.128 128 126
/26 255.255.255.192 64 62
/27 255.255.255.224 32 30
/28 255.255.255.240 16 14
/29 255.255.255.248 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?