CCNA Subnetting: Free Practice Questions + Study Guide

MB
Moussa BENALI
Senior Network & Security Engineer · 6+ years of experience designing and securing enterprise networks. CCNA, Security+, and AWS certified.
Verified for CCNA 200-301 · Feb 2026

What is Subnetting?

Subnetting is the process of dividing a large IP network into smaller, manageable subnetworks. By borrowing bits from the host portion of an IP address and assigning them to the network portion, you create multiple smaller networks from a single address block. Each subnet functions as an independent broadcast domain with its own network address, usable host range, and broadcast address.

Subnetting is arguably the single most important skill tested on the CCNA 200-301 exam. It underpins virtually every other networking concept you will encounter - from OSPF route advertisement and ACL configuration to NAT translation and VLAN addressing. If you cannot subnet quickly and accurately, you will struggle with a significant portion of the exam.

📝
CCNA Exam Note: Subnetting is fundamental to the IP Addressing domain, which represents approximately 25% of the CCNA 200-301 exam. You MUST be able to calculate subnets quickly and accurately. Expect 10-15 questions that directly or indirectly require subnetting skills.

Why subnetting matters in real networks:

  • Efficient IP allocation - instead of wasting an entire /24 (254 addresses) on a point-to-point link that only needs 2 addresses, subnetting lets you allocate a /30 with exactly 2 usable hosts
  • Broadcast domain reduction - smaller subnets mean fewer hosts generating and receiving broadcast traffic, directly improving network performance
  • Security segmentation - subnets create natural boundaries where firewalls, ACLs, and security policies can be enforced between departments or security zones
  • Routing efficiency - well-designed subnets enable route summarization, which reduces the size of routing tables and speeds up convergence
  • Simplified troubleshooting - logically organized subnets make it far easier to identify where a problem resides and isolate it from the rest of the network

Binary and Decimal Conversion

Before you can master subnetting, you must be fluent in converting between binary and decimal. Every IP address and subnet mask is a 32-bit binary number, and understanding how those bits work is the foundation of every subnet calculation.

Each octet (8 bits) of an IP address represents a decimal value from 0 to 255. The bit positions correspond to powers of 2, from 27 (128) on the left to 20 (1) on the right:

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

This row of values - 128, 64, 32, 16, 8, 4, 2, 1 - should be permanently committed to memory. Every subnet calculation you perform on the CCNA exam relies on these numbers.

Converting Binary to Decimal

To convert a binary octet to decimal, add up the values of all bit positions where the bit is 1:

Binary to Decimal Example
Binary:  1 1 0 0 1 0 0 0
Values: 128 64 32 16  8  4  2  1
          x  x        x
         128+64      +8          = 200

So 11001000 in binary = 200 in decimal

Converting Decimal to Binary

To convert a decimal number to binary, start from the largest value (128) and work right. If the value fits, write a 1 and subtract it. If it does not fit, write a 0:

Decimal to Binary Example
Decimal: 195

128 fits into 195? Yes → 1   (195 - 128 = 67)
 64 fits into  67? Yes → 1   ( 67 -  64 =  3)
 32 fits into   3? No  → 0
 16 fits into   3? No  → 0
  8 fits into   3? No  → 0
  4 fits into   3? No  → 0
  2 fits into   3? Yes → 1   (  3 -   2 =  1)
  1 fits into   1? Yes → 1   (  1 -   1 =  0)

195 in decimal = 11000011 in binary
💡
Quick Reference - Powers of 2: 20=1, 21=2, 22=4, 23=8, 24=16, 25=32, 26=64, 27=128, 28=256. For subnetting, you primarily use 21 through 28. The total addresses in a subnet is always a power of 2.

While the CCNA exam does not ask you to convert entire IP addresses to binary, the ability to quickly break down a single octet into binary is essential for determining which subnet an IP address belongs to, especially for "odd" prefix lengths like /19 or /21 where the subnet boundary falls in the middle of the third octet.

Subnet Mask Basics

A subnet mask is a 32-bit value that defines which portion of an IP address identifies the network and which portion identifies the host. Every bit set to 1 belongs to the network portion, and every bit set to 0 belongs to the host portion. The subnet mask is always a contiguous string of 1s followed by a contiguous string of 0s - you will never see 1s and 0s intermixed.

The three default (classful) subnet masks are:

  • /8 (255.0.0.0) - Class A default. 8 network bits, 24 host bits. 16,777,214 usable hosts.
  • /16 (255.255.0.0) - Class B default. 16 network bits, 16 host bits. 65,534 usable hosts.
  • /24 (255.255.255.0) - Class C default. 24 network bits, 8 host bits. 254 usable hosts.

In modern networking, we go far beyond these defaults. Here is the complete reference table of common subnet masks you must know for the CCNA exam, as documented in RFC 1878:

CIDR Subnet Mask Total IPs Usable Hosts Block Size
/24255.255.255.0256254256
/25255.255.255.128128126128
/26255.255.255.192646264
/27255.255.255.224323032
/28255.255.255.240161416
/29255.255.255.248868
/30255.255.255.252424
Key Formula: For any prefix length, the number of usable hosts = 2(32 - prefix) - 2. You subtract 2 because the first address 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 host.

The block size (also called the increment or magic number) tells you the gap between consecutive subnet network addresses. To find it: Block Size = 256 - subnet mask octet value. For example, with a /26 mask (255.255.255.192): 256 - 192 = 64. Subnets start at .0, .64, .128, .192.

Calculating Subnets Step by Step

Let's work through two complete examples using the systematic approach that will let you solve any subnetting question on the CCNA exam.

Example 1: 192.168.1.0/26

Given the network 192.168.1.0/26, find: the network address, broadcast address, first and last usable hosts, and the number of usable hosts.

Step-by-Step: 192.168.1.0/26
Given: 192.168.1.0/26

Step 1: Identify the subnet mask
  /26 = 255.255.255.192
  Binary: 11111111.11111111.11111111.11000000
  Network bits: 26, Host bits: 6

Step 2: Calculate the block size
  256 - 192 = 64
  Subnets in the last octet: .0, .64, .128, .192

Step 3: Identify the subnet containing .0
  192.168.1.0 falls in the first block (0-63)

Step 4: Determine key addresses
  Network address:  192.168.1.0   (first address in block)
  First usable:     192.168.1.1   (network + 1)
  Last usable:      192.168.1.62  (broadcast - 1)
  Broadcast:        192.168.1.63  (last address in block)

Step 5: Count usable hosts
  2^6 - 2 = 64 - 2 = 62 usable hosts

Example 2: 10.0.0.0/20

This example demonstrates subnetting when the boundary falls in an octet other than the fourth. Given 10.0.0.0/20, find the subnet details.

Step-by-Step: 10.0.0.0/20
Given: 10.0.0.0/20

Step 1: Identify the subnet mask
  /20 = 255.255.240.0
  The "interesting" octet is the 3rd (240)
  Binary: 11111111.11111111.11110000.00000000
  Network bits: 20, Host bits: 12

Step 2: Calculate the block size (in the 3rd octet)
  256 - 240 = 16
  Third-octet subnets: .0, .16, .32, .48, .64, ...

Step 3: Determine key addresses
  Network address:  10.0.0.0
  First usable:     10.0.0.1
  Last usable:      10.0.15.254
  Broadcast:        10.0.15.255

  (The broadcast is found by going to the next subnet
   boundary 10.0.16.0 and subtracting 1 = 10.0.15.255)

Step 4: Count usable hosts
  2^12 - 2 = 4096 - 2 = 4,094 usable hosts
💡
Shortcut: To quickly find the broadcast address, identify the next subnet's network address and subtract 1. For 10.0.0.0/20, the next subnet is 10.0.16.0 (block size of 16 in the third octet). Subtract 1 to get 10.0.15.255 - that is your broadcast address.

This method works universally regardless of where the subnet boundary falls. The key steps are always the same: find the block size, determine which block the address falls in, then calculate the network address (first address), broadcast address (last address), and the usable host range in between.

VLSM (Variable Length Subnet Masking)

Variable Length Subnet Masking (VLSM) allows you to use different subnet mask lengths within the same network. Instead of forcing all subnets to be the same size (which wastes addresses on small subnets), VLSM lets you allocate exactly the right amount of address space to each subnet based on its actual host requirements.

Consider a company with four departments that needs an addressing plan from the 10.1.0.0/24 network:

VLSM Design Example
Requirements:
  Department A: 100 hosts → need /25 (126 usable hosts)
  Department B:  50 hosts → need /26 ( 62 usable hosts)
  Department C:  25 hosts → need /27 ( 30 usable hosts)
  Two point-to-point WAN links: 2 hosts each → need /30 (2 usable)

Rule: Always allocate the LARGEST subnet first, then work down.

1. Dept A (100 hosts): 10.1.0.0/25
   Range: 10.1.0.1 - 10.1.0.126   (126 usable)
   Next available: 10.1.0.128

2. Dept B (50 hosts): 10.1.0.128/26
   Range: 10.1.0.129 - 10.1.0.190  (62 usable)
   Next available: 10.1.0.192

3. Dept C (25 hosts): 10.1.0.192/27
   Range: 10.1.0.193 - 10.1.0.222  (30 usable)
   Next available: 10.1.0.224

4. WAN Link 1: 10.1.0.224/30
   Range: 10.1.0.225 - 10.1.0.226  (2 usable)
   Next available: 10.1.0.228

5. WAN Link 2: 10.1.0.228/30
   Range: 10.1.0.229 - 10.1.0.230  (2 usable)

Total used: 128 + 64 + 32 + 4 + 4 = 232 out of 256
Remaining: 24 addresses for future growth
⚠️
Important: Always allocate the largest subnets first to prevent address space fragmentation. Each subnet must start at a valid boundary for its size - a /26 must start at a multiple of 64, a /27 at a multiple of 32, and so on. Point-to-point links use /30 (2 usable hosts) or /31 (2 usable hosts per RFC 3021).

Without VLSM, if you used a fixed /26 for every subnet, Department A (needing 100 hosts) would not fit at all (62 usable hosts is insufficient), and the WAN links would waste 60 addresses each. VLSM is the standard approach in modern network design and is a critical CCNA exam skill.

CIDR Notation

Classless Inter-Domain Routing (CIDR) replaced the rigid classful addressing system (Class A, B, C) in 1993 with RFC 4632. Under classful addressing, networks could only be /8, /16, or /24, leading to enormous waste. A company needing 300 addresses would have to be assigned an entire Class B (/16 with 65,534 addresses) because a Class C (/24 with 254 addresses) was too small. CIDR allows any prefix length from /0 to /32, enabling precise allocation.

The /notation (slash notation) simply represents the number of network bits in the subnet mask. For example, /20 means 20 bits are used for the network portion and 12 bits remain for hosts. This notation is more concise than writing 255.255.240.0 and is universally used in modern networking.

Supernetting / Route Summarization

CIDR also enables supernetting, which is the reverse of subnetting. Instead of splitting a network into smaller pieces, supernetting combines multiple contiguous networks into a single, larger summary route. This is critical for reducing the size of routing tables:

Route Summarization Example
Four contiguous /24 networks in a routing table:
  192.168.0.0/24   (192.168.0.0   - 192.168.0.255)
  192.168.1.0/24   (192.168.1.0   - 192.168.1.255)
  192.168.2.0/24   (192.168.2.0   - 192.168.2.255)
  192.168.3.0/24   (192.168.3.0   - 192.168.3.255)

Can be summarized into a single route:
  192.168.0.0/22   (192.168.0.0   - 192.168.3.255)
  1,024 total addresses | 1,022 usable hosts

How: Moving the prefix 2 bits left (/24 → /22)
combines 2^2 = 4 networks into one summary route.

Binary proof  -  the first two octets are identical,
and the third octet ranges from 0 (00000000) to 3 (00000011).
The first 22 bits are common: 192.168.000000xx.xxxxxxxx
So the summary is /22.
💡
Tip: For supernetting to work, the networks must be contiguous, and the starting address must fall on a natural boundary for the summary prefix length. You can summarize 192.168.0.0/24 through 192.168.3.0/24 into /22, but you cannot summarize 192.168.1.0/24 through 192.168.4.0/24 because 192.168.1.0 is not on a /22 boundary (which must be a multiple of 4 in the third octet).
Included with Exam Purchase

Get the Complete CCNA Study Guide

When you purchase a CCNA practice exam, you get full access to our comprehensive study guides covering every exam topic in depth - not just the free samples here.

All CCNA topics covered Detailed explanations 10 free preview pages
Create Free Account to Preview

CCNA Subnetting Practice Questions

Test your understanding with these 5 expert-created questions. Each includes a detailed explanation with step-by-step binary math to reinforce your learning.

Ready for More?

You've just covered Subnetting. Here's how to keep preparing for your CCNA:

Frequently Asked Questions

Is subnetting heavily tested on the CCNA exam?

Yes, subnetting is one of the most heavily tested topics on the CCNA 200-301 exam. It falls within the IP Addressing domain, which represents approximately 25% of the exam. You must be able to calculate subnet masks, determine network and broadcast addresses, identify usable host ranges, and apply VLSM quickly and accurately. Many other exam topics - such as OSPF, ACLs, NAT, and VLAN design - also require solid subnetting skills to answer correctly, making it the single most important skill to master.

How can I subnet faster during the exam?

The fastest method is the "magic number" (block size) technique combined with memorized powers of 2. For any subnet mask octet value, subtract it from 256 to get the block size (e.g., 256 - 192 = 64). Subnets then increment by the block size: .0, .64, .128, .192. Memorize the key prefix lengths and their usable host counts: /25 = 126, /26 = 62, /27 = 30, /28 = 14, /29 = 6, /30 = 2. Also memorize the bit-value row (128, 64, 32, 16, 8, 4, 2, 1). With daily practice over 2-3 weeks, you can solve most subnetting questions in 15-30 seconds without writing anything down.

What is the difference between subnetting and supernetting?

Subnetting divides a larger network into smaller subnetworks by borrowing bits from the host portion, creating a longer prefix (e.g., splitting a /24 into two /25 networks). Supernetting (also called route aggregation or summarization) combines multiple smaller contiguous networks into a single larger route by moving the network boundary to the left, creating a shorter prefix (e.g., combining four /24 networks into one /22). Subnetting is used for address allocation within an organization, while supernetting is used to reduce routing table size and improve router performance.

Do I need to know IPv6 subnetting for CCNA?

Yes, the CCNA 200-301 exam covers both IPv4 and IPv6 addressing. However, IPv6 subnetting is significantly simpler than IPv4. The standard allocation from an ISP is a /48 prefix, which organizations subnet into /64 networks using the 16-bit subnet ID field (bits 49-64). There is no need for VLSM in IPv6 because the 128-bit address space is vast. Every subnet uses a /64 prefix, and the lower 64 bits are the interface identifier (often auto-configured via EUI-64 or SLAAC). Focus the majority of your subnetting study on IPv4, but understand the basic IPv6 structure.