Practice Questions - Subnetting -1
Subnetting is one of the most important concepts in computer networking and a must-have skill for network engineers, cybersecurity professionals, and IT students. It helps in dividing a large IP network into smaller, manageable sub-networks, improving performance, security, and efficient IP address utilization.
In this blog series, you will learn subnetting step-by-step with simple explanations, real examples, and hands-on practice questions.
Question #1
What is the range of assignable IP addresses for a subnet containing an IP address of 172.16.1.10 /19?a. 172.16.0.1 – 172.16.31.254b. 172.16.0.1 – 172.16.63.254c. 172.16.0.0 – 172.16.31.255d. 172.16.0.1 – 172.16.31.255e. 172.16.0.0 – 172.16.63.254Question #2You are assigning IP addresses to hosts in the 192.168.4.0 /26 subnet. Which two of the following IP addresses are assignable IP addresses that reside in that subnet?a. 192.168.4.0b. 192.168.4.63c. 192.168.4.62d. 192.168.4.32e. 192.168.4.64Question #3A host in your network has been assigned an IP address of 192.168.181.182 /25. What is the subnet to which the host belongs?a. 192.168.181.128 /25b. 192.168.181.0 /25c. 192.168.181.176 /25d. 192.168.181.192 /25e. 192.168.181.160 /25Question #4You are working with a Class B network with the private IP address of 172.16.0.0 /16. You need to maximize the number of broadcast domains, where each broadcast domain can accommodate 1000 hosts. What subnet mask should you use?a. /22b. /23
c. /24
d. /25
e. /26
Question #5
What is the directed broadcast address of a subnet containing an IP address of 172.16.1.10 /19?
a. 172.16.15.255
b. 172.16.31.255
c. 172.16.255.255
d. 172.16.95.255
e. 172.16.0.255
Question #6
A customer is using a Class C network of 192.168.10.0 subnetted with a 28-bit subnet mask. How many subnets can be created by using this subnet mask?
a. 32
b. 16
c. 30
d. 8
e. 14
Question #7
Given a subnet of 172.16.56.0 /21, identify which of the following IP addresses belong to this subnet. (Select 2.)
a. 172.16.54.129
b. 172.16.62.255
c. 172.16.61.0
d. 172.16.65.255
e. 172.16.64.1
Question #8
What is the subnet address of the IP address 192.168.5.55 with a subnet mask of 255.255.255.224?
a. 192.168.5.0 /27
b. 192.168.5.16 /27
c. 192.168.5.32 /27
d. 192.168.5.48 /27
e. 192.168.5.64 /27
Question #9
You are working for a company that will be using the 192.168.1.0 /24 private IP address space for IP addressing inside their organization.
They have multiple geographical locations and want to carve up the 192.168.1.0 /24 address space into subnets. Their largest subnet will need 13 hosts.
What subnet mask should you use to accommodate at least 13 hosts per subnet, while maximizing the number of subnets that can be created?
a. 255.255.255.248
b. 255.255.255.224
c. 255.255.255.252
d. 255.255.255.192
e. 255.255.255.240
Question #10
A customer is using a Class C network of 192.168.10.0 subnetted with a 28-bit subnet mask. How many assignable addresses are available in each of the subnets?
a. 32
b. 16
c. 30
d. 8
e. 14
Question #11
An IP address of 192.168.0.100 /27 belongs to which of the following subnets?
a. 192.168.0.92
b. 192.168.0.128
c. 192.168.0.64
d. 192.168.0.96
e. 192.168.0.32
Question #12
What subnet mask should be used to subnet the 192.168.10.0 network to support the number of subnets and IP addresses per subnet shown in the following topology?
What is the range of assignable IP addresses for a subnet containing an IP address of 172.16.1.10 /19?
a. 172.16.0.1 – 172.16.31.254
b. 172.16.0.1 – 172.16.63.254
c. 172.16.0.0 – 172.16.31.255
d. 172.16.0.1 – 172.16.31.255
e. 172.16.0.0 – 172.16.63.254
Answer: a
To determine the subnets, assignable IP address ranges, and directed broadcast addresses created by the 19-bit subnet mask we perform the following steps:
Step #1: Identify the interesting octet (i.e. the octet that contains the first zero in the binary subnet mask).
In this question, we have a 19-bit subnet mask, which is written in binary as:
11111111 11111111 11100000 00000000
The interesting octet is the third octet, because the third octet (i.e. 11100000) is the first octet to contain a 0 in the binary.
Step #2: Identify the decimal value in the interesting octet of the subnet mask.
A 19-bit subnet mask can be written in dotted decimal notation as: 255.255.224.0
Since the third octet is the interesting octet, the decimal value in the interesting octet is 224.
Step #3: Determine the block size by subtracting the decimal value of the interesting octet from 256.
Block Size = 256 – 224 = 32
Step #4: Determine the subnets by counting by the block size in the interesting octet, starting at 0.
Placing a zero in the first interesting octet identifies the first subnet as:
Looking through the subnets created by the 19-bit subnet mask reveals that the IP address of 172.16.1.10 resides in the 172.16.0.0 /19 subnet.
The directed broadcast address, where all host bits are set to a 1, is 1 less than the next subnet address.
The next subnet address is 172.16.32.0. So, the directed broadcast address for the 172.16.0.0 /19 subnet is 1 less than 172.16.32.0, which is:
172.16.31.255
The usable IP addresses are all the IP addresses between the subnet address and the directed broadcast address. Therefore, in this example, the assignable IP address range for the 172.16.0.0 /19 network is:
172.16.0.1 – 172.16.31.254
Question #2
You are assigning IP addresses to hosts in the 192.168.4.0 /26 subnet. Which two of the following IP addresses are assignable IP addresses that reside in that subnet?
a. 192.168.4.0
b. 192.168.4.63
c. 192.168.4.62
d. 192.168.4.32
e. 192.168.4.64
Answer: c and d
In this question, we have a 26-bit subnet mask, which is written in binary as:
11111111 11111111 11111111 11000000
The interesting octet is the forth octet, because the forth octet (i.e. 11000000) is the first octet to contain a 0 in the binary.
Step #2: Identify the decimal value in the interesting octet of the subnet mask.
A 26-bit subnet mask can be written in dotted decimal notation as: 255.255.255.192
Since the forth octet is the interesting octet, the decimal value in the interesting octet is 192.
Step #3: Determine the block size by subtracting the decimal value of the interesting octet from 256.
Block Size = 256 – 192 = 64
Step #4: Determine the subnets by counting by the block size in the interesting octet, starting at 0.
Placing a zero in the first interesting octet identifies the first subnet as:
192.168.4.0 /26
We then count by the block size (of 64) in the interesting octet (the forth octet in this question) to determine the remaining subnets:
192.168.4.64 /26
192.168.4.128 /26
192.168.4.192 /26
Step #5:
This question is asking about the 192.168.4.0 /26 subnet. From the above list of subnets, we can determine that the assignable range of IP addresses for this subnet is 192.168.4.1 – 192.168.4.62. We can also determine that 192.168.4.0 is the network address, and 192.168.4.63 is the directed broadcast address.
a. 192.168.181.128 /25
b. 192.168.181.0 /25
c. 192.168.181.176 /25
d. 192.168.181.192 /25
e. 192.168.181.160 /25
Answer: a
To determine subnets and usable address ranges created by the 25-bit subnet mask we perform the following steps:
Step #1: Identify the interesting octet (i.e. the octet that contains the first zero in the binary subnet mask).
In this question, we have a 25-bit subnet mask, which is written in binary as:
11111111 11111111 11111111 10000000
The interesting octet is the forth octet, because the forth octet (i.e. 10000000) is the first octet to contain a 0 in the binary.
Step #2: Identify the decimal value in the interesting octet of the subnet mask.
A 25-bit subnet mask can be written in dotted decimal notation as: 255.255.255.128
Since the forth octet is the interesting octet, the decimal value in the interesting octet is 128.
Step #3: Determine the block size by subtracting the decimal value of the interesting octet from 256.
Block Size = 256 – 128 = 128
Step #4: Determine the subnets by counting by the block size in the interesting octet, starting at 0.
Placing a zero in the first interesting octet identifies the first subnet as:
192.168.181.0 /25
Question #4
You are working with a Class B network with the private IP address of 172.16.0.0 /16. You need to maximize the number of broadcast domains, where each broadcast domain can accommodate 1000 hosts. What subnet mask should you use?
a. /22
b. /23
c. /24
d. /25
e. /26
Answer: a
In addition to testing your knowledge of subnetting, this question is also making sure you understand that a subnet is a broadcast domain. This should not be confused with a collision domain (i.e. each port on a switch is in its own collision domain).
To determine how many host bits are required to support 1000 hosts, we can create a table from the following formula:
Number of Hosts = 2h – 2, where h is the number of host bits
From this formula, we can create the following table:
1 Host Bit => 0 Hosts
2 Host Bits => 2 Hosts
3 Host Bits => 6 Hosts
4 Host Bits => 14 Hosts
5 Host Bits => 30 Hosts
Question #5
What is the directed broadcast address of a subnet containing an IP address of 172.16.1.10 /19?
a. 172.16.15.255
b. 172.16.31.255
c. 172.16.255.255
d. 172.16.95.255
e. 172.16.0.255
Answer: b
To determine the subnets, assignable IP address ranges, and directed broadcast addresses created by the 19-bit subnet mask we perform the following steps:
Step #1: Identify the interesting octet (i.e. the octet that contains the first zero in the binary subnet mask).
In this question, we have a 19-bit subnet mask, which is written in binary as:
11111111 11111111 11100000 00000000
The interesting octet is the third octet, because the third octet (i.e. 11100000) is the first octet to contain a 0 in the binary.
Step #2: Identify the decimal value in the interesting octet of the subnet mask.
A 19-bit subnet mask can be written in dotted decimal notation as: 255.255.224.0
Since the third octet is the interesting octet, the decimal value in the interesting octet is 224.
Placing a zero in the first interesting octet identifies the first subnet as:
172.16.0.0 /19
We then count by the block size (of 32) in the interesting octet (the third octet in this question) to determine the remaining subnets:
172.16.32.0 /19
172.16.64.0 /19
172.16.96.0 /19
172.16.128.0 /19
172.16.160.0 /19
172.16.192.0 /19
172.16.224.0 /19
Step #5: Identify the subnet address, the directed broadcast address, and the usable range of addresses.
Looking through the subnets created by the 19-bit subnet mask reveals that the IP address of 172.16.1.10 resides in the 172.16.0.0 /19 subnet.
The directed broadcast address, where all host bits are set to a 1, is 1 less than the next subnet address.
The next subnet address is 172.16.32.0. So, the directed broadcast address for the 172.16.0.0 /19 subnet is 1 less than 172.16.32.0, which is:
172.16.31.255
The usable IP addresses are all the IP addresses between the subnet address and the directed broadcast address. Therefore, in this example, the assignable IP address range for the 172.16.0.0 /19 network is:
172.16.0.1 – 172.16.31.254
Question #6
A customer is using a Class C network of 192.168.10.0 subnetted with a 28-bit subnet mask. How many subnets can be created by using this subnet mask?
a. 32
b. 16
c. 30
Number of Subnets = 2s, where s is the number of borrowed bits.
Therefore, in this question, the number of created subnets is 16:
Number of Subnets = 24 = 16
Question #7
Given a subnet of 172.16.56.0 /21, identify which of the following IP addresses belong to this subnet. (Select 2.)
a. 172.16.54.129
b. 172.16.62.255
c. 172.16.61.0
d. 172.16.65.255
e. 172.16.64.1
Answer: b, c
To determine subnets and usable address ranges created by the 21-bit subnet mask we perform the following steps:
Step #1: Identify the interesting octet (i.e. the octet that contains the first zero in the binary subnet mask).
In this question, we have a 21-bit subnet mask, which is written in binary as:
11111111 11111111 11111000 00000000
The interesting octet is the third octet, because the third octet (i.e. 11111000) is the first octet to contain a 0 in the binary subnet mask.
Block Size = 256 – 248 = 8
Step #4: Determine the subnets by counting by the block size in the interesting octet, starting at 0.
Placing a zero in the first interesting octet identifies the first subnet as:
172.16.0.0 /21
We then count by the block size (of 8) in the interesting octet (the third octet in this question) to determine the remaining subnets:
172.16.8.0 /21 172.16.16.0 /21 172.16.24.0 /21 172.16.32.0 /21 172.16.40.0 /21 172.16.48.0 /21 172.16.56.0 /21 172.16.64.0 /21 ... SUBNETS OMITTED ...
We can stop counting after we pass the subnet we are being asked about. Specifically, in this question, we’re being asked about 172.16.56.0 /21.
Step #5: Identify the subnet address, the directed broadcast address, and the usable range of addresses.
The subnet address, where all host bits are set to a 0, is given:
172.16.56.0 /24
The directed broadcast address, where all host bits are set to a 1, is 1 less than the next subnet address.
The next subnet address is 172.16.64.0. So, the directed broadcast address for the 172.16.54.0 /21 subnet is 1 less than 172.16.64.0, which is: 172.16.63.255
While that would only be true of the subnet mask were 24-bits, remember that, by definition, a subnet address has all of its host bits set to a 0, and a directed broadcast address has all of its host bits set to a 1. In this question, we have 11 host bits (i.e. 32 – 21 = 11), not 8 host bits. So, 172.16.62.255 and 172.16.61.0 are actually usable IP addresses.
Question #8
What is the subnet address of the IP address 192.168.5.55 with a subnet mask of 255.255.255.224?
a. 192.168.5.0 /27
b. 192.168.5.16 /27
c. 192.168.5.32 /27
d. 192.168.5.48 /27
e. 192.168.5.64 /27
Answer: c
To determine subnets and usable address ranges created by the 27-bit subnet mask we perform the following steps:
Step #1: Identify the interesting octet (i.e. the octet that contains the first zero in the binary subnet mask).
In this question, we have a 27-bit subnet mask, which is written in binary as:
11111111 11111111 11111111 11100000
The interesting octet is the forth octet, because the forth octet (i.e. 11100000) is the first octet to contain a 0 in the binary.
Step #2: Identify the decimal value in the interesting octet of the subnet mask.
Block Size = 256 – 224 = 32
Step #4: Determine the subnets by counting by the block size in the interesting octet, starting at 0.
Placing a zero in the first interesting octet identifies the first subnet as:
192.168.5.0 /27
We then count by the block size (of 32) in the interesting octet (the forth octet in this question) to determine the remaining subnets:
192.168.5.32 /27
192.168.5.64 /27
192.168.5.96 /27
192.168.5.128 /27
192.168.5.160 /27
192.168.5.192 /27
192.168.5.224 /27
Now that we have all of our subnets identified, we can determine the subnet in which the IP address of 192.168.5.55 resides.
Since the usable range of IP addresses for the 192.168.5.32 /27 network is 192.168.5.33 – 192.168.5.62 (because 192.168.5.32 is the network address, and 192.168.5.63 is the directed broadcast address), and since 192.168.5.55 is in that range, the subnet to which 192.168.5.55 /27 belongs is:
192.168.5.32 /27
Question #9
You are working for a company that will be using the 192.168.1.0 /24 private IP address space for IP addressing inside their organization.
They have multiple geographical locations and want to carve up the 192.168.1.0 /24 address space into subnets. Their largest subnet will need 13 hosts.
What subnet mask should you use to accommodate at least 13 hosts per subnet, while maximizing the number of subnets that can be created?
We can determine the maximum number of hosts allowed in a subnet by raising the number 2 to the power of the number of host bits and then subtracting 2. So, the formula looks like this:
Maximum Number of Hosts per Subnet = 2h – 2, where h is the number of host bits.
Why are we subtracting two? Well, there are two IP addresses in the subnet that cannot be assigned. These addresses are: (1) the network address, where all of the host bits are set to a 0 and (2) the directed broadcast address, where all of the host bits are set to a 1.
In the actual exam, if you are given scratch paper or access to a note taking application, you might want to write out a table such as the following for your reference:
2 Host Bits: 22 – 2 = 2
3 Host Bits: 23 – 2 = 6
4 Host Bits: 24 – 2 = 14
5 Host Bits: 25 – 2 = 30
6 Host Bits: 26 – 2 = 62
7 Host Bits: 27 – 2 = 126
8 Host Bits: 28 – 2 = 254
In this question, we’re asked to determine a subnet mask that accommodates at least 13 hosts per subnet. By looking at the reference table we created, we can see that 4 host bits (which support 14 hosts) would work, while 3 host bits (which supports only 6 hosts) would not be enough.
So, we need a subnet with 4 host bits, which are enough host bits to meet the design goal, but not more than we need. Using more host bits than we need would violate the requirement to maximize the number of subnets.
A subnet mask with 4 host bits has 28 network bits (i.e. 32 – 4 = 28), and therefore a 28-bit subnet mask. A 28-bit subnet mask can be written as:
a. 32
b. 16
c. 30
d. 8
e. 14
Answer: e
An IPv4 address contains a total of 32 bits. Since, in this question, we have 28 subnet bits, the number of host bits is 4 (i.e. 32 – 28 = 4). The number of assignable IP addresses in a subnet can be calculated as follows:
Number of Assignable IP Addresses = 2h – 2, where h is the number of host bits.
Therefore, in this question, each subnet has 14 assignable IP addresses:
Number of Assignable IP Addresses = 24 – 2 = 16 – 2 = 14
Question #11
An IP address of 192.168.0.100 /27 belongs to which of the following subnets?
a. 192.168.0.92
b. 192.168.0.128
c. 192.168.0.64
d. 192.168.0.96
e. 192.168.0.32
Answer: d
To determine the subnets created by the 27-bit subnet mask we perform the following steps:
Step #1: Identify the interesting octet (i.e. the octet that contains the first zero in the binary subnet mask).
In this question, we have a 19-bit subnet mask, which is written in binary as:
A 27-bit subnet mask can be written in dotted decimal notation as: 255.255.255.224
Since the forth octet is the interesting octet, the decimal value in the interesting octet is 224.
Step #3: Determine the block size by subtracting the decimal value of the interesting octet from 256.
Block Size = 256 – 224 = 32
Step #4: Determine the subnets by counting by the block size in the interesting octet, starting at 0.
Placing a zero in the first interesting octet identifies the first subnet as:
192.168.0.0 /27
We then count by the block size (of 32) in the interesting octet (the forth octet in this question) to determine the remaining subnets:
192.168.0.32 /27
192.168.0.64 /27
192.168.0.96 /27
192.168.0.128 /27
192.168.0.160 /27
192.168.0.192 /27
192.168.0.224 /27
Step #5: Identify the subnet address of the IP address 192.168.0.100 /27.
Question #12
Since 6 host bits meet our requirement of at least 50 IP addresses per subnet, we can use a 26-bit subnet mask (i.e. 2 bits added to the Class C default mask (also known as the natural mask) of 24 bits). A 26-bit subnet mask can be written as: