Subnetting 101
Step 6 — Calculating Host Ranges
Now that you can find network and broadcast addresses, calculating the usable host range is simple: everything in between.
The Simple Formula
Example: 192.168.1.0/24
Network address: 192.168.1.0
First usable host: 192.168.1.1
Last usable host: 192.168.1.254
Broadcast address: 192.168.1.255
Complete Subnet Information
When analyzing a subnet, you should be able to determine all of this:
Example: 10.50.100.75/26
| Given IP | 10.50.100.75 |
| CIDR | /26 |
| Subnet Mask | 255.255.255.192 |
| Network Address | 10.50.100.64 |
| First Host | 10.50.100.65 |
| Last Host | 10.50.100.126 |
| Broadcast Address | 10.50.100.127 |
| Usable Hosts | 62 (2⁶ - 2) |
Worked Examples
172.16.45.200/21
Block size: 8 (in 3rd octet)
Network: 172.16.40.0 (45 falls in 40-47 block)
Broadcast: 172.16.47.255
Host range: 172.16.40.1 to 172.16.47.254
Usable hosts: 2¹¹ - 2 = 2,046
192.168.50.130/27
Block size: 32
Network: 192.168.50.128 (130 falls in 128-159 block)
Broadcast: 192.168.50.159
Host range: 192.168.50.129 to 192.168.50.158
Usable hosts: 2⁵ - 2 = 30
10.0.0.1/29
Block size: 8
Network: 10.0.0.0 (1 falls in 0-7 block)
Broadcast: 10.0.0.7
Host range: 10.0.0.1 to 10.0.0.6
Usable hosts: 2³ - 2 = 6
Quick Reference: Subnetting a /24
Here's what you get when you subnet a typical /24 network:
| CIDR | Subnets | Hosts/Subnet | Example Ranges |
|---|---|---|---|
| /24 | 1 | 254 | .1-.254 |
| /25 | 2 | 126 | .1-.126, .129-.254 |
| /26 | 4 | 62 | .1-.62, .65-.126, .129-.190, .193-.254 |
| /27 | 8 | 30 | .1-.30, .33-.62, .65-.94, ... |
| /28 | 16 | 14 | .1-.14, .17-.30, .33-.46, ... |
| /29 | 32 | 6 | .1-.6, .9-.14, .17-.22, ... |
| /30 | 64 | 2 | .1-.2, .5-.6, .9-.10, ... |
Are Two IPs on the Same Subnet?
A common real-world task: determine if two hosts can communicate directly without a router.
Example: Can 192.168.1.100/26 communicate with 192.168.1.150/26?
Block size: 64
100 is in block 64-127 (network: 192.168.1.64)
150 is in block 128-191 (network: 192.168.1.128)
Different subnets! They need a router.
Example: Can 10.20.30.40/28 communicate with 10.20.30.35/28?
Block size: 16
40 is in block 32-47 (network: 10.20.30.32)
35 is in block 32-47 (network: 10.20.30.32)
Same subnet! Direct communication OK.
Practice Exercises
For each IP/CIDR, find the complete subnet info:
192.168.100.200/2810.10.10.10/30172.16.50.100/23
Show Answers
1. 192.168.100.200/28
- Mask: 255.255.255.240
- Network: 192.168.100.192
- Host range: 192.168.100.193 - 192.168.100.206
- Broadcast: 192.168.100.207
- Usable hosts: 14
2. 10.10.10.10/30
- Mask: 255.255.255.252
- Network: 10.10.10.8
- Host range: 10.10.10.9 - 10.10.10.10
- Broadcast: 10.10.10.11
- Usable hosts: 2
3. 172.16.50.100/23
- Mask: 255.255.254.0
- Network: 172.16.50.0 (block size 2, 50 is in 50-51)
- Host range: 172.16.50.1 - 172.16.51.254
- Broadcast: 172.16.51.255
- Usable hosts: 510
Checkpoint
Before moving on, make sure you can:
- Calculate the complete subnet info for any IP/CIDR
- Find first and last usable host addresses
- Determine if two IPs are on the same subnet
- Understand why network and broadcast can't be used for hosts