Special-purpose ranges: private, CGNAT, loopback, link-local and documentation
Know what the special-purpose IPv4 blocks are for (RFC 1918 private, RFC 6598 shared CGNAT space, loopback, RFC 3927 link-local and RFC 5737 documentation), what seeing one tells you during an incident, and when using one in your own plan causes trouble.
Contentsand lesson path
On this page
- Why it matters
- Private space (RFC 1918) and shared space for carrier NAT (RFC 6598)
- Loopback, link-local, documentation and the rest of the registry
- Reading addresses during an incident, and when not to use a block
- Check your understanding
- Apply it
- Review prompt
Lessons of IPv4 Addressing & Subnetting
- Addresses as 32-bit numbers: binary, masks and prefixes Concept · 20 min
- Worked example: subnetting any prefix without a cheat sheet Worked example · 25 min
- VLSM planning: sizing, ordering and leaving room to summarize Worked example · 25 min
- Special-purpose ranges: private, CGNAT, loopback, link-local and documentation Concept · 15 min
- Lab: on-link vs off-link delivery - ARP, the gateway and ICMP in a capture Lab · 25 min
- Check: timed subnetting and addressing-plan exercise Knowledge check · 8 questions
What you will learn
- Explain private, shared (CGNAT), loopback, link-local and documentation ranges and when each is used.
Prerequisites: Networking Basics
01. Why it matters
Suppose you inherit a network diagram with these blocks on it: 10.8.0.0/16 for headquarters, 172.32.0.0/16 for a DMZ, 100.64.10.0/24 for a test lab, hand-configured 169.254.x.x addresses on a storage cluster's back-to-back links, and an NTP server at 192.0.2.123 copied from a vendor's sample configuration. None of these is an ordinary public address that you bought from a registry, and each one means something different. One is a sound choice, one is not private at all, one collides with what Internet providers use, one goes against the standard that defines it, and one points at a server that cannot exist.
The IANA IPv4 Special-Purpose Address Registry lists the blocks set aside for particular jobs, with flags for each one: whether it may be used as a source or destination, whether routers may forward it, and whether it is globally reachable. Knowing the main blocks lets you read an address as evidence (another NAT upstream, a failed DHCP request, an example pasted into production) and keeps your own plans out of trouble.
03. Loopback, link-local, documentation and the rest of the registry
Loopback, 127.0.0.0/8. The whole /8, not just 127.0.0.1, refers to the host itself. RFC 1122 (section 3.2.1.3) says such addresses must not appear outside a host, and the registry marks them as not forwardable. Linux makes the entire block local: ip route show table local lists local 127.0.0.0/8 dev lo, so a test service can listen on 127.0.0.2 without any configuration. Other systems may configure only 127.0.0.1 by default.
Link-local, 169.254.0.0/16. RFC 3927 defines a way for a host with no other configuration to pick an address for itself, at random between 169.254.1.0 and 169.254.254.255 (the first and last 256 addresses are reserved), after checking with ARP that nobody else has it. The most common reason to see one is a DHCP request that got no answer: a laptop showing 169.254.140.18/16 and no default gateway points at the cable, the switch port's VLAN, the DHCP relay or the DHCP server. Link-local addresses work only on the local link. RFC 3927 says a host must never send a packet with a link-local destination to a router, and the registry marks the block as not forwardable. For other destinations, RFC 3927 asks a host that has only a link-local address to ARP for the destination directly; in practice a host that got no DHCP answer also got no default gateway, and on Linux an off-link ping then fails at once with Network is unreachable. Cloud platforms use the "never routed" property on purpose: AWS, for example, serves instance metadata at 169.254.169.254, an address that only makes sense on the instance's own link.
Documentation, 192.0.2.0/24, 198.51.100.0/24 and 203.0.113.0/24. RFC 5737 names them TEST-NET-1, -2 and -3 and reserves them for examples in documentation, which is why this course uses them in its labs. Addresses in them should not appear on the public Internet, operators should filter them, and the RFC states that the blocks are not for local use either. The registry marks them as neither a valid source nor a valid destination.
Other blocks worth recognising. 198.18.0.0/15 is set aside for benchmarking network devices (RFC 2544): seeing it outside a test lab usually means some device or tool is using it as if it were private space, so find out which. 240.0.0.0/4 is reserved, 0.0.0.0/8 means "this network", and 255.255.255.255 is the limited broadcast that stays on the local link. Multicast, 224.0.0.0/4, is not in this registry at all; IANA keeps it in a separate multicast address registry.
block purpose defined in forwardable global
10.0.0.0/8 private use RFC 1918 yes no
172.16.0.0/12 private use (172.16-31) RFC 1918 yes no
192.168.0.0/16 private use RFC 1918 yes no
100.64.0.0/10 shared space for CGN RFC 6598 yes no
127.0.0.0/8 loopback RFC 1122 no no
169.254.0.0/16 link local RFC 3927 no no
192.0.2.0/24 documentation TEST-NET-1 RFC 5737 no no
198.51.100.0/24 documentation TEST-NET-2 RFC 5737 no no
203.0.113.0/24 documentation TEST-NET-3 RFC 5737 no no
198.18.0.0/15 benchmarking RFC 2544 yes no
240.0.0.0/4 reserved RFC 1112 no no04. Reading addresses during an incident, and when not to use a block
During an incident, put the host's address and the router's Internet-facing address side by side. A host on 169.254.x.x most likely never got an answer from DHCP, so look at layer 2 and the DHCP path first. A host on a normal private address behind a router whose Internet side is in 100.64.0.0/10 has working local addressing and outbound access, and sits behind provider CGN, so unsolicited inbound connections will not arrive without the provider's help. A host trying to reach an address in one of the documentation blocks is following an example, not a real server.
The same knowledge keeps your own plans out of trouble:
- Do not number internal networks from
100.64.0.0/10. It looks attractive because it is "not RFC 1918, so it will never clash", but RFC 6598 (section 4) warns that organisations using it for anything other than CGN are likely to have problems when they connect to a CGN service. The day a provider hands one of your sites a WAN address from the same block, the two uses overlap. - Do not configure
169.254.0.0/16by hand. RFC 3927 (section 1.6) says these addresses should not be configured manually or by DHCP, and tells administrators to use RFC 1918 space instead. The storage links in the opening diagram should move to a private block. - Do not let documentation addresses into production. Examples, runbooks and labs are exactly where they belong; a production configuration that still contains one is a bug.
- RFC 1918 is fine in examples of private plans, as in lesson 3, because those addresses are meant to be reused. Prefer RFC 5737 when an example stands for a host on the Internet, so that nobody who copies it reaches a real machine.
05. Check your understanding
06. Apply it
List every IPv4 address on your own machine (ip -br addr on Linux, ipconfig on Windows), including loopback, Docker or VM bridges and any VPN interface, and classify each one against the registry table above. If you can see your home or office router's Internet-facing address, check whether it is in 100.64.0.0/10. Then review the addressing plan you started in lesson 3: confirm that it uses only RFC 1918 space, that no block overlaps a range your VPN users are likely to have at home, and that every example in its documentation for Internet hosts uses RFC 5737.
Next, see these rules on the wire in the on-link vs off-link delivery lab.
07. Review prompt
Without the table, write down the private, shared, loopback, link-local and documentation blocks with their prefixes, then give for each one a conclusion you could draw from seeing it during an incident and one way that using it in your own plan could go wrong.
References
Your progress
Reading state
Sign in to save that you finished reading this lesson.
Prove this skill
8 questions · about 6 minutes · scored automatically. Marking a lesson as read never demonstrates a skill.