Subnet Calculation
Now let's practice subnetting calculations!
01Step by Step Calculation
Example: 192.168.10.0/26
Step 1: Find the mask
code
/26 = 26 bits 1, 6 bits 0
11111111.11111111.11111111.11000000
= 255.255.255.192
Step 2: Find block size
code
256 - 192 = 64
Each subnet contains 64 addresses
Step 3: List subnets
code
Subnet 1: 192.168.10.0 - .63
Subnet 2: 192.168.10.64 - .127
Subnet 3: 192.168.10.128 - .191
Subnet 4: 192.168.10.192 - .255
02Quick Reference Table
| CIDR | Mask | Block Size | Subnets | Hosts/Subnet |
|---|---|---|---|---|
| /24 | 255.255.255.0 | 256 | 1 | 254 |
| /25 | 255.255.255.128 | 128 | 2 | 126 |
| /26 | 255.255.255.192 | 64 | 4 | 62 |
| /27 | 255.255.255.224 | 32 | 8 | 30 |
| /28 | 255.255.255.240 | 16 | 16 | 14 |
| /29 | 255.255.255.248 | 8 | 32 | 6 |
| /30 | 255.255.255.252 | 4 | 64 | 2 |
03Practice Questions
Question 1:
How many hosts can be in the 10.0.0.0/8 network?
Solution:
code
32 - 8 = 24 host bits
2^24 - 2 = 16,777,214 hosts
Question 2:
What is the broadcast address of 172.16.0.0/12?
Solution:
code
/12 = first 12 bits are network
172.16.0.0 - 172.31.255.255 range
Broadcast: 172.31.255.255
Question 3:
Which subnet is 192.168.1.130/25 in?
Solution:
code
/25 = 128 block size
0-127: Subnet 1
128-255: Subnet 2
130 is in Subnet 2: 192.168.1.128/25
04Which Subnet is an IP in?
Method:
- Find block size
- Divide IP by block size
- Drop remainder, result is subnet address
Example: Which subnet is 192.168.1.200/26 in?
code
Block size = 64
200 ÷ 64 = 3.125
3 × 64 = 192
Subnet: 192.168.1.192/26
05VLSM (Variable Length Subnet Mask)
Creating subnets of different sizes:
code
Network: 192.168.1.0/24
Department A: 100 hosts needed → /25 (126 hosts)
Department B: 50 hosts needed → /26 (62 hosts)
Department C: 20 hosts needed → /27 (30 hosts)
Links: 2 hosts needed → /30 (2 hosts)
06Summary
- Block size = 256 - Last octet
- Subnet address = IP's nearest lower multiple
- Broadcast = Next subnet - 1
- VLSM for efficient IP usage