Courses3 levels
Level 1 · Foundations11 courses
Level 2 · Core5 courses
Level 3 · Advanced5 courses
Labs8 topics
Library Practice exams AI Range Pricing Start free

Practice library / Networking hands-on

Lab · Medium · 1.5 hoursFree account

IP Subnetting Mastery

IP addressing, CIDR notation, and subnet calculation practice.

  • subnetting
  • vlsm
  • cidr
  • ipv4
  • ccna
On this page 13 sections
  1. ·Binary Refresher
  2. ·IP Address Classes
  3. ·CIDR Notation
  4. 1Subnet Mask Basics
  5. 2Finding the Network Address
  6. Locked: Finding the Broadcast Address
  7. Locked: Usable Host Range
  8. Locked: Subnetting a Network
  9. Locked: VLSM (Variable Length Subnet Masking)
  10. Locked: Wildcard Masks
  11. Locked: ipcalc Tool
  12. Locked: Practice Problems
  13. Locked: Subnetting Quick Reference

Before you start

A packet reaches the right subnet or nowhere — and the engineer who cannot split a /24 into useful pieces cannot plan, troubleshoot or secure a network. Subnetting is one of the few CCNA topics that must be in muscle memory, because the exam clock punishes hesitation and so does an on-call incident. This lab drills the binary conversions, the VLSM allocations and the wildcard-mask arithmetic by hand, then under time.

Lab Objectives

  • Convert between decimal, binary, and CIDR notation
  • Calculate network address, broadcast, and usable host range
  • Divide a network into subnets of a required size
  • Apply VLSM to allocate addresses efficiently
  • Convert subnet masks to wildcard masks for ACLs and OSPF
  • Solve subnetting problems under exam-time pressure

Binary Refresher

IPv4 addresses are 32-bit numbers split into four 8-bit octets. Each bit position has a value: 128, 64, 32, 16, 8, 4, 2, 1.

Bit 7Bit 6Bit 5Bit 4Bit 3Bit 2Bit 1Bit 0Decimal
1286432168421
11000000192
11111111255
000000000
10101000168
# Quick binary conversions to memorise:
/8  = 255.0.0.0
/16 = 255.255.0.0
/24 = 255.255.255.0
/25 = 255.255.255.128
/26 = 255.255.255.192
/27 = 255.255.255.224
/28 = 255.255.255.240
/29 = 255.255.255.248
/30 = 255.255.255.252

IP Address Classes

ClassFirst OctetDefault MaskPrivate RangeHosts
A1–126/8 (255.0.0.0)10.0.0.0/816,777,214
B128–191/16 (255.255.0.0)172.16.0.0/1265,534
C192–223/24 (255.255.255.0)192.168.0.0/16254
D224–239—Multicast—
E240–255—Experimental—

Loopback: 127.0.0.0/8 is reserved for loopback (127.0.0.1). APIPA: 169.254.0.0/16 is link-local (auto-assigned when DHCP fails).

CIDR Notation

CIDR (Classless Inter-Domain Routing) replaces class-based addressing. The prefix length (/n) tells you how many bits are in the network portion.

Formula: Usable hosts = 2(32−prefix) − 2

CIDRSubnet MaskHostsSubnets of /24
/24255.255.255.02541
/25255.255.255.1281262
/26255.255.255.192624
/27255.255.255.224308
/28255.255.255.2401416
/29255.255.255.248632
/30255.255.255.252264
/32255.255.255.2551 (host route)256

Step 1: Subnet Mask Basics

1

A subnet mask has all 1s in the network portion, all 0s in the host portion

For a /26: 11111111.11111111.11111111.11000000 = 255.255.255.192

The "magic number" (or "block size") is key to fast subnetting: 256 − last octet of mask

# /26 = mask 255.255.255.192
Magic number = 256 - 192 = 64
Subnets start at: 0, 64, 128, 192

# /27 = mask 255.255.255.224
Magic number = 256 - 224 = 32
Subnets start at: 0, 32, 64, 96, 128, 160, 192, 224

# /28 = mask 255.255.255.240
Magic number = 256 - 240 = 16
Subnets start at: 0, 16, 32, 48, 64, 80 ...

Step 2: Finding the Network Address

2

Bitwise AND the IP address with the subnet mask

# Example: What network is 192.168.1.130/26 in?
Mask = /26 = 255.255.255.192, magic = 64
Block containing 130: 64 × 2 = 128 ≤ 130 < 192
Network address = 192.168.1.128

# Example: 10.0.5.200/27
Mask = /27 = 255.255.255.224, magic = 32
Block containing 200: 32 × 6 = 192 ≤ 200 < 224
Network address = 10.0.5.192

Sign in to continue

8 more sections are for signed-in members. It is free: sign in with Google.

Related

This lab is extra practice for the course Networking hands-on. Do the lessons first.Open the course