Practice library / Networking hands-on
Lab · Medium · 1.5 hoursFree account
IP Subnetting Mastery
IP addressing, CIDR notation, and subnet calculation practice.
On this page 13 sections
- ·Binary Refresher
- ·IP Address Classes
- ·CIDR Notation
- 1Subnet Mask Basics
- 2Finding the Network Address
- Locked: Finding the Broadcast Address
- Locked: Usable Host Range
- Locked: Subnetting a Network
- Locked: VLSM (Variable Length Subnet Masking)
- Locked: Wildcard Masks
- Locked: ipcalc Tool
- Locked: Practice Problems
- 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 7 | Bit 6 | Bit 5 | Bit 4 | Bit 3 | Bit 2 | Bit 1 | Bit 0 | Decimal |
|---|---|---|---|---|---|---|---|---|
| 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 | |
| 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 192 |
| 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 255 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 1 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 168 |
# 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.252IP Address Classes
| Class | First Octet | Default Mask | Private Range | Hosts |
|---|---|---|---|---|
| A | 1–126 | /8 (255.0.0.0) | 10.0.0.0/8 | 16,777,214 |
| B | 128–191 | /16 (255.255.0.0) | 172.16.0.0/12 | 65,534 |
| C | 192–223 | /24 (255.255.255.0) | 192.168.0.0/16 | 254 |
| D | 224–239 | — | Multicast | — |
| E | 240–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
| CIDR | Subnet Mask | Hosts | Subnets of /24 |
|---|---|---|---|
| /24 | 255.255.255.0 | 254 | 1 |
| /25 | 255.255.255.128 | 126 | 2 |
| /26 | 255.255.255.192 | 62 | 4 |
| /27 | 255.255.255.224 | 30 | 8 |
| /28 | 255.255.255.240 | 14 | 16 |
| /29 | 255.255.255.248 | 6 | 32 |
| /30 | 255.255.255.252 | 2 | 64 |
| /32 | 255.255.255.255 | 1 (host route) | 256 |
Step 1: Subnet Mask Basics
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
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.192Sign 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