Analysts lose time and make costly mistakes when they cannot tell at a glance how big a CIDR block is, whether an address is private, or whether a firewall rule covers more than intended. This cheat sheet puts the numbers defenders need in one place: every IPv4 prefix from /8 to /32 with its mask and size, the private and special-use ranges from the IANA registries, the common IPv6 prefixes, the reserved addresses in AWS, Azure and Google Cloud subnets, and quick mental maths for reading logs and writing rules. It is written for SOC analysts, detection engineers and cloud security engineers. All arithmetic was checked programmatically, and the special-use ranges were checked against the IANA registries on 26 November 2026.
At a glance
- Size of a block: an IPv4 /n holds 2(32 minus n) addresses. Each step of one bit doubles or halves it: a /23 is two /24s, a /25 is half a /24.
- Private ranges (RFC 1918): 10.0.0.0/8, 172.16.0.0/12 (172.16.0.0 to 172.31.255.255) and 192.168.0.0/16. 172.32.0.1 is public.
- Not private, but not public either: 100.64.0.0/10 shared address space (carrier-grade NAT, RFC 6598), 169.254.0.0/16 link-local (RFC 3927), 127.0.0.0/8 loopback.
- IPv6 shortcuts: fe80::/10 link-local, fc00::/7 unique local (in practice fd00::/8), ::1/128 loopback, 2001:db8::/32 and 3fff::/20 documentation, ff00::/8 multicast.
- Cloud subnets lose addresses: AWS and Azure reserve five addresses per IPv4 subnet, Google Cloud reserves four in each primary range.
How to use this template
Print the size table or keep it beside your SIEM. Add your own estate in the fill-in table under "Using CIDR in firewall and detection rules" so that analysts can tell, without a lookup, which ranges are your offices, data centres, VPCs and VPN pools. Review that table whenever networks are added or retired. For the security design behind these ranges, see the Network Segmentation Guide and the IPv6 Security Guide; this page is the quick reference, not the design guide.
CIDR size table
CIDR (RFC 4632, BCP 122) replaced classful addressing with prefixes written as an address, a slash and the number of leading network bits, from /0 to /32. "Usable hosts" assumes a traditional subnet where the network and broadcast addresses are not assigned. A /31 is used for point-to-point links where both addresses are usable (RFC 3021), and a /32 is a single host route.
| Prefix | Subnet mask | Wildcard (inverse) mask | Addresses | Usable hosts | Relative to a /24 |
|---|---|---|---|---|---|
| /8 | 255.0.0.0 | 0.255.255.255 | 16,777,216 | 16,777,214 | 65,536 x /24 |
| /9 | 255.128.0.0 | 0.127.255.255 | 8,388,608 | 8,388,606 | 32,768 x /24 |
| /10 | 255.192.0.0 | 0.63.255.255 | 4,194,304 | 4,194,302 | 16,384 x /24 |
| /11 | 255.224.0.0 | 0.31.255.255 | 2,097,152 | 2,097,150 | 8,192 x /24 |
| /12 | 255.240.0.0 | 0.15.255.255 | 1,048,576 | 1,048,574 | 4,096 x /24 |
| /13 | 255.248.0.0 | 0.7.255.255 | 524,288 | 524,286 | 2,048 x /24 |
| /14 | 255.252.0.0 | 0.3.255.255 | 262,144 | 262,142 | 1,024 x /24 |
| /15 | 255.254.0.0 | 0.1.255.255 | 131,072 | 131,070 | 512 x /24 |
| /16 | 255.255.0.0 | 0.0.255.255 | 65,536 | 65,534 | 256 x /24 |
| /17 | 255.255.128.0 | 0.0.127.255 | 32,768 | 32,766 | 128 x /24 |
| /18 | 255.255.192.0 | 0.0.63.255 | 16,384 | 16,382 | 64 x /24 |
| /19 | 255.255.224.0 | 0.0.31.255 | 8,192 | 8,190 | 32 x /24 |
| /20 | 255.255.240.0 | 0.0.15.255 | 4,096 | 4,094 | 16 x /24 |
| /21 | 255.255.248.0 | 0.0.7.255 | 2,048 | 2,046 | 8 x /24 |
| /22 | 255.255.252.0 | 0.0.3.255 | 1,024 | 1,022 | 4 x /24 |
| /23 | 255.255.254.0 | 0.0.1.255 | 512 | 510 | 2 x /24 |
| /24 | 255.255.255.0 | 0.0.0.255 | 256 | 254 | 1 x /24 |
| /25 | 255.255.255.128 | 0.0.0.127 | 128 | 126 | 1/2 of a /24 |
| /26 | 255.255.255.192 | 0.0.0.63 | 64 | 62 | 1/4 of a /24 |
| /27 | 255.255.255.224 | 0.0.0.31 | 32 | 30 | 1/8 of a /24 |
| /28 | 255.255.255.240 | 0.0.0.15 | 16 | 14 | 1/16 of a /24 |
| /29 | 255.255.255.248 | 0.0.0.7 | 8 | 6 | 1/32 of a /24 |
| /30 | 255.255.255.252 | 0.0.0.3 | 4 | 2 | 1/64 of a /24 |
| /31 | 255.255.255.254 | 0.0.0.1 | 2 | 2 (point-to-point) | 1/128 of a /24 |
| /32 | 255.255.255.255 | 0.0.0.0 | 1 | 1 (host route) | 1/256 of a /24 |
Wildcard masks are the bitwise inverse of the subnet mask. Cisco access control lists and some OSPF configurations use them, so a rule written with 0.0.0.255 means "any value in the last octet", the same scope as a /24.
Cloud reserved addresses
| Platform | Reserved per IPv4 subnet | Which addresses | IPv4 subnet sizes | IPv6 subnet size |
|---|---|---|---|---|
| AWS VPC | 5 | First four (network, VPC router, Amazon DNS, future use) and the last (broadcast, not supported in a VPC) | /16 to /28 (a /28 leaves 11 usable) | /44 to /64 in steps of 4; first four and last address also reserved |
| Azure Virtual Network | 5 | First four (network, default gateway, two for Azure DNS mapping) and the last (broadcast) | /29 smallest, /2 largest | /64 exactly |
| Google Cloud VPC | 4 per primary range | First two (network, default gateway) and last two (future use, broadcast); secondary ranges reserve none | /29 smallest | /64 |
Platforms are listed alphabetically. In an AWS subnet 10.0.0.0/24, a flow log entry from 10.0.0.2 is the Amazon DNS resolver, and 10.0.0.1 is the VPC router; in Azure, the .1 address is the default gateway. Knowing this stops analysts chasing infrastructure addresses as suspicious hosts. AWS documents that bring-your-own-IP ranges are an exception to the reservation rule.
Private and special-use ranges
The IANA IPv4 Special-Purpose Address Registry is the authoritative list. "Forwardable" means a router may forward packets between interfaces; "globally reachable" means the address should be reachable on the public internet. Every row below is not globally reachable.
| Block | Name | RFC | Range | What it means in a log |
|---|---|---|---|---|
| 0.0.0.0/8 | "This network" | RFC 791 | 0.0.0.0 to 0.255.255.255 | Should never appear as a real source on the wire; 0.0.0.0 in a listener means all interfaces |
| 10.0.0.0/8 | Private-Use | RFC 1918 | 10.0.0.0 to 10.255.255.255 | Internal; inbound from the internet with this source is spoofed |
| 100.64.0.0/10 | Shared Address Space | RFC 6598 | 100.64.0.0 to 100.127.255.255 | Carrier-grade NAT or some overlay VPNs; many users may share one public address behind it |
| 127.0.0.0/8 | Loopback | RFC 1122 | 127.0.0.0 to 127.255.255.255 | Local to the host; a remote packet claiming it is spoofed |
| 169.254.0.0/16 | Link Local | RFC 3927 | 169.254.0.0 to 169.254.255.255 | Self-assigned when DHCP fails; 169.254.169.254 is the cloud instance metadata endpoint |
| 172.16.0.0/12 | Private-Use | RFC 1918 | 172.16.0.0 to 172.31.255.255 | Internal; also the default range for many container bridge networks |
| 192.0.0.0/24 | IETF Protocol Assignments | RFC 6890 | 192.0.0.0 to 192.0.0.255 | Protocol use only (a few anycast /32s inside it are globally reachable) |
| 192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24 | Documentation (TEST-NET-1 to 3) | RFC 5737 | Three /24s | Examples only; real traffic with these addresses is misconfiguration or spoofing |
| 192.168.0.0/16 | Private-Use | RFC 1918 | 192.168.0.0 to 192.168.255.255 | Internal, often home and small office networks seen over VPN |
| 198.18.0.0/15 | Benchmarking | RFC 2544 | 198.18.0.0 to 198.19.255.255 | Test labs; some proxies and security products also use it internally |
| 240.0.0.0/4 | Reserved | RFC 1112 | 240.0.0.0 to 255.255.255.255 | Not in use; treat as bogon |
| 255.255.255.255/32 | Limited Broadcast | RFC 919, RFC 8190 | One address | Local broadcast only |
Multicast: 224.0.0.0/4 (224.0.0.0 to 239.255.255.255) is IPv4 multicast, recorded in the IANA multicast registry rather than the special-purpose registry. Unexpected multicast crossing a routed boundary is worth a look.
Bogon filtering: the special-use blocks above, plus multicast and any unallocated space, form the usual bogon list for edge filters. Drop inbound packets from the internet that claim a source in these ranges, and drop outbound packets with a source outside your own allocations. The Firewall Rule Review Checklist covers how to review those rules.
IPv6 prefixes
From the IANA IPv6 Special-Purpose Address Registry and the IPv6 addressing architecture (RFC 4291):
| Prefix | Name | RFC | Defender note |
|---|---|---|---|
| ::/128 | Unspecified | RFC 4291 | Source during address configuration only |
| ::1/128 | Loopback | RFC 4291 | IPv6 equivalent of 127.0.0.1 |
| ::ffff:0:0/96 | IPv4-mapped | RFC 4291 | IPv4 addresses inside IPv6 sockets; normalise before matching rules, or ::ffff:10.0.0.5 slips past an IPv4 match |
| 64:ff9b::/96 | IPv4-IPv6 translation (NAT64) | RFC 6052 | The last 32 bits carry the real IPv4 destination |
| 2001::/32 | Teredo | RFC 4380 | Tunnelling through NAT; usually unwanted in enterprises |
| 2001:db8::/32 and 3fff::/20 | Documentation | RFC 3849, RFC 9637 | Examples only |
| 2002::/16 | 6to4 | RFC 3056 | Legacy tunnelling; block unless needed |
| fc00::/7 | Unique local (ULA) | RFC 4193 | Private IPv6, not globally routed; in practice addresses start fd |
| fe80::/10 | Link-local unicast | RFC 4291 | Present on every IPv6 interface, even where IPv6 is "not used" |
| ff00::/8 | Multicast | RFC 4291 | ff02::1 all nodes and ff02::2 all routers on the link |
Allocation sizes: a standard IPv6 subnet is a /64, which holds 264 (about 1.8 x 1019) addresses. A /56 contains 256 /64s and a /48 contains 65,536 /64s. Because hosts change addresses within a /64 through privacy extensions, block or allowlist IPv6 at the /64 (or wider) rather than per address. The IPv6 Security Guide covers the threats.
Subnetting quick maths
- Find the block size. In the octet where the mask is not 255 or 0, block size = 256 minus that mask octet. For /21 the mask is 255.255.248.0, so the block size in the third octet is 256 minus 248 = 8.
- Find the network address. Round the address in that octet down to a multiple of the block size. 10.20.37.200/21: 37 rounded down to a multiple of 8 is 32, so the network is 10.20.32.0.
- Find the last address. Network plus block size, minus one, in that octet, with 255 in the octets after it. 10.20.32.0/21 runs to 10.20.39.255 (2,048 addresses).
- Check membership. An address belongs to the subnet if it lies between the network and last address. 192.168.10.77/26: block size 64, network 192.168.10.64, last 192.168.10.127.
- Split a block. Each extra prefix bit halves the block. 10.0.0.0/24 split into /26s gives 10.0.0.0, 10.0.0.64, 10.0.0.128 and 10.0.0.192.
- Aggregate (summarise). Contiguous blocks aligned on a power of two combine: 10.0.0.0/24 to 10.0.3.0/24 summarise to 10.0.0.0/22. 10.0.1.0/24 to 10.0.4.0/24 do not form one /22, because the block does not start on a multiple of 4.
| Mask octet | 128 | 192 | 224 | 240 | 248 | 252 | 254 | 255 |
|---|---|---|---|---|---|---|---|---|
| Network bits in octet | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| Block size | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
Powers of two to memorise: 28 = 256, 210 = 1,024, 212 = 4,096, 216 = 65,536, 220 = 1,048,576, 224 = 16,777,216. Use them to sanity check a rule: 0.0.0.0/1 is half the internet, not a typo to ignore.
Using CIDR in firewall and detection rules
- Write the narrowest block: an allow rule for a single partner server is a /32, not the partner's /24. Overbroad sources are the most common finding in rule reviews.
- Watch for accidental "any": 0.0.0.0/0 and ::/0 match everything. A rule with 0.0.0.0/0 on management ports (22, 3389, 5985 and 5986) exposes them to the internet.
- Check both families: a security group or ACL that restricts IPv4 but leaves ::/0 open on the same port is still exposed when the host has a global IPv6 address.
- Normalise before matching: convert IPv4-mapped IPv6 addresses to IPv4, and compare addresses as integers or with a CIDR-aware function (for example cidrmatch in Splunk, ipv4_is_in_range in Microsoft Sentinel KQL) rather than string prefixes. A string match on "10.1." also matches 10.10.x.x and 10.100.x.x.
- Tag internal space: keep a lookup of your ranges so that dashboards show "internal", "VPN pool", "cloud VPC" and "partner" instead of raw addresses. The fill-in table below is the starting point.
- Treat CGNAT and shared egress carefully: one address in 100.64.0.0/10 at a carrier, or a cloud NAT gateway, may represent many users or workloads. Do not block or attribute on that address alone; correlate with identity and session data.
- Flow log context: see the AWS VPC Flow Logs Detection Guide for using these ranges in cloud network detection, and Cloud Egress Filtering for outbound controls.
Fill-in: your address plan
| Range (CIDR) | Purpose | Location or account | Owner | Expected inbound sources | Last reviewed |
|---|---|---|---|---|---|
| [10.0.0.0/16] | [Head office user VLANs] | [Site] | [Team] | [VPN pool, internal only] | [Date] |
| [172.20.0.0/16] | [Production VPC] | [Cloud account] | [Team] | [Load balancer subnets] | [Date] |
| [100.64.0.0/22] | [Remote access VPN pool] | [Gateway] | [Team] | [Internet via VPN gateway] | [Date] |
| [2001:db8:100::/48] | [IPv6 allocation] | [Provider] | [Team] | [As above] | [Date] |
Practitioner checklist
- Keep this cheat sheet and your filled-in address plan where analysts work.
- Maintain a CIDR lookup of internal, VPN, cloud and partner ranges in the SIEM and review it quarterly.
- Use CIDR-aware matching functions in detections, never string prefixes.
- Review every rule containing 0.0.0.0/0 or ::/0 and record why it is needed.
- Filter bogon and special-use sources at the internet edge, for IPv4 and IPv6.
- Check that IPv6 rules mirror IPv4 rules on every exposed port.
- Exclude cloud reserved addresses (router, DNS, gateway) from anomaly alerts deliberately, not by accident.
- Recheck special-use ranges against the IANA registries when you refresh the bogon list.
Standards and references
- IETF: RFC 4632, Classless Inter-domain Routing (CIDR)
- IANA: IPv4 Special-Purpose Address Registry
- IANA: IPv6 Special-Purpose Address Registry
- IETF: RFC 1918, Address Allocation for Private Internets
- IETF: RFC 6598, IANA-Reserved IPv4 Prefix for Shared Address Space
- IETF: RFC 4291, IP Version 6 Addressing Architecture
- AWS: Subnet CIDR blocks
- Microsoft Learn: Azure Virtual Network FAQ
- Google Cloud: Subnets
Related NHI Mgmt Group resources: Network Segmentation Guide · IPv6 Security Guide · Firewall Rule Review Checklist · Amazon VPC Security Guide · IP Address Privacy Guide