Finding the Subnet & Range
You are given an IP address and a prefix and asked: which subnet is this, and what is its full range? There are two routes to the answer — the binary AND that always works, and the block (magic number) shortcut that is fast enough for the exam. Learn both; trust the shortcut.
What the question gives you
A typical question reads: “Host 192.168.1.211/27 — what is the network address, the first usable, the last usable and the broadcast?” You are given an ordinary host address sitting somewhere inside a subnet, and you must work out where that subnet starts and ends.
The prefix fixes two things up front:
- The mask (e.g. /27 → 255.255.255.224).
- The number of subnets and their block size in the octet where the boundary falls.
That octet — the one where the mask is neither 0 nor 255 — is called the magic octet. For any /25–/30 inside a classful /24 the magic octet is the fourth one. For /17–/23 it is the third (Lesson 5 covers that). Pinpointing the magic octet first is the whole secret.
Method A — the binary AND
The subnet address is, by definition, the address ANDed bit-for-bit with the mask. Where the mask has a 1, the address bit is kept; where the mask has a 0, the bit becomes 0. This method always works and never relies on recognising a pattern.
Worked with 192.168.1.211/27. The first three octets (mask 255 = all 1s) pass through unchanged. Only the fourth octet needs work:
Mask last octet /27 -> 224 = 11100000
Address .211 = 11010011
--------
AND (bit-by-bit) = 11000000 = 192
Network address = 192.168.1.192
Read the columns: 1·1=1, 1·1=1, 0·0=0, 1·0=0, 0·0=0, 0·0=0, 1·0=0, 1·0=0 → 11000000, which is 128 + 64 = 192. The host bits (the last five) have been forced to 0; the network bits (first three) survived.
Method B — the block (magic-number) shortcut
The AND method is correct but slow under exam pressure. The block method gets the same answer in one subtraction.
For a /27 the mask value is 224, so the increment is 256 − 224 = 32. The subnet boundaries are the multiples of 32: 0, 32, 64, 96, 128, 160, 192, 224. The address 211 falls between 192 and 224, so the network address is 192 in the last octet — 192.168.1.192, matching the AND method. The next boundary up (224) minus one gives the broadcast: 192.168.1.223.
| Prefix | Mask octet | Power of 2 | Block increment (256 − mask) |
|---|---|---|---|
| /25 | 128 | 27 | 128 |
| /26 | 192 | 26 | 64 |
| /27 | 224 | 25 | 32 |
| /28 | 240 | 24 | 16 |
| /29 | 248 | 23 | 8 |
| /30 | 252 | 22 | 4 |
From network to full range
Once you have the network address in the magic octet, the rest is pure arithmetic:
- Broadcast = network + increment − 1. All host bits become 1, so it is one less than the next subnet boundary.
- First usable = network + 1.
- Last usable = broadcast − 1.
Always verify with the count rule from Lesson 2: the number of addresses between first usable and last usable inclusive must equal 2h − 2. If it does not, one of your four numbers is wrong.
.199 is exactly the broadcast address of its subnet, so it is not a valid host address. The exam loves asking “is this a valid host?” or “can this address be assigned?”. After finding the network, always compare the given address against the range boundary.Four worked examples & drills
Each example is fully worked and then checked with the count rule.
Example 1 — 192.168.1.211/27 Mask .224, magic octet = 4th, increment = 256 − 224 = 32 Multiples of 32: 0,32,64,96,128,160,192,224 211 lies between 192 and 224 -> network octet = 192 Network 192.168.1.192 Broadcast 192.168.1.223 (192 + 32 − 1) First 192.168.1.193 Last 192.168.1.222 Check: 222 − 193 + 1 = 30 = 2^5 − 2 OK Example 2 — 10.10.10.130/26 Mask .192, magic octet = 4th, increment = 256 − 192 = 64 Multiples of 64: 0,64,128,192 130 lies between 128 and 192 -> network octet = 128 Network 10.10.10.128 Broadcast 10.10.10.191 (128 + 64 − 1) First 10.10.10.129 Last 10.10.10.190 Check: 190 − 129 + 1 = 62 = 2^6 − 2 OK Example 3 — 172.16.5.87/28 Mask .240, magic octet = 4th, increment = 256 − 240 = 16 Multiples of 16: 0,16,32,48,64,80,96,... 87 lies between 80 and 96 -> network octet = 80 Network 172.16.5.80 Broadcast 172.16.5.95 (80 + 16 − 1) First 172.16.5.81 Last 172.16.5.94 Check: 94 − 81 + 1 = 14 = 2^4 − 2 OK Example 4 — 192.168.100.199/29 Mask .248, magic octet = 4th, increment = 256 − 248 = 8 Multiples of 8: 0,8,16,...,192,200 199 lies between 192 and 200 -> network octet = 192 Network 192.168.100.192 Broadcast 192.168.100.199 (192 + 8 − 1) First 192.168.100.193 Last 192.168.100.198 Check: 198 − 193 + 1 = 6 = 2^3 − 2 OK
Key terms & sources
Magic octet
The octet where the mask is neither 0 nor 255 — where the subnet boundary falls.
Block increment
256 − mask value in the magic octet; the spacing between subnet boundaries.
Binary AND
Bit-by-bit multiplication of address and mask that yields the network address.
Network address
IP AND mask; all host bits 0.
Broadcast address
Network + increment − 1; all host bits 1.
Usable range
First usable to last usable; its length must equal 2h − 2.
- Fuller, V. & Li, T. RFC 4632: Classless Inter-Domain Routing (CIDR) (2006) (prefix/block semantics). rfc-editor.org/rfc/rfc4632.
- Pummill, R. & Manning, B. RFC 1878: Variable Length Subnet Table For IPv4 (1995). rfc-editor.org/rfc/rfc1878.
- Cisco. CCNA (200-301) Exam Topics, IPv4 Addressing and Subnetting. cisco.com.
Review
Check what you have learned with these review questions.
Target exams: CCNA 200-301 v1.1 · CyberOps Associate 200-201. Last content verification: 2026-10-11.