Subnetting for CCNA: The Complete Beginner's Guide
Subnetting is the topic that trips up more CCNA candidates than any other. This step-by-step guide breaks it down clearly — from binary basics to calculating subnet masks, host ranges, and broadcast addresses.
Subnetting for CCNA: The Complete Beginner's Guide
Ask any CCNA instructor what topic causes the most exam failures, and the answer is almost always the same: subnetting.
It's not that subnetting is impossibly difficult. It's that most candidates try to memorize it before they understand it — and memorization without understanding falls apart under exam pressure.
This guide takes a different approach. We'll build your understanding from the ground up, so subnetting becomes something you can work through logically rather than something you have to remember.
Why Subnetting Matters
IP addresses are finite. IPv4 gives us approximately 4.3 billion addresses — which sounds like a lot until you consider that every device on every network needs one.
Subnetting is how we divide a large block of IP addresses into smaller, more manageable networks. It lets network engineers:
- Organize devices logically (by department, floor, function)
- Reduce broadcast traffic
- Improve security by isolating network segments
- Use IP address space efficiently
On the CCNA exam, subnetting questions appear in multiple domains — not just IP addressing. You'll need to subnet quickly and accurately to answer routing, troubleshooting, and network design questions correctly.
The Foundation: Binary and IP Addresses
An IPv4 address is 32 bits long, written as four octets separated by dots. Each octet is 8 bits, and each bit has a value:
128 64 32 16 8 4 2 1
So the octet 10000000 in binary equals 128 in decimal. The octet 11000000 equals 192 (128 + 64).
Practice converting between binary and decimal until it's automatic. This is the single most important skill for subnetting.
What Is a Subnet Mask?
A subnet mask tells you which part of an IP address identifies the network and which part identifies the host.
A subnet mask is also 32 bits. The network portion is represented by 1s, and the host portion by 0s.
For example:
255.255.255.0in binary is11111111.11111111.11111111.00000000- This means the first 24 bits are the network, and the last 8 bits are for hosts
- In CIDR notation, this is written as
/24
CIDR Notation
CIDR (Classless Inter-Domain Routing) notation is a shorthand for subnet masks. Instead of writing 255.255.255.0, you write /24 — the number of 1-bits in the subnet mask.
Common subnet masks and their CIDR equivalents:
| Subnet Mask | CIDR | Network Bits | Host Bits |
|---|---|---|---|
| 255.0.0.0 | /8 | 8 | 24 |
| 255.255.0.0 | /16 | 16 | 16 |
| 255.255.255.0 | /24 | 24 | 8 |
| 255.255.255.128 | /25 | 25 | 7 |
| 255.255.255.192 | /26 | 26 | 6 |
| 255.255.255.224 | /27 | 27 | 5 |
| 255.255.255.240 | /28 | 28 | 4 |
| 255.255.255.248 | /29 | 29 | 3 |
| 255.255.255.252 | /30 | 30 | 2 |
Calculating the Number of Hosts
The formula for usable hosts per subnet is:
2^(host bits) - 2
We subtract 2 because the first address in any subnet is the network address (all host bits = 0) and the last address is the broadcast address (all host bits = 1). Neither can be assigned to a device.
Examples:
/24has 8 host bits → 2^8 - 2 = 254 usable hosts/26has 6 host bits → 2^6 - 2 = 62 usable hosts/30has 2 host bits → 2^2 - 2 = 2 usable hosts (used for point-to-point links)
Working Through a Subnetting Problem
Let's work through a real example step by step.
Given: IP address 192.168.10.65/26
Find: Network address, broadcast address, first usable host, last usable host, number of usable hosts.
Step 1: Identify the subnet mask
/26 = 26 network bits = 11111111.11111111.11111111.11000000 = 255.255.255.192
Step 2: Find the block size
The block size is 256 - the interesting octet value. The interesting octet is the last non-255 octet.
256 - 192 = 64
This means subnets increment in blocks of 64: 0, 64, 128, 192.
Step 3: Find which subnet the address belongs to
Our host address is 192.168.10.65. The fourth octet is 65.
Which block of 64 does 65 fall in? It's between 64 and 128, so the network address is 192.168.10.64.
Step 4: Calculate the remaining values
- Network address:
192.168.10.64(first address in the block) - Broadcast address:
192.168.10.127(last address before the next block starts at 128) - First usable host:
192.168.10.65 - Last usable host:
192.168.10.126 - Usable hosts: 2^6 - 2 = 62
The Magic Number Method
The block size approach above is sometimes called the "magic number" method, and it's the fastest way to subnet on the exam. Here's the shortcut:
- Find the interesting octet (the one that's not 255 or 0 in the subnet mask)
- Calculate:
256 - interesting octet value = block size - Count up in block sizes from 0 to find your subnet
- Network address = start of that block; Broadcast = one before the next block
Practice this until you can do it in under 30 seconds per problem.
Common Subnetting Mistakes on the CCNA Exam
Forgetting to subtract 2 from the host count: The network and broadcast addresses are not usable. Always subtract 2.
Confusing network address with first usable host: The network address (all host bits = 0) cannot be assigned to a device. The first usable host is network address + 1.
Getting the broadcast address wrong: The broadcast address is the last address in the subnet — one before the next subnet starts. It's not the same as the last usable host.
Running out of time: Subnetting questions can be time-consuming if you're not practiced. Set a target of 30–45 seconds per subnetting question and practice until you hit it consistently.
Practice Problems
Work through these on your own before checking the answers:
- What is the network address for
172.16.45.200/20? - How many usable hosts are in a
/27subnet? - What is the broadcast address for
10.0.0.130/25? - A network needs to support 50 hosts. What is the smallest subnet that works?
(Answers: 1. 172.16.32.0 | 2. 30 | 3. 10.0.0.255 | 4. /26 with 62 usable hosts)
Building Speed Through Repetition
Understanding subnetting is the first step. Speed comes from repetition. Before your exam, you should be able to:
- Convert any octet between binary and decimal in under 5 seconds
- Calculate the block size for any subnet mask instantly
- Identify the network, broadcast, and host range for any IP/prefix combination in under 45 seconds
Use online subnet calculators to check your work while practicing — but don't rely on them. The exam doesn't allow calculators.
Next Steps
Subnetting is one of the most important skills you'll develop for the CCNA — and one of the most satisfying once it clicks. Once you can subnet confidently, a significant portion of the exam becomes much more manageable.
If you want structured practice with expert feedback, our CCNA training programs include dedicated subnetting labs and instructor support. We also offer a 90-Day Pass Guarantee* on eligible programs.
*If you complete all program requirements and don't pass within 3 months, we'll reimburse your exam cost.
Explore Topics
Written by
SJTech Solutions Group
Content creator and writer sharing insights and stories.