IPv4 Addressing & Subnetting

CCNA 200-301 · Network Fundamentals

By Abu Anns · Last updated 20 November 2026Exam version: 200-301 v1.1 (current until 2 Feb 2027)

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.

Advertisement

Exam traps to watch for

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?

Report an error

Q2.What is the network address of the subnet containing 192.168.5.130/26?

Report an error

Q3.What is the broadcast address of the subnet containing 10.20.30.45/20?

Report an error

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?

Report an error

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?

Report an error

Q6.Which address is a valid host address in the 172.16.8.0/22 subnet?

Report an error

Q7.How many subnets are created when 192.168.1.0/24 is subnetted with a /27 mask?

Report an error

Q8.Which of the following addresses is a private IPv4 address?

Report an error

Q9.How many subnets are created when the 10.0.0.0/8 network is subnetted with a /11 mask?

Report an error

Q10.What is the first usable host address in the 192.168.100.64/26 subnet?

Report an error