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

Illustration for this article: Choose documentation IPs for fixtures and private IPs for controlled networks. Includes IPv6 3fff::/20, exact range counts and parser edge cases.

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

PrefixExampleTotal address valuesSource
192.0.2.0/24192.0.2.42256RFC 5737 [rfc5737]
198.51.100.0/24198.51.100.7256RFC 5737
203.0.113.0/24203.0.113.5256RFC 5737
2001:db8::/322001:db8::12^96RFC 3849 [rfc3849]
3fff::/203fff::12^108RFC 9637 [rfc9637]
Documentation allocations. Counts are calculated as 2^(address bits − prefix bits), not measured host counts.

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 classRangesUseWhat can answer?
DocumentationThe five prefixes aboveExamples, parser inputs and stored log fixturesNo public destination is intended; do not rely on that to isolate a test
IPv4 private10.0.0.0/8; 172.16.0.0/12; 192.168.0.0/16Controlled LAN, VPN or VPC testsReal internal machines can answer [rfc1918]
Loopback127.0.0.0/8; ::1A test server on the same host or network namespaceLocal services can answer [iana-v4][iana-v6]
IPv6 unique localfc00::/7; locally generated prefixes use fd00::/8An administered internal IPv6 networkReal internal machines can answer [rfc4193]
Choose by whether the test should actually connect.

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

InputExpected syntaxWhat the case checks
192.0.2.42Valid IPv4Ordinary documentation example
192.0.2.0Valid IPv4Network-address treatment depends on subnet context
192.0.2.255Valid IPv4Broadcast treatment depends on subnet context
192.0.2.300InvalidAn octet exceeds 255
2001:0DB8:0:0:0:0:0:1Valid IPv6Normalize to 2001:db8::1
2001:db8::1::2InvalidOnly one double-colon compression is allowed
3fff::1Valid IPv6Include the newer documentation prefix
10.0.0.1Valid IPv4Private does not mean a fictional destination
Expected syntax results use ordinary IPv4/IPv6 address parsing. Whether an address is allowed as a destination is a separate application policy.

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

  1. RFC 5737: IPv4 documentation blocks and operational implications — IETF
  2. RFC 1918: Private address space — IETF
  3. RFC 3849: IPv6 documentation prefix — IETF
  4. RFC 9637: Expanding the IPv6 documentation space — IETF
  5. RFC 4193: Unique Local IPv6 Unicast Addresses — IETF
  6. RFC 5952: IPv6 text representation — IETF
  7. IPv4 Special-Purpose Address Registry — IANA
  8. 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

Put this to work