Skip to content
StratQuad

Subnetting and IP ranges

2 min read

CIDR notation, IPv4 subnet sizes, reserved ranges and the IPv6 basics needed for firewall rules, scoping and investigations.

At a glance

Owner
StratQuad
Version
November 2026
Applies to
Network scoping, firewall rules, allow lists and incident investigation
Mandatory
Reference

Key points

  • CIDR notation gives the network address and the number of fixed bits: 192.168.10.0/24 fixes the first 24 bits and leaves 8 for hosts.
  • Usable IPv4 hosts in a subnet are 2 to the power of the host bits, minus 2 for the network and broadcast addresses (except /31 and /32).
  • Private ranges (RFC 1918) are 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. 100.64.0.0/10 is carrier grade NAT space.
  • A typical IPv6 subnet is a /64.

IPv4 subnet sizes

CIDRSubnet maskAddressesUsable hosts
/32255.255.255.25511 (single host)
/31255.255.255.25422 (point to point links)
/30255.255.255.25242
/29255.255.255.24886
/28255.255.255.2401614
/27255.255.255.2243230
/26255.255.255.1926462
/25255.255.255.128128126
/24255.255.255.0256254
/23255.255.254.0512510
/22255.255.252.01,0241,022
/21255.255.248.02,0482,046
/20255.255.240.04,0964,094
/16255.255.0.065,53665,534
/8255.0.0.016,777,21616,777,214

Special IPv4 ranges

RangeUse
10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16Private networks (RFC 1918)
100.64.0.0/10Shared address space for carrier grade NAT (RFC 6598)
127.0.0.0/8Loopback
169.254.0.0/16Link local; cloud instance metadata services use 169.254.169.254
192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24Documentation examples
224.0.0.0/4Multicast
0.0.0.0/8"This network"

IPv6 basics

PrefixUse
::1/128Loopback
fe80::/10Link local
fc00::/7Unique local addresses (private)
2000::/3Global unicast
::ffff:0:0/96IPv4 mapped addresses
2001:db8::/32, 3fff::/20Documentation examples

Working it out

To find the range for 10.20.30.77/27: a /27 has 32 addresses, so blocks start at multiples of 32 in the last octet (0, 32, 64, 96). 77 falls in the block starting at 64, so the network is 10.20.30.64, the broadcast is 10.20.30.95, and usable hosts are .65 to .94.

Practitioner note

When writing allow lists or blocking attacker infrastructure, check whether an address sits in a cloud provider's or a CDN's shared range before blocking a whole block: you can cut off legitimate services. Conversely, include 169.254.169.254 and the IPv6 metadata address in server side request forgery protections, since attackers use them to steal cloud credentials.

Sources

Suggest a correction