Subnetting Made Easy: A Step-by-Step Guide for CCNA Success

Everything you need to master subnetting for the Cisco CCNA 200-301 exam, from binary basics to VLSM, with worked examples and practice problems.

Published on February 8, 2026 | By IT Cert Bound

1. What Is Subnetting and Why It Matters

Subnetting is the practice of dividing a single IP network into two or more smaller, logical sub-networks called subnets. If IP addressing is the language of the internet, then subnetting is the grammar that gives that language structure, efficiency, and security. For any aspiring network engineer preparing for the CCNA 200-301 exam, subnetting is not just another topic on the syllabus. It is a foundational skill that appears across multiple exam domains, from IP connectivity to network design and troubleshooting.

In a real-world enterprise environment, a company might be allocated a single Class B network such as 172.16.0.0/16, which supports over 65,000 host addresses. Placing every single device on one flat network would be a disaster. Broadcast traffic would overwhelm the network, security boundaries would be nonexistent, and troubleshooting a problem would be like finding a needle in a haystack. Subnetting solves all of these problems by breaking that large address space into smaller, more manageable pieces.

The key benefits of subnetting include:

On the CCNA exam, subnetting questions appear in various forms. You may be asked to determine the correct subnet mask for a given number of hosts, identify which subnet an IP address belongs to, calculate a broadcast address, or design a VLSM addressing scheme. Speed and accuracy are essential because many candidates report that subnetting questions consume a disproportionate amount of exam time if they are not well-practiced.

2. Understanding Binary: The Foundation of Subnetting

Before you can subnet effectively, you must be comfortable converting between decimal and binary. An IPv4 address is a 32-bit number divided into four groups of 8 bits, called octets. Each octet can represent a decimal value from 0 to 255. While we write IP addresses in dotted-decimal notation for human readability (for example, 192.168.1.100), routers and switches process these addresses as streams of ones and zeros.

Binary Place Values

Each bit position in an octet represents a power of two. From left to right, the eight bit positions have the following decimal values:

Bit Position: 7 6 5 4 3 2 1 0 Decimal Value: 128 64 32 16 8 4 2 1

To convert a decimal number to binary, you start with the highest value (128) and work your way down. If the number is greater than or equal to the current value, write a 1 and subtract that value. Otherwise, write a 0 and move to the next position.

Example: Converting 200 to Binary

-- Converting 200 to binary -- 200 >= 128? Yes -> 1 (200 - 128 = 72 remaining) 72 >= 64? Yes -> 1 ( 72 - 64 = 8 remaining) 8 >= 32? No -> 0 8 >= 16? No -> 0 8 >= 8? Yes -> 1 ( 8 - 8 = 0 remaining) 0 >= 4? No -> 0 0 >= 2? No -> 0 0 >= 1? No -> 0 Result: 200 in binary = 11001000

Example: Converting Binary 10101100 to Decimal

-- Converting 10101100 to decimal -- 1 x 128 = 128 0 x 64 = 0 1 x 32 = 32 0 x 16 = 0 1 x 8 = 8 1 x 4 = 4 0 x 2 = 0 0 x 1 = 0 Result: 128 + 32 + 8 + 4 = 172

CCNA Exam Tip

Memorize the powers of two: 1, 2, 4, 8, 16, 32, 64, 128, 256. These values are the backbone of every subnetting calculation. On the exam, you will not have a calculator, so being able to work with these numbers mentally is critical.

3. IP Address Classes and Default Subnet Masks

The original IPv4 addressing architecture divided the address space into five classes. For the CCNA exam, you need to be most familiar with Classes A, B, and C, as these are the classful address ranges used for unicast host communication.

Class First Octet Range Default Mask CIDR Network / Host Bits Max Hosts per Network
A 1 - 126 255.0.0.0 /8 8 / 24 16,777,214
B 128 - 191 255.255.0.0 /16 16 / 16 65,534
C 192 - 223 255.255.255.0 /24 24 / 8 254

The address 127.0.0.0/8 is reserved for loopback testing, so it is not included in Class A. Class D (224-239) is used for multicast, and Class E (240-255) is reserved for experimental purposes. The maximum number of usable hosts on any network is calculated using the formula 2h - 2, where h is the number of host bits. You subtract two because the first address in the range is the network address and the last address is the broadcast address, neither of which can be assigned to a host.

Key Concept: Network vs. Host Portion

In any IP address, the subnet mask determines which bits identify the network and which bits identify the host. Bits set to 1 in the mask represent the network portion; bits set to 0 represent the host portion. Subnetting works by "borrowing" bits from the host portion and reassigning them to the network portion, which creates additional subnets at the cost of fewer hosts per subnet.

4. CIDR Notation Explained

Classless Inter-Domain Routing (CIDR) notation is a compact way of expressing an IP address and its associated subnet mask. Instead of writing out the full dotted-decimal mask, CIDR appends a forward slash and a number to the IP address. That number represents the count of consecutive 1-bits in the subnet mask, starting from the left.

For example, the address 192.168.10.0 with a subnet mask of 255.255.255.0 has 24 consecutive 1-bits in the mask (8 + 8 + 8 = 24), so it is written as 192.168.10.0/24. This notation is more concise and is the standard format you will encounter throughout your networking career and on the CCNA exam.

Here are several common CIDR-to-mask conversions you should commit to memory:

CIDR Subnet Mask Binary Mask (Last Octet) Usable Hosts Total Subnets (from /24)
/24255.255.255.0000000002541
/25255.255.255.128100000001262
/26255.255.255.19211000000624
/27255.255.255.22411100000308
/28255.255.255.240111100001416
/29255.255.255.24811111000632
/30255.255.255.25211111100264

A /30 mask is commonly used for point-to-point links between two routers, since you only need two usable host addresses. A /31 mask is a special case defined in RFC 3021 that provides exactly two addresses with no network or broadcast address, sometimes used on router-to-router WAN links. A /32 represents a single host address, often seen in routing tables or loopback interfaces.

5. Step-by-Step: How to Subnet a Network

The subnetting process can be distilled into a repeatable series of steps. Once you internalize this process, you can solve any subnetting problem quickly and confidently. Here is the method:

  1. Determine the requirements. How many subnets do you need, or how many hosts per subnet? This tells you how many bits to borrow.
  2. Calculate the number of bits to borrow. Use the formula 2n >= required subnets (where n is the number of borrowed bits) or 2h - 2 >= required hosts (where h is the remaining host bits).
  3. Write the new subnet mask. Add the borrowed bits to the original prefix length.
  4. Calculate the block size (increment). The block size equals 256 minus the value of the interesting octet in the subnet mask. This tells you the size of each subnet.
  5. List the subnets. Start at 0 in the interesting octet and increment by the block size.
  6. Identify the network address, first host, last host, and broadcast address for each subnet.

Worked Example 1: Subnetting 192.168.1.0/24 into 4 Subnets

Requirement: A company needs 4 subnets from the 192.168.1.0/24 network.

Step 1: We need 4 subnets. Step 2: 2^n >= 4 -> 2^2 = 4. Borrow 2 bits. Step 3: New prefix = /24 + 2 = /26 New mask = 255.255.255.192 Step 4: Block size = 256 - 192 = 64 Step 5: Subnets start at: 0, 64, 128, 192 Subnet 1: Network: 192.168.1.0/26 First Host: 192.168.1.1 Last Host: 192.168.1.62 Broadcast: 192.168.1.63 Usable Hosts: 62 Subnet 2: Network: 192.168.1.64/26 First Host: 192.168.1.65 Last Host: 192.168.1.126 Broadcast: 192.168.1.127 Usable Hosts: 62 Subnet 3: Network: 192.168.1.128/26 First Host: 192.168.1.129 Last Host: 192.168.1.190 Broadcast: 192.168.1.191 Usable Hosts: 62 Subnet 4: Network: 192.168.1.192/26 First Host: 192.168.1.193 Last Host: 192.168.1.254 Broadcast: 192.168.1.255 Usable Hosts: 62

Worked Example 2: Finding the Subnet for Host 10.1.45.200/20

Requirement: Given the host address 10.1.45.200 with a /20 mask, find the network address, broadcast address, and usable host range.

Step 1: /20 means 20 network bits. Mask: 255.255.240.0 (The interesting octet is the 3rd octet: 240) Step 2: Block size = 256 - 240 = 16 (Subnets in 3rd octet: 0, 16, 32, 48 ...) Step 3: Which block does 45 fall into? 45 / 16 = 2.8125 -> floor(2.8125) = 2 2 x 16 = 32 Next subnet starts at 32 + 16 = 48 Results: Network Address: 10.1.32.0/20 First Usable Host: 10.1.32.1 Last Usable Host: 10.1.47.254 Broadcast Address: 10.1.47.255 Usable Hosts: 2^12 - 2 = 4,094

Worked Example 3: How Many Hosts Do You Need?

Requirement: You need a subnet that can support at least 50 hosts from the 172.16.5.0/24 network. What subnet mask should you use?

Step 1: We need at least 50 usable hosts. Step 2: Find h where 2^h - 2 >= 50 2^5 - 2 = 30 (not enough) 2^6 - 2 = 62 (this works!) We need 6 host bits. Step 3: Total bits = 32. Host bits = 6. Network bits = 32 - 6 = 26 Subnet mask: /26 = 255.255.255.192 Step 4: Block size = 256 - 192 = 64 Subnets: 172.16.5.0/26, 172.16.5.64/26, 172.16.5.128/26, 172.16.5.192/26 Each subnet supports 62 usable hosts.

6. Finding the Network Address, Broadcast Address, and Host Range

For every subnet, you need to be able to quickly identify three critical values: the network address, the broadcast address, and the usable host range. Here is how each one is determined:

Network Address

The network address is the first address in the subnet, where all host bits are set to 0. It identifies the subnet itself and cannot be assigned to any device. To find it, perform a bitwise AND operation between the IP address and the subnet mask, or use the block size method described above.

Broadcast Address

The broadcast address is the last address in the subnet, where all host bits are set to 1. A packet sent to this address is delivered to every host on that subnet. To calculate it, take the network address and set all host bits to 1. Alternatively, the broadcast address is always one less than the next subnet's network address.

Usable Host Range

The first usable host address is the network address plus one. The last usable host address is the broadcast address minus one. Every address between these two values (inclusive) can be assigned to a device on the network.

Quick Method: Using the Block Size

Network Address: The largest multiple of the block size that is less than or equal to the host address in the interesting octet.

Broadcast Address: The network address plus the block size, minus 1.

First Host: Network address + 1.

Last Host: Broadcast address - 1.

Let us apply this to the address 192.168.10.130/25:

Mask: /25 = 255.255.255.128 Block size: 256 - 128 = 128 Subnets: .0 and .128 130 falls in the .128 subnet. Network Address: 192.168.10.128 First Usable Host: 192.168.10.129 Last Usable Host: 192.168.10.254 Broadcast Address: 192.168.10.255 Usable Hosts: 126

7. VLSM: Variable Length Subnet Masking

In the examples above, every subnet was the same size. This is called Fixed Length Subnet Masking (FLSM). While simple, FLSM often wastes IP addresses because real-world networks rarely have departments with identical host requirements. Variable Length Subnet Masking (VLSM) solves this problem by allowing different subnets within the same network to use different subnet mask lengths.

The VLSM Process

  1. Sort your requirements from largest to smallest. Always allocate the biggest subnets first to avoid fragmentation.
  2. Assign the first and largest subnet starting at the base network address.
  3. Calculate the next available network address (the broadcast address of the previous subnet plus one), then assign the next largest subnet there.
  4. Repeat until all requirements are fulfilled.

VLSM Example

Scenario: Given the network 192.168.50.0/24, assign subnets for the following departments:

-- Sort largest to smallest: Sales(100), Engineering(50), Management(20), WAN1(2), WAN2(2) -- Sales (100 hosts): 2^7 - 2 = 126 >= 100 -> /25 (128 addresses) Network: 192.168.50.0/25 Range: 192.168.50.1 - 192.168.50.126 Broadcast: 192.168.50.127 Engineering (50 hosts): 2^6 - 2 = 62 >= 50 -> /26 (64 addresses) Next available: 192.168.50.128 Network: 192.168.50.128/26 Range: 192.168.50.129 - 192.168.50.190 Broadcast: 192.168.50.191 Management (20 hosts): 2^5 - 2 = 30 >= 20 -> /27 (32 addresses) Next available: 192.168.50.192 Network: 192.168.50.192/27 Range: 192.168.50.193 - 192.168.50.222 Broadcast: 192.168.50.223 WAN Link 1 (2 hosts): 2^2 - 2 = 2 >= 2 -> /30 (4 addresses) Next available: 192.168.50.224 Network: 192.168.50.224/30 Range: 192.168.50.225 - 192.168.50.226 Broadcast: 192.168.50.227 WAN Link 2 (2 hosts): Next available: 192.168.50.228 Network: 192.168.50.228/30 Range: 192.168.50.229 - 192.168.50.230 Broadcast: 192.168.50.231 All 5 subnets fit within a single /24 network!

CCNA Exam Tip

VLSM questions on the CCNA exam often present a scenario and ask you to select the most efficient addressing scheme. Always allocate the largest subnet first and work your way down. Watch for answer choices that overlap subnets or exceed the available address space. These are common trap answers.

8. Subnet Mask Cheat Sheet

The following table is your go-to reference for the most commonly used subnet masks. Memorizing at least the /24 through /30 range will save you significant time on the CCNA exam.

CIDR Subnet Mask Block Size Addresses Usable Hosts Common Use
/8255.0.0.0N/A16,777,21616,777,214Class A default
/16255.255.0.0N/A65,53665,534Class B default
/20255.255.240.016 (3rd octet)4,0964,094Large campus segments
/22255.255.252.04 (3rd octet)1,0241,022Large office floors
/24255.255.255.01 (3rd octet)256254Class C default / standard LAN
/25255.255.255.128128128126Medium department
/26255.255.255.192646462Small department
/27255.255.255.224323230Small workgroup
/28255.255.255.240161614Small server VLAN
/29255.255.255.248886Very small segment
/30255.255.255.252442Point-to-point WAN link
/31255.255.255.254222*Router-to-router (RFC 3021)
/32255.255.255.255111*Host route / loopback

* /31 and /32 are special cases. A /31 has no traditional network or broadcast address and is used exclusively for point-to-point links. A /32 identifies a single host and is commonly seen in routing tables and loopback interfaces.

9. CCNA Exam Tips for Subnetting Questions

Subnetting is heavily tested on the CCNA 200-301 exam. Here are the strategies that will help you answer these questions quickly and accurately under exam pressure:

Tip 1: Memorize the Powers of Two

You should be able to instantly recall: 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536. These numbers are the building blocks of every subnetting calculation.

Tip 2: Master the Block Size Method

The fastest way to find network and broadcast addresses is the block size method (256 minus the interesting octet value). Avoid converting to binary on the exam unless absolutely necessary. The block size approach is faster and less error-prone.

Tip 3: Know Your Interesting Octet

The interesting octet is the one where the subnet mask is neither 255 nor 0. For a /20 mask (255.255.240.0), the interesting octet is the third one. For a /27 mask (255.255.255.224), the interesting octet is the fourth. All your calculations happen in this octet.

Tip 4: Watch for "Which Subnet Does This Host Belong To?" Questions

These are the most common subnetting questions on the exam. Use the block size to quickly determine which range the host falls into. You do not need to calculate every subnet; just find the boundaries around the given address.

Tip 5: Double-Check with Boundary Addresses

A common mistake is confusing the broadcast address with the last usable host, or the network address with the first usable host. Always remember: the network address has all host bits as 0, the broadcast address has all host bits as 1, and usable hosts are everything in between.

Tip 6: Practice Daily Until It Becomes Automatic

Subnetting is a skill that improves dramatically with repetition. Spend 10 to 15 minutes every day solving random subnetting problems. Use our Subnetting Practice Tool to generate unlimited problems with instant feedback. Aim for the point where you can solve any subnetting problem in under 30 seconds.

10. Practice Problems with Solutions

Test your understanding with these practice problems. Try to solve each one on your own before revealing the solution. Remember to use the block size method for speed.

Problem 1

A host has the IP address 172.16.94.35/21. What is the network address, broadcast address, and usable host range for this subnet?

Show Solution
Mask: /21 = 255.255.248.0 Block size (3rd octet): 256 - 248 = 8 Multiples of 8: 0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96... 94 falls between 88 and 96. Network Address: 172.16.88.0 First Usable Host: 172.16.88.1 Last Usable Host: 172.16.95.254 Broadcast Address: 172.16.95.255 Usable Hosts: 2^11 - 2 = 2,046

Problem 2

You need to create subnets that each support at least 25 hosts from the network 10.10.10.0/24. What is the correct subnet mask, and how many subnets can you create?

Show Solution
Required hosts per subnet: 25 2^4 - 2 = 14 (not enough) 2^5 - 2 = 30 (this works!) Host bits needed: 5 Network bits: 32 - 5 = 27 Subnet mask: /27 = 255.255.255.224 Bits borrowed from /24: 27 - 24 = 3 Number of subnets: 2^3 = 8 subnets Each with 30 usable hosts. The 8 subnets: 10.10.10.0/27 (hosts: .1 - .30) 10.10.10.32/27 (hosts: .33 - .62) 10.10.10.64/27 (hosts: .65 - .94) 10.10.10.96/27 (hosts: .97 - .126) 10.10.10.128/27 (hosts: .129 - .158) 10.10.10.160/27 (hosts: .161 - .190) 10.10.10.192/27 (hosts: .193 - .222) 10.10.10.224/27 (hosts: .225 - .254)

Problem 3

Two hosts have the following addresses: 192.168.5.140/28 and 192.168.5.155/28. Are they on the same subnet? Explain your reasoning.

Show Solution
Mask: /28 = 255.255.255.240 Block size: 256 - 240 = 16 Subnets: .0, .16, .32, .48, .64, .80, .96, .112, .128, .144, .160 ... Host 1: 192.168.5.140 140 falls between 128 and 144 -> Subnet: 192.168.5.128/28 Host 2: 192.168.5.155 155 falls between 144 and 160 -> Subnet: 192.168.5.144/28 Answer: No, they are NOT on the same subnet. Host 1 is on the 192.168.5.128/28 subnet (range .129-.142). Host 2 is on the 192.168.5.144/28 subnet (range .145-.158). They would need a router to communicate with each other.

Problem 4

Using VLSM, allocate subnets from 10.0.0.0/24 for the following requirements: LAN A needs 60 hosts, LAN B needs 28 hosts, LAN C needs 12 hosts, and two point-to-point WAN links each need 2 hosts.

Show Solution
-- Sort largest to smallest -- LAN A (60 hosts): 2^6 - 2 = 62 >= 60 -> /26 Network: 10.0.0.0/26 Range: 10.0.0.1 - 10.0.0.62 Broadcast: 10.0.0.63 LAN B (28 hosts): 2^5 - 2 = 30 >= 28 -> /27 Network: 10.0.0.64/27 Range: 10.0.0.65 - 10.0.0.94 Broadcast: 10.0.0.95 LAN C (12 hosts): 2^4 - 2 = 14 >= 12 -> /28 Network: 10.0.0.96/28 Range: 10.0.0.97 - 10.0.0.110 Broadcast: 10.0.0.111 WAN Link 1 (2 hosts): 2^2 - 2 = 2 -> /30 Network: 10.0.0.112/30 Range: 10.0.0.113 - 10.0.0.114 Broadcast: 10.0.0.115 WAN Link 2 (2 hosts): Network: 10.0.0.116/30 Range: 10.0.0.117 - 10.0.0.118 Broadcast: 10.0.0.119 All 5 subnets allocated. Addresses 10.0.0.120-255 remain available for future use.

Problem 5

What is the maximum number of usable host addresses on a subnet with the mask 255.255.255.240? What CIDR prefix length does this mask correspond to?

Show Solution
Mask: 255.255.255.240 Binary of 240: 11110000 (4 ones + 4 zeros) Total network bits: 8 + 8 + 8 + 4 = 28 CIDR notation: /28 Host bits: 32 - 28 = 4 Usable hosts: 2^4 - 2 = 14

Conclusion: Make Subnetting Your Superpower

Subnetting is often described as the single most important skill for the CCNA exam, and with good reason. It touches nearly every aspect of network engineering, from IP addressing and routing to access control and network design. The good news is that subnetting is a deterministic, repeatable process. There is no ambiguity or guesswork involved. Once you master the steps outlined in this guide, you will be able to solve any subnetting problem the exam throws at you.

Here is your action plan for mastering subnetting:

  1. Start with the fundamentals. Make sure you are comfortable with binary-to-decimal conversions and understand the relationship between subnet masks and CIDR notation.
  2. Learn one reliable method. The block size method described in this guide is fast and works for every type of subnetting question. Stick with it until it becomes second nature.
  3. Practice every single day. Use our Subnetting Practice Tool to generate random problems. Start with untimed practice, then challenge yourself to complete each problem in under 30 seconds.
  4. Master VLSM. Once you are fast with basic subnetting, move on to VLSM. It appears on the exam and is essential for real-world network design.
  5. Review under exam conditions. Take our Practice Exam to experience subnetting questions in context with other CCNA topics, and build your test-taking stamina.

Subnetting is a skill that separates confident CCNA candidates from those who struggle. Put in the practice time now, and you will walk into the exam knowing that every subnetting question is a guaranteed point in your favor. Good luck on your CCNA journey.