Subnetting practice trainer
Subnetting is a skill of repetition. This trainer generates new questions without limit, checks your answer at once and shows the working, so you can see which step went wrong. Pick one question type to drill a weak spot or use mixed mode.
How to work a question quickly
- Write the prefix as a mask. A /26 leaves 6 host bits, so the last octet changes in steps of 64 (256 − 192).
- Find the block: the network address is the largest multiple of the block size that is not above the address.
- The broadcast address is the next block start minus 1. The usable range lies between the network and broadcast addresses.
- Usable hosts are 2^host bits − 2. A /31 (point-to-point, RFC 3021) has 2 usable addresses and a /32 is a single host.
Worked example. For 192.168.4.77/26 the block size is 64, so the network is 192.168.4.64, the broadcast address is 192.168.4.127, the first host is .65, the last host is .126 and there are 62 usable hosts.
What the question types ask
Pick a single type to drill a weak spot, or leave it on mixed. The trainer has eleven question types plus mixed mode:
- Network, broadcast, first usable and last usable address for a host address with a prefix between /17 and /30.
- Usable hosts for a prefix, from /16 to /30.
- Prefix to subnet mask and subnet mask to prefix, for prefixes /9 to /30.
- Wildcard mask, the subnet mask with every bit flipped, as used in access lists and OSPF network statements.
- Number of subnets when a /16, /20 or /24 is split into longer prefixes.
- Prefix for a number of hosts: the longest prefix that still holds at least that many usable hosts.
- Same subnet? yes or no for two addresses under one mask.
Address answers must be typed in dotted decimal. Numbers are typed as digits, and yes or no questions accept y or n.
More worked examples
A mask that stops in the third octet. Find the subnet of 172.16.37.200/21. A /21 is 255.255.248.0, and the mask stops in the third octet, so the block size is 256 − 248 = 8 in that octet. The value 37 lies in the block 32 to 39. The network is 172.16.32.0, the broadcast address is 172.16.39.255, the usable range is 172.16.32.1 to 172.16.39.254, and there are 2^11 − 2 = 2,046 usable hosts. The fourth octet plays no part in finding the block, which is the step most often missed.
A small block. For 10.1.1.100/28 the mask is 255.255.255.240 and the block size is 16. The value 100 lies in the block 96 to 111, so the network is 10.1.1.96 and the broadcast address is 10.1.1.111. Usable hosts run from .97 to .110, which is 14.
Sizing a subnet. A site needs 50 hosts. Add two for the network and broadcast addresses to get 52, and the next power of two is 64, which is 2^6, so six host bits remain and the prefix is /26. That gives 62 usable hosts. A /27 gives only 30, so it is too small.
Splitting a network. Splitting a /24 into /27 subnets borrows 3 bits, so you get 2^3 = 8 subnets with 30 usable hosts each.
Same subnet? With 192.168.10.130 and 192.168.10.190 under a /26, the blocks are 0, 64, 128 and 192. Both addresses fall in 128 to 191, so the answer is yes. Replace the second address with 192.168.10.200 and it sits in the 192 block, so the answer is no.
Wildcard. For a /26 the mask is 255.255.255.192, so the wildcard is 0.0.0.63. For a /21 it is 0.0.7.255.
Common mistakes
- Forgetting to subtract 2 for the network and broadcast addresses, then treating a /26 as having 64 hosts.
- Using the fourth octet for the block size when the mask stops earlier.
- Off-by-one errors on the broadcast address: it is the next network address minus 1.
- Confusing the subnet mask with the wildcard mask, or reading 255.255.255.224 as /28 instead of /27 (24 + 3 ones).
- Overlooking the special cases: a /31 has two usable addresses on a point-to-point link, and a /32 is a single host.
How to practise
Spend a week on single types, ten questions per sitting, saying the block size aloud before you write anything. Then use mixed mode and aim for a streak of fifteen. If the trainer gives you a wrong answer, read the working it shows before the next question, since it names the octet and the block. When prefix-to-mask is instant, you are ready to move on to variable-length subnet design.
If binary is the weak point, do the binary and hex drill first; mask octets are the link between the two tools.
The full method, with more examples, is in subnetting step by step. Exams that test it include CCNA 200-301 and Network+ N10-009; written questions are in the subnetting practice questions.