Subnetting
September 12, 2025
note-to-self
full-stack
Subnetting Cheat Sheet**:
128 64 32 16 8 4 2 1
128 192 224 240 248 252 254 255
/25 /26 /27 /28 /29 /30 /31 /32
/17 /18 /19 /20 /21 /22 /23 /24
/9 /10 /11 /12 /13 /14 /15 /16
/1 /2 /3 /4 /5 /6 /7 /8
Using that cheatsheet, solve for:
Network ID:
First Usable IP:
Last Usable IP:
Broadcast ID:
Next Network:
Subnet Mask:
Number of Hosts:
Subnetting practice: https://subnetipv4.com/
With subnet mask practice: https://richtechguy.com/subnetting-practice-tool/
CIDR Calculator: https://cidr.xyz/
Networking Classes
| Class | 1st Octet Range | Subnet Mask | Description |
|---|---|---|---|
| A | 1–126 | 255.0.0.0 | Designed for a small number of networks with a very large number of hosts on each one. |
| B | 128–191 | 255.255.0.0 | Used for medium-sized networks. |
| C | 192–223 | 255.255.255.0 | Used for a large number of networks with a small number of hosts on each one. |
| D | 224–239 | N/A | Reserved for multicast traffic. |
| E | 240–255 | N/A | Reserved for experimental use. |
How Many Possible
All of the possible hosts, not just usable (eg, not subtracting network and broadcast).
- 4th octet: 256 (255.255.255.0)
- 3rd octet: 65,536 (255.255.0.0)
- 2nd octet: 16,777,216 (255.255.0.0)
- 1st octet: 4,294,967,296 (0.0.0.0), all of them
If you want to see how many are in a 255.240.0.0, you'd multiple the number leftover in the 2nd octet (256-240 = 16) x 65536, because each of those 16 could be a network as big as 65536.
For 255.255.240.0, that would be 16 x 255.
Useful Linux app:
ipcalc --split 2 $(curl -s ha17.com/ip)
Might need:
sudo apt update && sudo apt install ipcalc
--
Private Network Ranges
- 10.0.0.0 to 10.255.255.255 (Class A): This range offers over 16 million IP addresses and is typically used for large networks, like large corporations.
- 172.16.0.0 to 172.31.255.255 (Class B): This range provides more than one million IP addresses and is suitable for medium-sized networks, such as schools or medium-sized businesses.
- 192.168.0.0 to 192.168.255.255 (Class C): This range provides over 65,000 IP addresses and is commonly used for home and small office networks.
--
** I needed this a lot at first but suddenly find it pretty easy to do this from memory.
Most posts are for my own reference and reflection, and shouldn’t be taken as fully accurate or instructional.