Private IP Ranges: Read the Exact RFC 1918 Blocks
A precise guide to RFC 1918, CGNAT, loopback, link-local, 0.0.0.0/8, multicast and reserved IPv4 ranges, with runnable Python boundary tests.
Written byYiyao
Private IPv4 ranges let organizations address devices inside their own networks without assigning each device a globally routed public address. The three RFC 1918 blocks are 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16.
Use the exact ranges
| CIDR block | First address | Last address | Total addresses |
|---|---|---|---|
| 10.0.0.0/8 | 10.0.0.0 | 10.255.255.255 | 16,777,216 |
| 172.16.0.0/12 | 172.16.0.0 | 172.31.255.255 | 1,048,576 |
| 192.168.0.0/16 | 192.168.0.0 | 192.168.255.255 | 65,536 |
The totals describe addresses in each block, not the usable host count of every subnet made from it. Host assignment depends on the subnet and its use.
Pay attention to the 172 boundary
Only 172.16 through 172.31 belongs to the RFC 1918 block. An address beginning with 172 is not automatically private. Compare the entire address against the network prefix.
For example, 172.20.4.5 lies inside 172.16.0.0/12. The address 172.32.4.5 lies outside that block. Checking the first octet alone would classify them incorrectly.
Check both ends of the range rather than treating every address beginning with 172 as private. For the RFC 1918 block, the second octet runs from 16 through 31.
| Address | In the RFC 1918 172.16.0.0/12 block? | Reason |
|---|---|---|
| 172.15.255.255 | No | Second octet is below 16 |
| 172.16.0.0 | Yes | Beginning of the block |
| 172.31.255.255 | Yes | End of the block |
| 172.32.0.0 | No | Second octet is above 31 |
Membership in this block is the question answered here. Other addresses may have their own special-purpose assignments, so “outside RFC 1918” should not automatically become “ordinary publicly routable address” in your application.
Distinguish other special-purpose addresses
Loopback, link-local, shared address space and documentation ranges have their own purposes. They are not extra RFC 1918 blocks. IPv6 also uses its own addressing categories.
When a workflow specifically asks whether an IPv4 address belongs to RFC 1918, test membership in those three networks rather than relying on a broad label that may include other special-purpose ranges.
Check membership with Python
This example uses explicit RFC 1918 networks:
import ipaddress
private_v4 = tuple(ipaddress.ip_network(value) for value in (
"10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16"
))
def is_rfc1918(value):
address = ipaddress.ip_address(value)
return address.version == 4 and any(
address in network for network in private_v4
)
for sample in ["172.20.4.5", "172.32.4.5", "192.168.1.10"]:
print(sample, is_rfc1918(sample))
The expected results are True, False and True. Invalid address text raises a ValueError; handle that error explicitly when processing user input.
Understand the public connection
A home device might use 192.168.1.10 locally while a remote service sees the network's public route. Use the public-IP check from the relevant browser to inspect that external view.
For a specific public address, IP Lookup provides network context. Keep local-address troubleshooting separate from public-address lookup so the results answer the right question.
Example: diagnose an allowlist mismatch
A team submits a laptop's private address to a remote service, but requests remain blocked. The service sees the team's public route, not the laptop's internal address. The team checks the actual outbound address and follows the service's approval process with the appropriate network information.
If the connection uses an additional gateway or provider-managed translation, document that arrangement with the network administrator. Do not infer the public route from the private subnet alone.
For an allowlist investigation, draw the path as three labeled observations: the device's local interface, the network's internet-facing route, and the source address seen by the destination. Record the address at each observation point rather than copying the first address displayed in the operating system.
If a laptop uses 192.168.1.24, that local address identifies it within its private network. The remote service generally needs the public source address it observes for the connection. When the request moves to a hosted runner, repeat the observation there. Include IPv4 or IPv6 explicitly in the record, because an application may use a different address family from a manually performed check.
FAQ
Is every 192 address private? The RFC 1918 block is 192.168.0.0/16, not all addresses starting with 192.
Can two organizations use the same private range? They can use overlapping private space internally; connecting those networks requires deliberate routing and address planning.
Is 127.0.0.1 an RFC 1918 address? It is a loopback address, which is a different category.
References: RFC 1918 and Python ipaddress.
Continue with the right workflow
Check My Public IP and Browser Environment · IP Address Lookup for Public Network Context · Choose a Network Tool
