๐งฎ
Subnetting Cheat Sheet
IPv4 subnet masks, CIDR notation, and host calculations
๐ Hosts Formula
2n - 2
n = host bits (32 - prefix)
๐ข Subnets Formula
2n
n = borrowed bits
๐ญ Wildcard Formula
255 - subnet octet
Inverse of subnet mask
25 subnet entries โข Class A: /8 โข Class B: /16 โข Class C: /24
| CIDR | Subnet Mask | Usable Hosts | Wildcard | Class/Size | Binary Mask |
|---|---|---|---|---|---|
| /32 | 255.255.255.255 | 1 | 0.0.0.0 | Host | 11111111.11111111.11111111.11111111 |
| /31 | 255.255.255.254 | 2 | 0.0.0.1 | P2P Link | 11111111.11111111.11111111.11111110 |
| /30 | 255.255.255.252 | 2 | 0.0.0.3 | P2P Link | 11111111.11111111.11111111.11111100 |
| /29 | 255.255.255.248 | 6 | 0.0.0.7 | Small | 11111111.11111111.11111111.11111000 |
| /28 | 255.255.255.240 | 14 | 0.0.0.15 | Small | 11111111.11111111.11111111.11110000 |
| /27 | 255.255.255.224 | 30 | 0.0.0.31 | Small | 11111111.11111111.11111111.11100000 |
| /26 | 255.255.255.192 | 62 | 0.0.0.63 | Small | 11111111.11111111.11111111.11000000 |
| /25 | 255.255.255.128 | 126 | 0.0.0.127 | Medium | 11111111.11111111.11111111.10000000 |
| /24 | 255.255.255.0 | 254 | 0.0.0.255 | C | 11111111.11111111.11111111.00000000 |
| /23 | 255.255.254.0 | 510 | 0.0.1.255 | Medium | 11111111.11111111.11111110.00000000 |
| /22 | 255.255.252.0 | 1022 | 0.0.3.255 | Medium | 11111111.11111111.11111100.00000000 |
| /21 | 255.255.248.0 | 2046 | 0.0.7.255 | Medium | 11111111.11111111.11111000.00000000 |
| /20 | 255.255.240.0 | 4094 | 0.0.15.255 | Large | 11111111.11111111.11110000.00000000 |
| /19 | 255.255.224.0 | 8190 | 0.0.31.255 | Large | 11111111.11111111.11100000.00000000 |
| /18 | 255.255.192.0 | 16382 | 0.0.63.255 | Large | 11111111.11111111.11000000.00000000 |
| /17 | 255.255.128.0 | 32766 | 0.0.127.255 | Large | 11111111.11111111.10000000.00000000 |
| /16 | 255.255.0.0 | 65534 | 0.0.255.255 | B | 11111111.11111111.00000000.00000000 |
| /15 | 255.254.0.0 | 131070 | 0.1.255.255 | Large | 11111111.11111110.00000000.00000000 |
| /14 | 255.252.0.0 | 262142 | 0.3.255.255 | Large | 11111111.11111100.00000000.00000000 |
| /13 | 255.248.0.0 | 524286 | 0.7.255.255 | Large | 11111111.11111000.00000000.00000000 |
| /12 | 255.240.0.0 | 1048574 | 0.15.255.255 | Large | 11111111.11110000.00000000.00000000 |
| /11 | 255.224.0.0 | 2097150 | 0.31.255.255 | Large | 11111111.11100000.00000000.00000000 |
| /10 | 255.192.0.0 | 4194302 | 0.63.255.255 | Large | 11111111.11000000.00000000.00000000 |
| /9 | 255.128.0.0 | 8388606 | 0.127.255.255 | Large | 11111111.10000000.00000000.00000000 |
| /8 | 255.0.0.0 | 16777214 | 0.255.255.255 | A | 11111111.00000000.00000000.00000000 |
โญ Most Common Subnets
/30 255.255.255.252 2 hosts
/29 255.255.255.248 6 hosts
/28 255.255.255.240 14 hosts
/27 255.255.255.224 30 hosts
/26 255.255.255.192 62 hosts
/25 255.255.255.128 126 hosts
/24 255.255.255.0 254 hosts
/16 255.255.0.0 65534 hosts
/8 255.0.0.0 16777214 hosts
๐ฏ Exam Tips
- โข Memorize /24, /25, /26, /27, /28, /29, /30
- โข /30 = 2 usable hosts (point-to-point links)
- โข Subtract 2 from total for usable hosts (network + broadcast)
- โข Binary powers: 128, 64, 32, 16, 8, 4, 2, 1
๐ง Quick Memory Trick
/24 = 256 total, 254 usable (most common)
/25 = half of /24 = 128 total, 126 usable
/26 = half of /25 = 64 total, 62 usable
Pattern: Each increment halves the addresses