The address 172.31.255.255 is private. The very next address, 172.32.0.0, is a public internet address that belongs to someone else. Python’s ipaddress module agrees: asked about the first it answers private=True, about the second private=False. Nothing about the two numbers looks different at a glance, and that’s exactly why the middle private range catches so many people. The rules come from a 1996 standard, RFC 1918, and a handful of later reservations that sit next to it and get confused with it. Every check below was run in Python 3.13 and on a Linux test machine for this post.
The three blocks
What RFC 1918 reserves
RFC 1918, “Address Allocation for Private Internets,” was published in February 1996. It sets aside three ranges that anyone may use inside their own network without asking a registry:
| Block | Range | Addresses |
|---|---|---|
| 10.0.0.0/8 | 10.0.0.0 to 10.255.255.255 | 16,777,216 |
| 172.16.0.0/12 | 172.16.0.0 to 172.31.255.255 | 1,048,576 |
| 192.168.0.0/16 | 192.168.0.0 to 192.168.255.255 | 65,536 |
The address counts came from Python’s ip_network(...).num_addresses. Together the three blocks hold 17,891,328 addresses, all reusable by every home and company on earth at the same time.
Why reuse works
The trick is a promise about routing. The RFC says routing information about private networks “shall not be propagated on inter-enterprise links,” and that “packets with private source or destination addresses should not be forwarded across such links.” A home’s 192.168.1.20 and a neighbor’s 192.168.1.20 never meet, because neither address is ever supposed to appear on the public internet. The router at the edge translates them to a public address on the way out.

The 172 trap
A /12 doesn’t end where it looks like it should
The 10 and 192.168 blocks line up with the dots in the address: everything starting with 10, everything starting with 192.168. The middle block doesn’t. A /12 fixes the first 12 bits, which covers all of the first number and only the top half of the second. The result is 16 consecutive values in the second position, 172.16 through 172.31, and nothing on either side.
Checked in code
172.15.255.255 private=False global=True
172.16.0.1 private=True global=False
172.31.255.255 private=True global=False
172.32.0.0 private=False global=True
192.168.1.1 private=True global=False
192.169.0.1 private=False global=True
Both edges are sharp. 172.15.x and 172.32.x are ordinary public space, and so is 192.169.0.1, one number past the most familiar home range. A firewall rule written as “172.x is internal” lets the whole rest of 172 through as if it were trusted. The reverse mistake happens too: an allow-list that only names 172.16.0.0/16 quietly leaves out 172.17 through 172.31, which is where Docker puts its networks: on the test machine, the default bridge came up as 172.17.0.0/16 and a newly created network as 172.20.0.0/16. Both errors come from reading the second number as if it were a whole block.
The netmasks
Python reports the masks as 255.0.0.0, 255.240.0.0 and 255.255.0.0. The 240 in the middle mask is the giveaway: it’s binary 11110000, four bits of the second number fixed, four free, sixteen possible values.
Ranges that look private but aren’t RFC 1918
IANA’s special-purpose list
The IANA IPv4 Special-Purpose Address Registry, last updated October 9, 2025, lists every reserved block and the document behind it. The three RFC 1918 blocks appear there as “Private-Use.” Several neighbors carry other names:
| Block | Registry name | Defined in |
|---|---|---|
| 100.64.0.0/10 | Shared Address Space | RFC 6598 |
| 127.0.0.0/8 | Loopback | RFC 1122 |
| 169.254.0.0/16 | Link Local | RFC 3927 |
| 192.0.2.0/24 | Documentation (TEST-NET-1) | RFC 5737 |
| 198.18.0.0/15 | Benchmarking | RFC 2544 |
None of these is for building a home network. A computer showing a 169.254 address usually failed to get one from DHCP and assigned itself a link-local address. 192.0.2.0/24 exists so that manuals and examples can use addresses that will never belong to a real machine.
100.64.0.0/10, the carrier’s private space
The one that causes real confusion is 100.64.0.0/10. RFC 6598, from April 2012, reserves it “to accommodate the needs of Carrier-Grade NAT (CGN) devices,” and states that it “is distinct from [RFC 1918] private address space” and is “intended for use on Service Provider networks.” A home router whose WAN address starts with 100.64 through 100.127 is sitting behind the internet provider’s own NAT, which is why port forwarding from outside doesn’t work on many such connections.

What Python calls “private”
A broader definition
Python’s is_private isn’t an RFC 1918 test. The ipaddress documentation defines it as True “if the address is defined as not globally reachable” by the IANA registry, with one exception: it is False for the shared address space, 100.64.0.0/10. The test results bore that out:
100.64.0.1 private=False global=False
169.254.10.20 private=True global=False
127.0.0.1 private=True global=False
198.18.0.1 private=True global=False
192.0.2.5 private=True global=False
8.8.8.8 private=False global=True
Loopback, link-local, benchmarking and documentation addresses all report as “private,” and the carrier range reports as neither private nor global. The documentation notes the two properties are opposites “except for the shared address space” where “they are both False.”
A precise check
Code that needs to know specifically whether an address is in one of the three RFC 1918 blocks should test against those three networks directly, for example any(addr in ip_network(n) for n in ("10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16")). The documentation also notes that version 3.13 changed is_private “to fix some false positives and false negatives,” so older Python releases can give different answers for edge cases.
When two private networks collide
The VPN problem
Because everyone reuses the same blocks, two networks that were never meant to meet sometimes do. The classic case is a laptop on a home network using 192.168.1.0/24 that connects to a VPN whose office network also uses 192.168.1.0/24. A Linux test machine was given both: a home interface at 192.168.1.20/24 and a VPN interface, with a route sending 192.168.1.0/24 over the VPN as well.
What the kernel chose
192.168.1.0/24 dev home proto kernel scope link src 192.168.1.20
192.168.1.0/24 dev vpn scope link metric 50
$ ip route get 192.168.1.50
192.168.1.50 dev home src 192.168.1.20
Both routes match the same prefix, so the lower metric wins, and the automatic route for the home interface has metric 0. Every address on the office’s 192.168.1.0/24 network was unreachable through the VPN. Adding a more specific route for one office machine, 192.168.1.50/32 via the VPN, moved only that address: ip route get 192.168.1.50 now went out vpn, while 192.168.1.51 still went to home.
Avoiding it
The practical fix is to pick less common subnets in the first place. Home routers default heavily to 192.168.0.x and 192.168.1.x, so a home lab or small office numbered from somewhere less crowded, a random /24 inside 10.0.0.0/8 or the middle of 172.16.0.0/12, is far less likely to clash with the next VPN, hotel or partner network it meets.

IPv6 has its own version
Unique local addresses
IPv6 has a counterpart to the private blocks, with one deliberate difference. RFC 4193, “Unique Local IPv6 Unicast Addresses,” from October 2005, reserves the “FC00::/7 prefix to identify Local IPv6 unicast addresses.” The next bit, called L, is “Set to 1 if the prefix is locally assigned,” which in practice means every locally chosen prefix starts with fd. The RFC says these addresses “are not expected to be routable on the global Internet,” the same promise RFC 1918 makes.
Random on purpose
The difference is in how the network number is picked. After the fd comes a “40-bit global identifier,” and the RFC says locally assigned ones “MUST NOT be assigned sequentially or with well-known numbers.” Instead of everyone choosing the same 192.168.1.0/24, each site generates its own random number, which leaves 2^40, roughly 1.1 trillion, possible /48 prefixes. A generated example, fd3a:7c91:e05b::/48, gives one site 65,536 /64 subnets of its own. Python reports an address inside it, fd3a:7c91:e05b::1, as private. Two networks that each followed the rule have a vanishingly small chance of picking the same prefix, which is exactly the VPN collision problem the IPv4 blocks never solved.
Picking a range for a home lab
Size
A /24 holds 256 addresses, 254 of them usable for devices, which is plenty for most homes. 192.168.0.0/16 can be split into 256 such networks; 172.16.0.0/12 into 4,096; 10.0.0.0/8 into 65,536.
A few habits that save trouble later
- Avoid 192.168.0.0/24 and 192.168.1.0/24 if VPNs are in the picture.
- Leave room between networks, such as one /24 for main devices and another for cameras or guests, rather than numbering everything consecutively.
- Never number anything in 100.64.0.0/10; a provider or a mesh VPN may already be using it on the other side of the connection.
- When writing firewall rules, list the three exact blocks rather than shortcuts like “172.x.”
- Treat any device that shows up with a 169.254 address as a DHCP problem, not a configuration choice.
Sources
- RFC 1918, “Address Allocation for Private Internets”: https://www.rfc-editor.org/rfc/rfc1918.html
- RFC 6598, “IANA-Reserved IPv4 Prefix for Shared Address Space”: https://www.rfc-editor.org/rfc/rfc6598.html
- IANA IPv4 Special-Purpose Address Registry: https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml
- RFC 4193, “Unique Local IPv6 Unicast Addresses”: https://www.rfc-editor.org/rfc/rfc4193.html
- Python documentation, ipaddress module: https://docs.python.org/3/library/ipaddress.html
