IP Addresses in Documentation

Depending on the system you’re documenting, you may find you need to include example IP addresses either in text or screengrabs at some point. Including real-life data from the docs/test system could leave the company you’re working for exposed to attacks, as a malicious reader may (often rightly) infer that the system used for documentation uses weak passwords, may contain development versions of software with buggy areas, and probably isn’t policed for odd looking behaviour.

At the same time, making up values could result in you directing readers who enter example values verbatim to live servers elsewhere, either within the company or elsewhere, with potentially interesting results.

Happily, such problems have been anticipated and blocks of IPv4 and IPv6 addresses have been put by specifically for use in documentation (which may be user documentation, specs, RFCs, or other materials).

RFC 5737 puts by the following IPv4 addresses for use in documentation:

  • 192.0.2.0/24 (TEST-NET-1)
  • 198.51.100.0/24 (TEST-NET-2)
  • 203.0.113.0/24 (TEST-NET-3)

In each example address, the first 3 dot-separated numbers should match one of the above ranges, and the final number can be any value from 0 to 255. For example, the following IPv4 addresses would be safe to use in documentation:

  • 192.0.2.127
  • 198.58.100.1
  • 203.0.0.113.23

RFC 3849 puts by 2001:db8::/32 as the global unicast address prefix for IPV6 addresses in documentation. In this case, example addresses should begin with 2001:db8: and be completed according to the following rules:

  1. The full address should contain up to eight groups of four digit hexadecimal numbers (0-f), colon-separated.
  2. Leading zeroes within any four digit number can be dropped.
  3. A single run of consecutive groups of zeroes can be replaced by a double colon.
    However, multiple runs of groups of zeros in a single address cannot all be replaced with double colons. So:

    • 2001:db8:0:0:0:0:0:1 can be truncated to 2001:db8::1
    • 2001:db8:0:0:1:0:0:1 cannot be truncated to 2001:db8::1::,1: but could be tuncated to either 2001:db8:0:0:1::1 or 2001:db8::1:0:0:1

So, the following example IPv6 addresses would be safe to use in documentation:

  • 2001:db8::1
  • 2001:db8:12:4::26
  • 2001:db8::89a:900

If you’re interested, you can see a list of other IPv4 and IPv6 addresses reserved for special purposes in RFC 6890.

Author: smurphy

Writer, mother, gardener, geek...