Subnetting Exercises
Subnetting Exercises
IP Address Classes
Class A 1 – 127 (Network 127 is reserved for loopback and internal testing)
Leading bit pattern 0 00000000.00000000.00000000.00000000
Network . Host . Host . Host
Class B 255.255.0.0
Class C 255.255.255.0
Inside Cover
ANDING With
Custom subnet masks
When you take a single network such as 192.100.10.0 and divide it into five smaller networks
(192.100.10.16, 192.100.10.32, 192.100.10.48, 192.100.10.64, 192.100.10.80) the outside
world still sees the network as 192.100.10.0, but the internal computers and routers see five
smaller subnetworks. Each independent of the other. This can only be accomplished by using
a custom subnet mask. A custom subnet mask borrows bits from the host portion of the
address to create a subnetwork address between the network and host portions of an IP
address. In this example each range has 14 usable addresses in it. The computer must still
AND the IP address against the custom subnet mask to see what the network portion is and
which subnetwork it belongs to.
Sub
Network Network Host
IP Address: 1 1 0 0 0 0 0 0 . 0 1 1 0 0 1 0 0 . 0 0 0 0 1 0 1 0 . 0 0 1 0 0 0 0 1 (192 . 100 . 10 . 33)
Custom Subnet Mask: 1 1 1 1 1 1 1 1 . 0 1 1 1 1 1 1 1 . 1 1 1 1 1 1 1 1 . 1 1 1 1 0 0 0 0 (255 . 255 . 255 . 240)
AND: 1 1 0 0 0 0 0 0 . 0 1 1 0 0 1 0 0 . 0 0 0 0 1 0 1 0 . 0 0 1 0 0 0 0 0 (192 . 100 . 10 . 32)
In the next set of problems you will determine the necessary information to determine the
correct subnet mask for a variety of IP addresses.
9
How to determine the number of subnets and the
number of hosts per subnet
Two formulas can provide this basic information:
Both formulas calculate the number of hosts or subnets based on the number of binary bits
used. For example if you borrow three bits from the host portion of the address use the
number of subnets formula to determine the total number of subnets gained by borrowing the
three bits. This would be 23 or 2 x 2 x 2 = 8 subnets
To determine the number of hosts per subnet you would take the number of binary bits used in
the host portion and apply this to the number of hosts per subnet formula If five bits are in the
host portion of the address this would be 2 5 or 2 x 2 x 2 x 2 x 2 = 32 hosts.
When dealing with the number of hosts per subnet you have to subtract two addresses from
the range. The first address in every range is the subnet number. The last address in every
range is the broadcast address. These two addresses cannot be assigned to any device in
the network which is why you have to subtract two addresses to find the number of usable
addresses in each range.
For example if two bits are borrowed for the network portion of the address you can easily
determine the number of subnets and hosts per subnets using the two formulas.
195. 223 . 50 . 0 0 0 0 0 0 0 0
In some instances the first and last subnet range of addresses are reserved. This is similar to
the first and last host addresses in each range of addreses.
The first range of addresses is the zero subnet. The subnet number for the zero subnet is
also the subnet number for the classful subnet address.
The last range of addresses is the broadcast subnet. The broadcast address for the last
subnet in the broadcast subnet is the same as the classful broadcast address.
10
Class C Address unsubnetted:
195. 223 . 50 . 0
195.223.50.0 to 195.223.50.255
Notice that the subnet and
broadcast addresses match.
Class C Address subnetted (2 bits borrowed):
195. 223 . 50 . 0 0 0 0 0 0 0 0
The primary reason the the zero and broadcast subnets were not used had to do pirmarily with
the broadcast addresses. If you send a broadcast to 195.223.255 are you sending it to all 255
addresses in the classful C address or just the 62 usable addresses in the broadcast range?
The CCNA and CCENT certification exams may have questions which will require you to
determine which formula to use, and whehter or not you can use the first and last subnets. Use
the chart below to help decide.
Bottom line for the CCNA exams; if a question does not give you any clues as to whether or not
to allow these two subnets, assume you can use them.
s
This workbook has you use the number of subnets = 2 formula.
11
Custom Subnet Masks
Problem 1
Number of needed subnets 14
Number of needed usable hosts 14
Network Address 192.10.10.0
C
Address class __________
16
Total number of subnets ___________________
16
Total number of host addresses ___________________
14
Number of usable addresses ___________________
4
Number of bits borrowed ___________________
Number of
256 128 64 32 16 8 4 2 - Hosts
Number of
Subnets - 2 4 8 16 32 64 128 256
128 64 32 16 8 4 2 1 - Binary values
192 . 10 . 10 . 0 0 0 0 0 0 0 0
128
16 Observe the total number of
Add the binary value
64 hosts.
numbers to the left of the line to
-2
32
14
create the custom subnet mask. Subtract 2 for the number of
+16
usable hosts.
240
12
Custom Subnet Masks
Problem 2
Number of needed subnets 1000
Number of needed usable hosts 60
Network Address 165.100.0.0
B
Address class __________
255 . 255 . 0 . 0
Default subnet mask _______________________________
1,024
Total number of subnets ___________________
64
Total number of host addresses ___________________
62
Number of usable addresses ___________________
10
Number of bits borrowed ___________________
32,
16,3
4,0
2,0
1,02
8,19
512
536
768
Number of
84
96
48
. 256 128 64 32 16 8 4 2
2
Hosts -
65,
32,
16,3
4,0
102
204
8,19
536
512
Number of
768
84
96
165 . 100 . 0 0 0 0 0 0 0 0 . 0 0 0 0 0 0 0 0
128 128
64 +64
32 192 64
Observe the total number of
16 hosts.
Add the binary value
numbers to the left of the line to 8 -2
62
Subtract 2 for the number of
create the custom subnet mask.
4 usable hosts.
2
+1
255
13
Custom Subnet Masks
255 . 255 . 0 . 0
Default subnet mask _______________________________
1,024
Total number of subnets ___________________
64
Total number of host addresses ___________________
62
Number of usable addresses ___________________
10
Number of bits borrowed ___________________
32,
16,3
4,0
2,0
1,02
8,19
512
536
768
Number of
84
96
48
. 256 128 64 32 16 8 4 2
2
Hosts -
65,
32,
16,3
4,0
102
204
8,19
536
512
Number of 768
84
96
148 . 75 . 0 0 0 0 0 0 0 0 . 0 0 0 0 0 0 0 0
128 128
64 +64
32 192 64
Observe the total number of
16 hosts.
Add the binary value
numbers to the left of the line to 8 -2
62
Subtract 2 for the number of
create the custom subnet mask.
4 usable hosts.
2 1024
+1 Subtract 2 for the total number of
-2
255
subnets to get the usable number of
1,022
subnets.
14
Custom Subnet Masks
Problem 4
Number of needed subnets 6
Number of needed usable hosts 30
Network Address 210.100.56.0
Number of
256 128 64 32 16 8 4 2 - Hosts
Number of
Subnets - 2 4 8 16 32 64 128 256
128 64 32 16 8 4 2 1 - Binary values
210 . 100 . 56 . 0 0 0 0 0 0 0 0
15
Custom Subnet Masks
Problem 5
Number of needed subnets 6
Number of needed usable hosts 30
Network Address 195.85.8.0
Number of
256 128 64 32 16 8 4 2 - Hosts
Number of
Subnets - 2 4 8 16 32 64 128 256
128 64 32 16 8 4 2 1 - Binary values
195 . 85 . 8 . 0 0 0 0 0 0 0 0
16
Custom Subnet Masks
Problem 6
Number of needed subnets 126
Number of needed usable hosts 131,070
Network Address 118.0.0.0
2,09
1,04
52
262
131
65,5
32,7
16,3
4,0
2,0
1,02
4,2
4,30
8,19
8,57
7,15
Number of
,07
,144
512
. 256 128 64 32 16 8 4 2
36
96
48
84
Hosts
68
-
88
2
2
2
4
4
6
1,04
2,09
4,19
262
52
131
65,5
32,7
16,3
1,02
2,0
4,0
4,2
4,30
8,19
8,57
7,15
Number of
,07
,144
512
.
36
48
96
84
68
2
4
4
6
118. 0 0 0 0 0 0 0 0 . 0 0 0 0 0 0 0 0 . 0 0 0 0 0 0 0 0
17
Custom Subnet Masks
Problem 7
Number of needed subnets 2000
Number of needed usable hosts 15
Network Address 178.100.0.0
32,
16,3
4,0
2,0
1,02
8,19
512
536
768
Number of
84
96
48
. 256 128 64 32 16 8 4 2
2
Hosts -
65,
32,
16,3
4,0
102
204
8,19
536
512
Number of
768
84
96
178 . 100 . 0 0 0 0 0 0 0 0 . 0 0 0 0 0 0 0 0
18
Custom Subnet Masks
Problem 8
Number of needed subnets 3
Number of needed usable hosts 45
Network Address 200.175.14.0
19
Custom Subnet Masks
Problem 9
Number of needed subnets 60
Number of needed usable hosts 1,000
Network Address 128.77.0.0
20
Custom Subnet Masks
Problem 10
Number of needed usable hosts 60
Network Address 198.100.10.0
21
Custom Subnet Masks
Problem 11
Number of needed subnets 250
Network Address 101.0.0.0
22
Custom Subnet Masks
Problem 12
Number of needed subnets 5
Network Address 218.35.50.0
23
Custom Subnet Masks
Problem 13
Number of needed usable hosts 25
Network Address 218.35.50.0
24
Custom Subnet Masks
Problem 14
Number of needed subnets 10
Network Address 172.59.0.0
25
Custom Subnet Masks
Problem 15
Number of needed usable hosts 50
Network Address 172.59.0.0
26
Custom Subnet Masks
Problem 16
Number of needed usable hosts 29
Network Address 23.0.0.0
27
Subnetting
Problem 1
Number of needed subnets 14
Number of needed usable hosts 14
Network Address 192.10.10.0
C
Address class __________
16
Total number of subnets ___________________
16
Total number of host addresses ___________________
14
Number of usable addresses ___________________
4
Number of bits borrowed ___________________
28
Show your work for Problem 1 in the space below.
Number of
256 128 64 32 16 8 4 2 - Hosts
Number of
Subnets - 2 4 8 16 32 64 128 256
128 64 32 16 8 4 2 1 - Binary values
192. 10 . 10 . 0 0 0 0 0 0 0 0
128
64
32 16 16
+16 -2 -2
240 14 14
Custom subnet Usable subnets Usable hosts
mask
The binary value of the last bit borrowed is the range. In this
problem the range is 16.
Problem 2
Number of needed subnets 1000
Number of needed usable hosts 60
Network Address 165.100.0.0
B
Address class __________
255 . 255 . 0 . 0
Default subnet mask _______________________________
1,024
Total number of subnets ___________________
64
Total number of host addresses ___________________
62
Number of usable addresses ___________________
10
Number of bits borrowed ___________________
30
65,
32,
16,3
4,0
2,0
8,19
1,02
Number of
768
84
96
48
4
512
536
Hosts - . 256 128 64 32 16 8 4 2
65,
32,
16,3
4,0
8,19
102
204
Number of
512
96
84
768
4
8
2
536
Subnets - 2 4 8 16 32 64 128 256.
Binary values - 128 64 32 16 8 4 2 1 . 128 64 32 16 8 4 2 1
165 . 100 . 0 0 0 0 0 0 0 0 . 0 0 0 0 0 0 0 0
(0) . 0 165.100.0.0 to 165.100.0.63
(1) 1 165.100.0.64 to 165.100.0.127
64 128 1 0 165.100.0.128 to 165.100.0.191
(2) 1 1 165.100.0.192 to 165.100.0.255
Usable -2 64
hosts 62 (3)
32
(4) 1 . 0 0 165.100.1.0 to 165.100.1.63
16
(5) 1 . 0 1 165.100.1.64 to 165.100.1.127
8 1 . 1 0 165.100.1.128 to 165.100.1.191
Custom 128 4
(6)
1 . 1 165.100.1.192 to 165.100.1.255
1
subnet mask +64 (7)
2
192 (8) 1 0 . 0 0 165.100.2.0 to 165.100.0.63
+1
The binary value of the last bit borrowed is (9) 1 0 . 0 1 165.100.2.64 to 165.100.0.127
the range. In this problem the range is 64. 255
(10) 1 0 . 1 0 165.100.2.128 to 165.100.0.191
The first address in each subnet range is the 1 0 . 1 1 165.100.2.192 to 165.100.0.255
subnet number.
(11)
The last address in each subnet range is the
(12) 1 1 . 0 0 165.100.3.0 to 165.100.3.63
subnet broadcast address. (13) 1 1 . 0 1 165.100.3.64 to 165.100.3.127
(14) 1 1 . 1 0 165.100.3.128 to 165.100.3.191
(15) 1 1 . 1 1 165.100.3.192 to 165.100.3.255
Show your work for Problem 2 in the space below.
Down to
(1022) 1 1 1 1 1 1 1 1 . 1 0 165.100.255.128 to 165.100.255.191
(1023) 1 1 1 1 1 1 1 1 . 1 1 165.100.255.192 to 165.100.255.255
31
Subnetting
Problem 3
Number of needed subnets 2
Network Address 195.223.50.0
32
Show your work for Problem 3 in the space below.
Number of
256 128 64 32 16 8 4 2 - Hosts
Number of
Subnets - 2 4 8 16 32 64 128 256
128 64 32 16 8 4 2 1 - Binary values
195. 223 . 50 . 0 0 0 0 0 0 0 0
33
Subnetting
Problem 4
Number of needed subnets 750
Network Address 190.35.0.0
34
Show your work for Problem 4 in the space below.
35
Subnetting
Problem 5
Number of needed usable hosts 6
Network Address 126.0.0.0
36
Show your work for Problem 5 in the space below.
37
Subnetting
Problem 6
Number of needed subnets 10
Network Address 192.70.10.0
38
Show your work for Problem 6 in the space below.
39
Subnetting
Problem 7
Network Address 10.0.0.0 /16
40
Show your work for Problem 7 in the space below.
41
Subnetting
Problem 8
Number of needed subnets 5
Network Address 172.50.0.0
42
Show your work for Problem 8 in the space below.
43
Subnetting
Problem 9
Number of needed usable hosts 28
Network Address 172.50.0.0
44
Show your work for Problem 9 in the space below.
45
Subnetting
Problem 10
Number of needed subnets 45
Network Address 220.100.100.0
46
Show your work for Problem 10 in the space below.
47
Subnetting
Problem 11
Number of needed usable hosts 8,000
Network Address 135.70.0.0
48
Show your work for Problem 11 in the space below.
49
Subnetting
Problem 12
Number of needed usable hosts 45
Network Address 198.125.50.0
50
Show your work for Problem 12 in the space below.
51
Subnetting
Problem 13
Network Address 165.200.0.0 /26
52
Show your work for Problem 13 in the space below.
53
Subnetting
Problem 14
Number of needed usable hosts 16
Network Address 200.10.10.0
54
Show your work for Problem 14 in the space below.
55
Subnetting
Problem 15
Network Address 93.0.0.0 \19
56
Show your work for Problem 15 in the space below.
57
IP Address Breakdown
/24 /25 /26 /27 /28 /29 /30
8+8+8 8+8+8+1 8+8+8+2 8+8+8+3 8+8+8+4 8+8+8+5 8+8+8+6
255.255.255.0 255.255.255.128 255.255.255.192 255.255.255.224 255.255.255.240 255.255.255.248 255.255.255.252
256 Hosts 128 Hosts 64 Hosts 32 Hosts 16 Hosts 8 Hosts 4 Hosts
0-3
0-7
4-7
0-15
8-11
8-15
12-15
16-19
16-23
20-23
16-31
24-27
24-31
28-31
0-63
32-35
32-39
36-39
32-47
40-43
40-47
44-47
48-51
48-55
52-55
48-63
56-59
56-63
60-63
0-127
64-67
64-71
68-71
64-79
72-75
72-79
76-79
80-83
80-87
84-87
80-95
88-91
88-95
92-95
64-127
96-99
96-103
100-103
96-111
104-107
104-111
108-111
112-115
112-119
116-119
112-127
120-123
120-127
124-127
0-255
128-131
128-135
132-135
128-143
136-139
136-143
140-143
144-147
144-151
148-151
144-159
152-155
152-159
156-159
128-191
160-163
16-167
164-167
160-175
168-171
168-175
172-175
176-179
176-183
180-183
176-191
184-187
184-191
188-191
128-255
192-195
192-199
196-199
192-207
200-203
200-207
204-207
208-211
208-215
212-215
208-223
216-219
216-223
220-223
192-255
224-227
224-231
228-231
224-239
232-235
232-239
236-239
240-243
240-247
244-247
240-255
248-251
248-255
252-255
79
Visualizing Subnets Using
The Box Method
/24
255.255.255.0
256 Hosts
1 Subnet
/25
255.255.255.128
128 Hosts
2 Subnets
/26
255.255.255.192
64 Hosts
4 Subnets
80
Split each individual square and you
get eight subnets with 32 addresses,
/27
255.255.255.224
32 Hosts
8 Subnets
Split the boxes in half again and you
get sixteen subnets with sixteen
addresses,
/28
255.255.255.240
16 Hosts
16 Subnets
The next split gives you thirty two
subnets with eight addresses,
/29
255.255.255.248
8 Hosts
32 Subnets
The last split gives sixty four subnets
with four addresses each,
/30
255.255.255.252
4 Hosts
64 Subnets
81
Class A Addressing Guide
# of Bits Subnet Total # of Total # of Usable # of
CIDR Borrowed Mask Subnets Hosts Hosts
______________________________________________________________________________________________
/8 0 255.0.0.0 1 16,777,216 16,777,214
_____________________________________________________________________________________________
/9 1 255.128.0.0 2 8,388,608 8,388,606
_____________________________________________________________________________________________
/10 2 255.192.0.0 4 4,194,304 4,194,302
__________________________________________________________________________________________________
/11 3 255.224.0.0 8 2,097,152 2,097,150
______________________________________________________________________________________________
/12 4 255.240.0.0 16 1,048,576 1,048,574
_____________________________________________________________________________________________
/13 5 255.248.0.0 32 524,288 524,286
________________________________________________________________________________________________
/14 6 255.252.0.0 64 262,144 262,142
______________________________________________________________________________________________
/15 7 255.254.0.0 128 131,072 131,070
__________________________________________________________________________________________________
/16 8 255.255.0.0 256 65,536 65,534
___________________________________________________________________________________________________
/17 9 255.255.128.0 512 32,768 32,766
_______________________________________________________________________________________________
/18 10 255.255.192.0 1,024 16,384 16,382
_____________________________________________________________________________________________________
/19 11 255.255.224.0 2,048 8,192 8,190
______________________________________________________________________________________________
/20 12 255.255.240.0 4,096 4,096 4,094
__________________________________________________________________________________________________
/21 13 255.255.248.0 8,192 2,048 2,046
_________________________________________________________________________________________________
/22 14 255.255.252.0 16,384 1,024 1,022
________________________________________________________________________________________________
/23 15 255.255.254.0 32,768 512 510
____________________________________________________________________________________________________
/24 16 255.255.255.0 65,536 256 254
_____________________________________________________________________________________________________
/25 17 255.255.255.128 131,072 128 126
____________________________________________________________________________________________________
/26 18 255.255.255.192 262,144 64 62
___________________________________________________________________________________________________
/27 19 255.255.255.224 524,288 32 30
____________________________________________________________________________________________________
/28 20 255.255.255.240 1,048,576 16 14
____________________________________________________________________________________________________
/29 21 255.255.255.248 2,097,152 8 6
________________________________________________________________________________________________
/30 22 255.255.255.252 4,194,304 4 2