Subnetting Practical
π§ Subnetting Practical (Handwritten Style)
A complete step-by-step guide to solving subnetting questions β just the way interviews and exams expect.
Every type of problem is solved in detail so you can revise fast and effectively.
πΉ Q1. How Many Subnets and Hosts Can Be Created?
Example: 192.168.1.0/26
Step-by-Step
- Host bits =
32 - 26 = 6 - Usable hosts =
2^6 - 2 = 62 - Borrowed bits =
/26 - /24 = 2β Subnets =2^2 = 4
β
Answer: 4 subnets, 62 usable hosts per subnet
πΉ Q2. Find Subnet Mask and Ranges for Prefix
Example: /27
Steps
- Subnet mask =
255.255.255.224 - Block size =
256 - 224 = 32 - Ranges =
0β31,32β63,64β95, β¦
β Answer: Subnets increase by 32, each with 30 usable hosts
πΉ Q3. Which Subnet Does an IP Belong To?
Example: IP = 192.168.1.70 | Network = 192.168.1.0/27 |
Steps
- Block size = 32
- Ranges =
0β31,32β63,64β95 - 70 lies in
64β95
β
Answer: 192.168.1.64/27
πΉ Q4. How Many Bits to Borrow?
Example: 10.0.0.0/24 β Need 16 subnets
Steps
2^x β₯ 16βx = 4- New prefix =
/24 + 4 = /28 - Usable hosts =
2^4 - 2 = 14
β
Answer: Borrow 4 bits β /28 β 16 subnets, 14 usable hosts each
πΉ Q5. Smallest Subnet for Given Hosts
Example: Need 50 hosts, starting from 172.16.0.0/24
Steps
2^n - 2 β₯ 50βn = 6- Host bits =
6β Prefix =32 - 6 = /26 - Subnet mask =
255.255.255.192
β
Answer: Use /26 (62 usable hosts)
πΉ Q6. VLSM Allocation
Given: 192.168.10.0/24 β For 100, 50, 25, and 10 hosts
Steps
- 100 β
/25β Range:192.168.10.0 β 192.168.10.127 - 50 β
/26β Range:192.168.10.128 β 192.168.10.191 - 25 β
/27β Range:192.168.10.192 β 192.168.10.223 - 10 β
/28β Range:192.168.10.224 β 192.168.10.239
β Answer: Efficient VLSM allocation without overlaps
πΉ Q7. Point-to-Point Links
/30β 4 total, 2 usable
π Example:10.1.1.0/30β Hosts:10.1.1.1,10.1.1.2/31β 2 total, 2 usable (RFC 3021)
π Example:10.1.1.4/31β Hosts:10.1.1.4,10.1.1.5
β
Answer: Use /31 to save IPs on point-to-point links
πΉ Q8. Find Broadcast Address
Example: 192.168.5.96/27
Steps
- Block size =
32 - Subnet range = Starts at 96 β Next = 128
- Broadcast =
128 - 1 = 127
β
Answer: Broadcast = 192.168.5.127
πΉ Q9. Supernetting (Combining Networks)
Supernetting = combining smaller networks into a larger one
π Rule: Networks must be consecutive and aligned properly
Example 1:
Combine 192.168.0.0/24 + 192.168.1.0/24
β New prefix = /23
β Range = 192.168.0.0 β 192.168.1.255
β
Answer: Supernet = 192.168.0.0/23
Example 2:
Combine 10.0.0.0/24 + 10.0.1.0/24
β New prefix = /23
β Range = 10.0.0.0 β 10.0.1.255
β
Answer: Supernet = 10.0.0.0/23
Example 3:
Combine:
172.16.0.0/24172.16.1.0/24172.16.2.0/24172.16.3.0/24
β 4 networks = 2^2 = 4 β Borrow 2 bits β /22
β Range = 172.16.0.0 β 172.16.3.255
β
Answer: Supernet = 172.16.0.0/22
πΉ Q10. Trick Cases to Know
/32β Single IP only (loopback), no hosts/31β 2 usable hosts, no broadcast (RFC 3021)/30β Classic point-to-point with 2 usable hosts
π Practice Problems (With Solutions)
1. 192.168.2.0/24 β Create 8 Subnets
- Need 8 subnets β
2^3 = 8β Borrow 3 bits β/27 - Block size =
256 - 224 = 32 - Ranges:
0β31,32β63, β¦,224β255 - Each subnet =
30 usable hosts
β
Answer: 8 subnets of /27
2. Broadcast of 10.0.4.0/22
- Mask =
255.255.252.0 - Block size = 4 (in 3rd octet)
- Next =
10.0.8.0β Broadcast =10.0.7.255
β
Answer: 10.0.7.255
3. Which Subnet for 172.16.35.200/20?
- Mask =
255.255.240.0β Block size = 16 (3rd octet) - Ranges:
0β15,16β31,32β47, β¦ - 35 β in range
32β47
β
Answer: 172.16.32.0/20
4. Aggregate 192.168.8.0/24 + 192.168.9.0/24
- Two consecutive
/24networks - Combine β
/23 - Range =
192.168.8.0 β 192.168.9.255
β
Answer: 192.168.8.0/23
5. Need 500 Hosts β Which Prefix?
2^n - 2 β₯ 500βn = 9- Host bits = 9 β Prefix =
/23 - Mask =
255.255.254.0β 510 usable
β
Answer: Use /23 (510 usable hosts)
π Essential Subnetting Formulas
1
2
3
4
5
6
7
8
Hosts per Subnet = 2^h β 2 (where h = host bits)
Number of Subnets = 2^n (where n = borrowed bits)
Block Size = 256 β Subnet Mask Value
New Prefix = Old Prefix + Borrowed Bits
Subnet Mask = Prefix β Decimal Mask
Broadcast Address = Last IP in Subnet
Network Address = First IP in Subnet
Supernetting Rule = Combine only contiguous networks with common prefix
Special Cases:
/32 = single host (loopback)
/31 = 2 usable (RFC 3021, point-to-point)
/30 = 2 usable (classic point-to-point)