IPv4 Addressing & Subnetting
CCNA 200-301 · Network Fundamentals
Subnetting is the skill the CCNA exam tests most heavily in the Network Fundamentals domain, and it is the one candidates most often under-practise. The good news is that subnetting is pure arithmetic: there are no opinions and no tricks, only a method. Learn one reliable method, drill it until it is fast, and a whole category of exam questions becomes free points. This guide teaches the block-size method, which works for every subnetting question the exam can ask.
IPv4 addresses and the subnet mask
An IPv4 address is 32 bits, written as four decimal octets. The subnet mask divides those 32 bits into a network portion and a host portion: the network portion identifies the subnet, and the host portion identifies the individual device within it. A mask written as /24 means the first 24 bits are network bits; in dotted decimal that is 255.255.255.0. The number of host bits determines how many addresses a subnet holds: 2 raised to the number of host bits. A /24 has 8 host bits, so 2^8 = 256 addresses — but two of those are unusable for hosts. The first address (all host bits zero) is the network address, and the last address (all host bits one) is the broadcast address. So a /24 gives 254 usable host addresses. The formula to remember is: usable hosts = 2^(host bits) - 2.
Subnetting means borrowing bits from the host portion to create more, smaller networks. Take 192.168.1.0/24 and borrow 2 bits: the mask becomes /26, which creates 2^2 = 4 subnets, each with 6 host bits and therefore 2^6 - 2 = 62 usable hosts. The general rules are: number of subnets = 2^(borrowed bits), and hosts per subnet = 2^(remaining host bits) - 2.
The block-size method
The fastest way to answer subnetting questions is the block size: the size of each subnet in the interesting octet. Find the octet where the mask is neither 255 nor 0 — the interesting octet — and subtract the mask value there from 256. For a /26 mask (255.255.255.192), the interesting octet is the fourth, and the block size is 256 - 192 = 64. So the /26 subnets of 192.168.1.0 are 192.168.1.0, 192.168.1.64, 192.168.1.128, and 192.168.1.192. Each block runs from its network address to one less than the next network address: the 192.168.1.64 subnet covers .64 to .127, with broadcast .127 and usable hosts .65 to .126.
Worked example: what subnet does 192.168.10.77/27 belong to? The mask is 255.255.255.224, so the block size is 256 - 224 = 32. The subnets start at .0, .32, .64, .96, and so on. The address 77 falls between 64 and 96, so its network address is 192.168.10.64, its broadcast is 192.168.10.95, and its usable range is .65 to .94. The same method works in any octet: for 10.20.30.45/20, the mask is 255.255.240.0, the interesting octet is the third, and the block size is 256 - 240 = 16. Subnets start at .0, .16, .32 in the third octet, so 30 falls in the 10.20.16.0 subnet, which runs to 10.20.31.255.
VLSM: right-sizing subnets
Fixed-length subnetting wastes addresses: if one department needs 100 hosts and another needs 10, giving both a /25 wastes over a hundred addresses on the small department. VLSM (Variable Length Subnet Masking) lets each subnet use a different mask sized to its need. The method is to allocate the largest requirement first, then the next, and so on. From 192.168.1.0/24, a department needing 100 hosts gets a /25 (126 usable): 192.168.1.0/25, covering .0 to .127. The next department, needing 50 hosts, gets a /26 (62 usable): 192.168.1.128/26, covering .128 to .191. The last, needing 25 hosts, gets a /27 (30 usable): 192.168.1.192/27, covering .192 to .223. Nothing overlaps, nothing is wasted beyond the rounding of each block, and .224 to .255 remains free for growth. The exam loves VLSM questions because they test whether you can pick the smallest mask that fits each requirement — always size the mask to the requirement, and always allocate largest first so the blocks line up cleanly.
Private IPv4 addressing
Three address ranges are reserved for private use by RFC 1918 and are never routed on the public internet: 10.0.0.0/8 (10.0.0.0 to 10.255.255.255), 172.16.0.0/12 (172.16.0.0 to 172.31.255.255), and 192.168.0.0/16 (192.168.0.0 to 192.168.255.255). Devices using these addresses reach the internet through NAT, which translates the private address to a public one. The exam's favourite trap here is the 172.16.0.0/12 range: because the mask is /12, the second octet runs from 16 to 31 — so 172.31.5.10 is private, but 172.32.1.1 is public. Other special ranges worth knowing: 127.0.0.0/8 is loopback (127.0.0.1 is your own host), 169.254.0.0/16 is APIPA link-local, and 224.0.0.0/4 is multicast.
Configuring and verifying addresses
On a Cisco router, you assign an address with ip address 192.168.1.1 255.255.255.0 in interface configuration mode, and verify with show ip interface brief and show ip route. On a switch, management addressing goes on a switched virtual interface (SVI) such as interface vlan 1. The exam also tests the logic of address assignment: a host's address, mask, and default gateway must agree — a host at 192.168.1.50/24 with a gateway of 192.168.2.1 cannot reach its gateway, because the gateway is on a different subnet. When a scenario says a host cannot reach anything beyond its own subnet, check the gateway first; when it cannot reach even local devices, check the address and mask.
Subnetting quickly: the mental shortcuts
Speed matters on the exam, so practise these shortcuts until they are reflexes. First, memorise the powers of two up to 2^8: 2, 4, 8, 16, 32, 64, 128, 256 — every subnetting calculation uses them. Second, memorise the mask-to-hosts table for the last octet: /25 gives 126 hosts, /26 gives 62, /27 gives 30, /28 gives 14, /29 gives 6, /30 gives 2. Third, when you need a block size, subtract the interesting-octet mask value from 256 rather than working in binary — 256 minus 240 is 16, and that is the answer. Fourth, to find which subnet an address belongs to, divide the interesting octet by the block size and round down, then multiply back: for 10.20.30.45/20, the block size is 16, 30 divided by 16 rounds down to 1, and 1 times 16 is 16, so the network is 10.20.16.0. Drill these moves daily for a few weeks — ten minutes a day with random addresses — and subnetting questions will take seconds instead of minutes, which frees up time for the simulation questions where the real marks are won and lost.
Exam traps to watch for
- Forgetting to subtract 2 for the network and broadcast addresses when counting usable hosts. A /26 has 64 addresses but only 62 usable hosts.
- Saying 172.32.0.0 is private. The private range is 172.16.0.0/12, which ends at 172.31.255.255.
- In VLSM questions, allocating the smallest requirement first. Always allocate the largest block first or the subnets will not line up.
- Confusing the number of subnets with the number of hosts: borrowing n bits creates 2^n subnets, and the remaining host bits determine hosts per subnet.
Practice questions
Test yourself on this guide. Answers are checked instantly, with a full explanation for each question.
Q1.How many usable host addresses are available in a /26 subnet?
Explanation: A /26 leaves 6 host bits: 2^6 = 64 total addresses, minus 2 for the network and broadcast addresses, gives 62 usable host addresses. Option A (64) is the total address count, forgetting to subtract the network and broadcast addresses. Option B (30) is the usable count for a /27, which has 5 host bits. Option C (126) is the usable count for a /25, which has 7 host bits.
Exam objective: 200-301 1.6: Configure and verify IPv4 addressing and subnetting — usable hosts
Q2.What is the network address of the subnet containing 192.168.5.130/26?
Explanation: A /26 mask is 255.255.255.192, so the block size is 256 - 192 = 64. The subnets start at .0, .64, .128, and .192. The address 130 falls between 128 and 192, so its network address is 192.168.5.128 (usable range .129-.190, broadcast .191). Option B (.64) is the previous subnet, which covers .64-.127 and does not contain .130. Option C is the host address itself, not a network address. Option D (.192) is the next subnet, which starts above .130.
Exam objective: 200-301 1.6: Configure and verify IPv4 addressing and subnetting — network address
Q3.What is the broadcast address of the subnet containing 10.20.30.45/20?
Explanation: A /20 mask is 255.255.240.0, so the interesting octet is the third and the block size is 256 - 240 = 16. The subnets in the third octet start at 0, 16, 32, 48. The address 30 falls in the subnet starting at 16, which runs from 10.20.16.0 to 10.20.31.255 — so the broadcast address is 10.20.31.255. Option A (.30.255) is wrong because it treats the mask as /24. Option B (.15.255) is the broadcast of the previous subnet (10.20.0.0/20). Option D (.47.255) is the broadcast of the next subnet (10.20.32.0/20).
Exam objective: 200-301 1.6: Configure and verify IPv4 addressing and subnetting — broadcast address
Q4.A network segment needs at least 30 usable host addresses. Which is the smallest subnet mask that meets the requirement with the least waste?
Explanation: A /27 has 5 host bits: 2^5 - 2 = 30 usable host addresses, which exactly meets the requirement of at least 30. Option A is wrong because a /28 provides only 14 usable hosts — too few. Option C is wrong because although a /25 provides enough addresses (126), it wastes far more than necessary; the question asks for the smallest mask that fits. Option D is wrong because a /30 provides only 2 usable hosts, suitable only for point-to-point links.
Exam objective: 200-301 1.6: Configure and verify IPv4 addressing and subnetting — sizing subnets
Q5.An engineer is subnetting 192.168.1.0/24 with VLSM. The largest department needs 60 hosts. Which subnet should be assigned to it first?
Explanation: The largest requirement is allocated first, and it needs the smallest mask that fits 60 hosts: a /26 provides 62 usable hosts, so 192.168.1.0/26 is the correct assignment. Option A is wrong because a /27 provides only 30 usable hosts — too few for 60 hosts. Option B is wrong because a /28 provides only 14. Option C is wrong because a /25 would work but wastes 64 addresses that other departments need; VLSM is about right-sizing each subnet.
Exam objective: 200-301 1.6: Configure and verify IPv4 addressing and subnetting — VLSM
Q6.Which address is a valid host address in the 172.16.8.0/22 subnet?
Explanation: A /22 mask is 255.255.252.0, so the block size in the third octet is 256 - 252 = 4. The subnet 172.16.8.0/22 covers 172.16.8.0 through 172.16.11.255, with usable hosts from 172.16.8.1 to 172.16.11.254 — so 172.16.10.5 is valid. Option B is the network address itself. Option C is the broadcast address of this subnet. Option D belongs to the next subnet, 172.16.12.0/22.
Exam objective: 200-301 1.6: Configure and verify IPv4 addressing and subnetting — valid host address
Q7.How many subnets are created when 192.168.1.0/24 is subnetted with a /27 mask?
Explanation: Moving from /24 to /27 borrows 3 bits from the host portion, and 2^3 = 8 subnets are created (each with 30 usable hosts). Option A (4) is the result of borrowing 2 bits (/26). Option B (16) is the result of borrowing 4 bits (/28). Option D (32) is the result of borrowing 5 bits (/29).
Exam objective: 200-301 1.6: Configure and verify IPv4 addressing and subnetting — subnet count
Q8.Which of the following addresses is a private IPv4 address?
Explanation: The private range 172.16.0.0/12 covers 172.16.0.0 through 172.31.255.255, so 172.31.5.10 is private. Option A is wrong because 172.32.0.0 is just outside the /12 range and is public address space. Option C is wrong because the 11.0.0.0/8 range is public (the private Class A range is 10.0.0.0/8). Option D is wrong because 192.169.1.1 is public — the private range is 192.168.0.0/16, not 192.169.0.0/16.
Exam objective: 200-301 1.7: Describe private IPv4 addressing
Q9.How many subnets are created when the 10.0.0.0/8 network is subnetted with a /11 mask?
Explanation: Moving from /8 to /11 borrows 3 bits, and 2^3 = 8 subnets are created (each a /11 with over 2 million host addresses). Option A (3) confuses the number of borrowed bits with the number of subnets. Option B (6) has no basis in the binary math. Option C (16) is the result of borrowing 4 bits (/12).
Exam objective: 200-301 1.6: Configure and verify IPv4 addressing and subnetting — subnet count
Q10.What is the first usable host address in the 192.168.100.64/26 subnet?
Explanation: The /26 subnet 192.168.100.64 covers .64 to .127. The network address is .64 and the broadcast is .127, so the first usable host address is .65 and the last is .126. Option B is the network address, which cannot be assigned to a host. Option C is the last usable host address, not the first. Option D is the broadcast address.
Exam objective: 200-301 1.6: Configure and verify IPv4 addressing and subnetting — usable range