Subnetting practice problems with answers

Updated October 9, 2026

Fifteen free subnetting practice problems with explained answers, from finding a network address to VLSM planning and route summarisation. Subnetting is the skill of splitting an IPv4 network into smaller ones by moving the prefix boundary, and every answer here was recomputed with code. It is tested on the CCNA 200-301, where configuring and verifying IPv4 addressing and subnetting is an explicit objective, and in simpler form on CompTIA Network+ N10-009.

How to use these questions

Work each problem on paper before opening the answer. Write the block size first (256 minus the interesting mask octet), because most problems reduce to counting in multiples of it. Note the constraint word in the stem: “usable”, “smallest”, “exactly” and “broadcast” each change the answer. The method behind every step is in subnetting step by step.

Warm-up: addresses and masks

Question 1. A host is configured as 192.168.10.77/26. What is the network address of its subnet?

  • A. 192.168.10.0
  • B. 192.168.10.64
  • C. 192.168.10.65
  • D. 192.168.10.128
Show answer

Answer: B

A /26 has a block size of 64, so the subnets in the last octet start at 0, 64, 128 and 192. The host address .77 lies in the block that starts at 64, so the network is 192.168.10.64. 192.168.10.0 is the previous block. 192.168.10.65 is the first usable host, not the network address. 192.168.10.128 is the next subnet.

Question 2. How many usable host addresses does a /27 subnet provide?

  • A. 32
  • B. 28
  • C. 30
  • D. 62
Show answer

Answer: C

A /27 leaves 5 host bits, so the subnet holds 2 to the power 5, which is 32 addresses. The network address and the broadcast address are not assignable, which leaves 30 usable hosts. 32 counts the two reserved addresses. 28 is not a power-of-two result. 62 is the usable count of a /26.

Question 3. A new VLAN needs addresses for 50 hosts, and no further growth is planned. Which prefix length is the smallest subnet that fits it?

  • A. /26
  • B. /27
  • C. /25
  • D. /28
Show answer

Answer: A

A /26 has 6 host bits, giving 64 addresses and 62 usable hosts, which covers 50. A /27 gives only 30 usable hosts. A /25 also fits but wastes more addresses, so it is not the smallest. A /28 gives 14 usable hosts.

Question 4. Which dotted-decimal mask corresponds to a /20 prefix?

  • A. 255.255.248.0
  • B. 255.255.252.0
  • C. 255.255.255.240
  • D. 255.255.240.0
Show answer

Answer: D

A /20 means 20 network bits: the first two octets are all ones and the third octet has 4 ones, which is 11110000, or 240. The mask is 255.255.240.0. 255.255.248.0 is /21. 255.255.252.0 is /22. 255.255.255.240 is /28.

Question 5. What is the broadcast address of the subnet that contains 172.16.45.200/20?

  • A. 172.16.45.255
  • B. 172.16.46.255
  • C. 172.16.47.255
  • D. 172.16.255.255
Show answer

Answer: C

A /20 has a block size of 16 in the third octet, so the subnets start at 32, 48 and so on. The address 172.16.45.200 is in the block 172.16.32.0 to 172.16.47.255, so the broadcast address is 172.16.47.255. 172.16.45.255 and 172.16.46.255 would only be correct for a /24 or a /23. 172.16.255.255 is the broadcast of the whole /16.

Scenarios: hosts, boundaries and VLSM

Question 6. A PC is configured with 10.10.10.63 and mask 255.255.255.192, and the default gateway 10.10.10.1. The PC cannot communicate at all. What is wrong?

  • A. The address is the broadcast address of its subnet
  • B. The address is the network address of its subnet
  • C. The PC and the gateway are in different subnets
  • D. 255.255.255.192 is not a valid subnet mask
Show answer

Answer: A

With mask 255.255.255.192 the subnet is 10.10.10.0/26, which spans .0 to .63. The address .63 is therefore the broadcast address of the subnet and cannot be assigned to a host. It is not the network address, which is .0. The gateway .1 is in the same subnet, so the two are not in different subnets. The mask is valid.

Question 7. All interfaces use the mask 255.255.255.192. Which pair of hosts is in the same subnet?

  • A. 10.0.0.62 and 10.0.0.65
  • B. 10.0.0.127 and 10.0.0.128
  • C. 10.0.0.191 and 10.0.0.192
  • D. 10.0.0.130 and 10.0.0.190
Show answer

Answer: D

With a block size of 64 the subnets are .0-.63, .64-.127, .128-.191 and .192-.255. The hosts 10.0.0.130 and 10.0.0.190 are both inside 10.0.0.128/26. The pair .62 and .65 straddles the boundary at 64. The pair .127 and .128 straddles the boundary at 128. The pair .191 and .192 straddles the boundary at 192.

Question 8. What is the last usable host address in the subnet 10.4.8.0/21?

  • A. 10.4.15.255
  • B. 10.4.15.254
  • C. 10.4.8.254
  • D. 10.4.16.254
Show answer

Answer: B

A /21 has a block size of 8 in the third octet, so 10.4.8.0/21 spans 10.4.8.0 to 10.4.15.255. The broadcast address is 10.4.15.255, so the last usable host is 10.4.15.254. 10.4.15.255 is the broadcast address. 10.4.8.254 and 10.4.16.254 are the last hosts of a /24, which is not the mask in use, and 10.4.16.254 is outside the subnet.

Question 9. Four contiguous networks, 192.168.0.0/24, 192.168.1.0/24, 192.168.2.0/24 and 192.168.3.0/24, must be advertised as one summary route that covers exactly these networks and nothing else. Which summary is correct?

  • A. 192.168.0.0/23
  • B. 192.168.0.0/21
  • C. 192.168.0.0/22
  • D. 192.168.0.0/24
Show answer

Answer: C

The third octets 0 to 3 differ only in the last two bits, so the common prefix is 22 bits: 192.168.0.0/22. A /23 would cover only 192.168.0.0 and 192.168.1.0. A /21 covers 192.168.0.0 to 192.168.7.255 and so includes four networks that are not in the list. A /24 is a single network.

Question 10. The block 192.168.5.0/24 must be divided with VLSM into three LANs of 100, 50 and 25 hosts, allocated largest first. Which allocation is valid?

  • A. 192.168.5.0/25, 192.168.5.128/26, 192.168.5.192/27
  • B. 192.168.5.0/26, 192.168.5.64/26, 192.168.5.128/27
  • C. 192.168.5.0/25, 192.168.5.64/26, 192.168.5.192/27
  • D. 192.168.5.0/25, 192.168.5.128/27, 192.168.5.192/27
Show answer

Answer: A

100 hosts need a /25 (126 usable): 192.168.5.0/25. 50 hosts need a /26 (62 usable) and 25 hosts need a /27 (30 usable); placed after the first block they are 192.168.5.128/26 and 192.168.5.192/27, with no overlap. Using a /26 for 100 hosts gives only 62. Placing the 50-host LAN at 192.168.5.64/26 overlaps the first /25. Using a /27 for 50 hosts gives only 30.

Question 11. A point-to-point link between two routers uses the subnet 10.1.1.8/30. R1 has 10.1.1.9. Which address can be configured on R2?

  • A. 10.1.1.8
  • B. 10.1.1.10
  • C. 10.1.1.11
  • D. 10.1.1.12
Show answer

Answer: B

A /30 spans 10.1.1.8 to 10.1.1.11 with two usable hosts, .9 and .10. R1 already uses .9, so R2 takes .10. 10.1.1.8 is the network address. 10.1.1.11 is the broadcast address. 10.1.1.12 belongs to the next /30 subnet and would not be in the same subnet as R1.

Question 12. A router and a switch that support RFC 3021 are connected by a point-to-point link configured as 10.1.1.0/31. How many addresses can be assigned to devices on this link?

  • A. None, because a /31 has no usable hosts
  • B. One, because the other address is the network address
  • C. Two, with no network or broadcast address
  • D. Two, plus a network and a broadcast address
Show answer

Answer: C

RFC 3021 allows a 31-bit prefix on point-to-point links, with both addresses used as host addresses and no network or broadcast address. The link therefore carries two usable addresses, 10.1.1.0 and 10.1.1.1. The classic rule that gives zero usable hosts applies when the platform does not support /31 links. One usable host is not a result of any rule. A /31 has only two addresses in total, so it cannot also reserve two of them as network and broadcast and still offer two hosts.

Question 13. The networks 172.16.21.0/24, 172.16.22.0/24, 172.16.23.0/24 and 172.16.24.0/24 must be covered by a single summary route. Which is the smallest single summary that includes all four?

  • A. 172.16.16.0/20
  • B. 172.16.20.0/22
  • C. 172.16.21.0/22
  • D. 172.16.16.0/21
Show answer

Answer: A

In binary the third octets 21 (00010101) and 24 (00011000) share only their first four bits, 0001, so the common prefix is 16 + 4 = 20 bits: 172.16.16.0/20, which covers 172.16.16.0 to 172.16.31.255. A /22 at 172.16.20.0 covers 20 to 23 and misses 24. A /22 at 172.16.21.0 does not start on a /22 boundary. A /21 at 172.16.16.0 covers 16 to 23 and also misses 24.

Question 14. A host has the address 192.168.20.37 with mask 255.255.255.224. Which address is a valid default gateway for this host?

  • A. 192.168.20.32
  • B. 192.168.20.62
  • C. 192.168.20.63
  • D. 192.168.20.64
Show answer

Answer: B

The mask 255.255.255.224 is /27 with a block size of 32, so the host lives in 192.168.20.32/27, spanning .32 to .63. The last usable address, 192.168.20.62, is in the same subnet and can be a gateway. 192.168.20.32 is the network address. 192.168.20.63 is the broadcast address. 192.168.20.64 is in the next subnet, so the host could not reach it without already having a gateway.

Question 15. The network 172.16.0.0/16 must be divided into equal subnets that each hold at least 400 hosts, while producing as many subnets as possible. Which mask should be used?

  • A. 255.255.252.0
  • B. 255.255.255.0
  • C. 255.255.255.128
  • D. 255.255.254.0
Show answer

Answer: D

400 hosts need 9 host bits (510 usable), so the longest prefix that works is /23, mask 255.255.254.0, which gives 128 subnets. A /24 gives 256 subnets but only 254 usable hosts, which is too few. A /22 (255.255.252.0) fits 1022 hosts but gives only 64 subnets, so it does not maximise the count. A /25 holds only 126 hosts.

Where to go next

Read the subnetting step by step guide for the method, then continue with ACL practice questions, which use wildcard masks built from the same block sizes, and OSPF practice questions. When the topic feels solid, take the free 20-question CCNA practice test and read the multiple-choice exam tips.