IP Addressing & Subnetting
Read IP addresses and CIDR notation, and split networks into subnets.
An IPv4 address is 32 bits, written as four octets (192.168.1.10). A subnet
mask or CIDR suffix splits it into a network portion and a host
portion. /24 means the first 24 bits identify the network, leaving 8 bits —
256 addresses (254 usable; the first is the network address and the last is
broadcast).
Smaller suffix = bigger network: /16 is 65,536 addresses, /24 is 256, /32
is a single host. Private ranges (RFC 1918) — 10.0.0.0/8, 172.16.0.0/12,
192.168.0.0/16 — are not routable on the public internet and are what you use
inside VPCs and home networks.
192.168.1.0/24
Network: 192.168.1.0
Usable: 192.168.1.1 – 192.168.1.254
Broadcast: 192.168.1.255
Hosts: 254
Split /24 into two /25 subnets:
192.168.1.0/25 → .1 – .126 (126 hosts)
192.168.1.128/25 → .129 – .254 (126 hosts) - How many usable hosts are in a
/28subnet? - Identify the network and broadcast address of
10.0.5.0/24. - Which RFC 1918 range would you pick for a large cloud VPC, and why?
- Split
192.168.10.0/24into four equal subnets and list their ranges.
Cheat Sheet▾
| CIDR | Hosts (usable) | Mask |
|---|---|---|
| /8 | 16,777,214 | 255.0.0.0 |
| /16 | 65,534 | 255.255.0.0 |
| /24 | 254 | 255.255.255.0 |
| /26 | 62 | 255.255.255.192 |
| /28 | 14 | 255.255.255.240 |
| /32 | 1 (host) | 255.255.255.255 |
Common Interview Questions▾
What does /24 mean in CIDR notation?
The first 24 bits are the network portion, leaving 8 bits for hosts — 256 addresses total, 254 usable after removing network and broadcast addresses.
Why use private IP ranges?
RFC 1918 ranges are not routable on the public internet, so they let you build large internal networks without consuming scarce public IPs; NAT handles outbound.
How many usable hosts does a /30 provide?
2^(32−30) − 2 = 2 usable hosts — commonly used for point-to-point links.