Test IP Address Ranges: IPv4, IPv6 and Private Networks
Choose documentation IPs for fixtures and private IPs for controlled networks. Includes IPv6 3fff::/20, exact range counts and parser edge cases.
By Vincent RuanPublished June 25, 2026Last updated September 6, 20264 min read

Test IP address ranges depend on the task. Use documentation prefixes for addresses displayed in tutorials, screenshots and stored fixtures. Use an assigned address on a network you control for a working test endpoint. Private IPs may reach real equipment; documentation allocations describe intended use, not an automatic firewall [rfc5737][rfc1918].
Documentation IP ranges to copy into examples
| Prefix | Example | Total address values | Source |
|---|---|---|---|
| 192.0.2.0/24 | 192.0.2.42 | 256 | RFC 5737 [rfc5737] |
| 198.51.100.0/24 | 198.51.100.7 | 256 | RFC 5737 |
| 203.0.113.0/24 | 203.0.113.5 | 256 | RFC 5737 |
| 2001:db8::/32 | 2001:db8::1 | 2^96 | RFC 3849 [rfc3849] |
| 3fff::/20 | 3fff::1 | 2^108 | RFC 9637 [rfc9637] |
RFC 9637 expanded the IPv6 documentation space in 2024; it did not replace 2001:db8::/32. A validator or example allowlist that recognizes only the older prefix misses the newer allocation. Keep the allowed prefixes explicit instead of relying on a loosely named isPrivate helper.
Private, loopback and documentation addresses do different jobs
| Address class | Ranges | Use | What can answer? |
|---|---|---|---|
| Documentation | The five prefixes above | Examples, parser inputs and stored log fixtures | No public destination is intended; do not rely on that to isolate a test |
| IPv4 private | 10.0.0.0/8; 172.16.0.0/12; 192.168.0.0/16 | Controlled LAN, VPN or VPC tests | Real internal machines can answer [rfc1918] |
| Loopback | 127.0.0.0/8; ::1 | A test server on the same host or network namespace | Local services can answer [iana-v4][iana-v6] |
| IPv6 unique local | fc00::/7; locally generated prefixes use fd00::/8 | An administered internal IPv6 network | Real internal machines can answer [rfc4193] |
A webhook fixture containing 10.0.0.1 can contact a company service when a developer connects to a VPN. Changing it to a documentation IP improves the example, but the test harness should still intercept the HTTP call or allow connections only to its test server. Do not assign TEST-NET addresses as a substitute for a private network plan.
How to generate a small deterministic fixture
For 100 unique display values, this JavaScript expression is sufficient: Array.from({ length: 100 }, (_, i) => "192.0.2." + (i + 1)). It emits 192.0.2.1 through 192.0.2.100, requires no random library, and repeats on every run. These are strings for a fixture, not endpoints to probe.
For a larger file, enumerate across all three IPv4 documentation blocks and decide whether .0 and .255 belong in your test. The full space is 3 × 256 = 768 values. Excluding those two values per block leaves 3 × 254 = 762. A request for 10,000 unique IPv4 documentation strings is impossible within these blocks; permit repeats if uniqueness is irrelevant, or use IPv6 documentation space.
The bulk identity exporter currently exports person and address fields, not IP addresses. Add the IP fixture column in your own script.
Parser cases: syntax, normalization and purpose
| Input | Expected syntax | What the case checks |
|---|---|---|
| 192.0.2.42 | Valid IPv4 | Ordinary documentation example |
| 192.0.2.0 | Valid IPv4 | Network-address treatment depends on subnet context |
| 192.0.2.255 | Valid IPv4 | Broadcast treatment depends on subnet context |
| 192.0.2.300 | Invalid | An octet exceeds 255 |
| 2001:0DB8:0:0:0:0:0:1 | Valid IPv6 | Normalize to 2001:db8::1 |
| 2001:db8::1::2 | Invalid | Only one double-colon compression is allowed |
| 3fff::1 | Valid IPv6 | Include the newer documentation prefix |
| 10.0.0.1 | Valid IPv4 | Private does not mean a fictional destination |
IPv6 has multiple valid textual representations. RFC 5952 gives a canonical output form: lowercase hexadecimal, omit leading zeros, compress the longest run of zero groups and use the first run when tied. Do not compress a single zero group. Accept valid input forms, parse them, then compare normalized values [rfc5952].
Checks before committing an IP fixture
- Validate syntax and CIDR membership separately. A valid address can still be outside your approved example ranges.
- State whether the test stores a string or opens a connection. Configure network isolation for the latter.
- Check uniqueness only when the test requires it; documentation IPv4 space is finite.
- For related device fields, use the MAC format guide and User-Agent parser cases.
References & sources
- RFC 5737: IPv4 documentation blocks and operational implications — IETF
- RFC 1918: Private address space — IETF
- RFC 3849: IPv6 documentation prefix — IETF
- RFC 9637: Expanding the IPv6 documentation space — IETF
- RFC 4193: Unique Local IPv6 Unicast Addresses — IETF
- RFC 5952: IPv6 text representation — IETF
- IPv4 Special-Purpose Address Registry — IANA
- IPv6 Special-Purpose Address Registry — IANA
Frequently asked questions
Which IP addresses should I use in test data?
For documentation and fixtures, use 192.0.2.0/24, 198.51.100.0/24 or 203.0.113.0/24 for IPv4, and 2001:db8::/32 or 3fff::/20 for IPv6. For an actual test server, use an address assigned inside a network you control.
Can a private IP address reach a real server?
Yes. An address such as 10.0.0.1 or 192.168.1.1 may belong to a real router, database or service reachable over a LAN, VPN or VPC. Private addressing means it is not globally unique public space, not that the destination is fictional.
Is 2001:db8::/32 the only IPv6 documentation prefix?
No. RFC 9637 added 3fff::/20 in 2024 for larger documentation scenarios. 2001:db8::/32 remains reserved for documentation.
How many example IPv4 addresses are available?
The three TEST-NET /24 blocks contain 256 values each, or 768 total. If your examples deliberately exclude the conventional /24 network and broadcast values, that leaves 762. Documentation address counts are not a promise of usable live hosts.
Does the Fakenamely bulk exporter include IP addresses?
The current identity and bulk schemas do not include IPv4 or IPv6 fields. Use the ranges and generation expression in this article to create those fields separately and join them to your own fixtures.
More on technical identifiers
- MAC Address Format: OUI, Bits & Test Examples
- User-Agent String Format & Parser Test Cases
- UUID vs GUID: Versions 1, 4, 7 and When to Use Them
- What Is Synthetic Test Data? A Developer's Guide
- Test Data Generation Guide: Schemas, Rows & Edge Cases
- Mock Data vs. Real Data: Why Teams Test With Fake Profiles