CCNA Subnetting Cheat Sheet: Master CIDR in Minutes

Subnetting is the topic CCNA candidates fear most — and the one with the highest return on study time. Learn the magic-number method once, and you can answer any subnetting question in under a minute.

CIDR Notation: What the Slash Means

An IPv4 address is 32 bits long. CIDR notation like /26 tells you how many of those 32 bits are the network portion. The rest are host bits — and host bits determine how many addresses each subnet holds.

The two formulas you need:

Memorize this table — it answers half of all subnetting questions by itself:

CIDRSubnet maskAddressesUsable hosts
/24255.255.255.0256254
/25255.255.255.128128126
/26255.255.255.1926462
/27255.255.255.2243230
/28255.255.255.2401614
/29255.255.255.24886
/30255.255.255.25242

The Magic-Number Method

Forget binary math under exam pressure. The magic-number (block-size) method finds any subnet's network ID, broadcast address, and usable range in three steps:

  1. Find the interesting octet — the octet where the mask is neither 255 nor 0. For 255.255.255.192, that is the fourth octet.
  2. Compute the magic number — 256 minus the mask value in that octet. For 192: 256 − 192 = 64. Subnets increment by 64 in that octet: 0, 64, 128, 192.
  3. Locate the address — find which block your IP falls into. That block's start is the network ID; the address just before the next block is the broadcast address; everything between is usable.

Why it works: the magic number is the block size of each subnet in the interesting octet. Once you have it, every subnet boundary is just a multiple of that number — no binary conversion needed.

Worked Example 1: A /26 Network

Question: for 192.168.10.70/26, what are the network ID, broadcast address, and usable range?

Mask is 255.255.255.192, so the fourth octet is interesting. Magic number: 256 − 192 = 64. Subnets step by 64: 0, 64, 128, 192.

The address .70 falls in the 64 block. So:

Total: 64 addresses, 62 usable hosts. Done in under a minute.

Worked Example 2: A /20 Network

Question: how many subnets and hosts does 10.20.0.0/20 provide?

A /20 mask is 255.255.240.0 — the third octet is interesting. Magic number: 256 − 240 = 16. Subnets step by 16 in the third octet: 10.20.0.0, 10.20.16.0, 10.20.32.0, and so on.

Notice the broadcast: because the block spans the third octet by 16, the last address of the 10.20.16.0 subnet is 10.20.31.255 — the classic spot where candidates who only think in fourth-octet terms go wrong.

Worked Example 3: A /28 Network

Question: a point-to-point link needs 12 host addresses. What is the smallest subnet that fits, and what is its range starting at 172.16.8.0?

You need 12 usable hosts, so you need at least 14 addresses (12 + network + broadcast). From the table, /28 gives 16 addresses / 14 usable — the smallest fit. A /29 only gives 6 usable, which is too small.

Mask 255.255.255.240, magic number 256 − 240 = 16:

Exam Traps That Cost Points

  1. Forgetting to subtract 2. "How many hosts in a /27?" is 30, not 32. The two exceptions are /31 (2 usable addresses, used on point-to-point links per RFC 3021 — no network/broadcast reserved) and /32 (a single host address, used for loopbacks and host routes).
  2. Mixing up "subnets" and "hosts." If a question asks how many subnets a mask creates versus how many hosts each holds, slow down and identify which one is being asked. Borrowed bits make subnets; remaining host bits make hosts.
  3. Subnet zero confusion. Modern exams assume subnet-zero is usable (it has been for decades). The first subnet starting at .0 is valid — do not skip it.
  4. Wrong interesting octet. For masks like 255.255.240.0, the action is in the third octet. Candidates who default to fourth-octet math get the broadcast address wrong every time.
  5. VLSM sizing. "Smallest subnet for 50 hosts" means the smallest mask with at least 52 addresses: /26 (62 usable). Always add 2 before comparing to the table.

Frequently Asked Questions

Do I really need to memorize the subnet mask table for the CCNA?
Yes — or at least be able to rebuild it in seconds. Subnetting appears across multiple CCNA domains (IP connectivity, IP services, automation), and fast recall turns several questions into free points. The /24–/30 range in the table above covers the vast majority of exam questions.
What is the difference between a /31 and a /30?
A /30 provides 4 addresses with 2 usable, traditionally used for point-to-point links. A /31 provides exactly 2 addresses with both usable (defined by RFC 3021), which wastes no addresses on network and broadcast IDs — but it only works on true point-to-point links, not multi-access networks.
How do I know which octet is the "interesting" one?
It is the first octet, reading left to right, where the mask value is neither 255 nor 0. In 255.255.240.0 that is the third octet (240); in 255.255.255.192 it is the fourth (192). Everything left of it is network, everything right of it counts in blocks of 256.
Is classful networking (Class A/B/C) still on the CCNA?
The concepts survive as background: default masks (/8, /16, /24) and why classful boundaries matter when a question says "subnet the Class B network 172.16.0.0." Modern routing is classless (CIDR), so exam questions test whether you can work from any starting prefix, not just classful defaults.

Ready to test yourself?

Try 900 original CCNA 200-301 practice questions with detailed explanations — free 30-question sample quiz, no sign-up needed.

Start the CCNA Practice Exams