non-routable IP address

93,499

Solution 1

According to https://en.wikipedia.org/wiki/0.0.0.0, the IP address 0.0.0.0 “is a non-routable meta-address used to designate an invalid, unknown or non-applicable target.”

Solution 2

According to Wikipedia article on reserved addresses, there are 3 test networks intended for use in documentation only.

192.0.2.0/24
198.51.100.0/24
203.0.113.0/24

Any address in one of those ranges (eg 203.0.113.1) should not map to anything, and indeed should fail to route.

Depending on the type of test you are doing, there are other listed addresses and address ranges that could be appropriate for what you are trying to do.

Solution 3

I think you may want to reword your question. The private address segments (10.0.0.0 - 10.255.255.255, 172.16.0.0 - 172.31.255.255, 192.168.0.0 - 192.168.255.255) are commonly referred to as "non-routable" addresses. I think what you are asking for is a reserved IP address that is reserved specifically to never be assigned. As far as I know there is no address that is reserved in this fashion.

Solution 4

192.0.2.0

According to http://en.wikipedia.org/wiki/Reserved_IP_addresses

Assigned as "TEST-NET" in RFC 5737 for use solely in documentation and example source code and should not be used publicly.

https://www.rfc-editor.org/rfc/rfc5737

Solution 5

Looking at RFC 3330, I don't see any IPv4 address reserved for a globally non-routable address.

What I would do is assign -- in local DNS -- an unused local network IP address to the name "blackhole.<domain>" (using the appropriate domain) so you are guaranteed a stable address to which no computer will ever respond. Of course, like always when configuring DNS, ensure that no DHCP server is configured to give out the same address.

Share:
93,499
hasni
Author by

hasni

Drupal expert, working in London. Drupal highlights: Helping the Econmist.com drupal migration Implementing first (That I can find) .nhs.uk site to use Drupal Building up Level Business from holding site to be one of the top 3000 sites in the uk in four months (with no marketing spend). Converting devel_themer to work on D7 http://about.me/jeremyfrench http://drupal.org/user/419876

Updated on January 12, 2022

Comments

  • hasni
    hasni over 2 years

    I know that 127.0.0.1 is by convention the loopback address and that there are various address ranges which are reserved for local use.

    Is there an IP address that is reserved never to be assigned?

    I would like to test that something works when an IP address can't be found, I could just use a local address which isn't used but thought that there may be an address which is reserved for such use.

  • Peter
    Peter about 8 years
    As I mentioned in my answer, there are 3 address ranges reserved for documentation only. Addresses in those blocks won't route on any network you attach to, not just one you set up in advance. Of course an unused IP address on your local network will probably fail faster. The DNS step here is orthogonal to deciding on the IP address, setting up DNS just gives your IP address a name. The important step, if using a network-local IP address is the DHCP server configuration.
  • Eddie
    Eddie about 8 years
    @Peter: Be warned. I don't trust that the "reserved for documentation" blocks are always treated as such, For example, on my employer's network, I just pinged 192.0.2.2 and got a response. It's live, as are a number of other addresses in that subnet. So this fits in with my answer of identify an unused local LAN address and use that. Yes, DNS just makes it easier to access and also is a form of documentation that you've locally reserved that address to not be used by anything.
  • Eddie
    Eddie about 8 years
    That's a good reference and a good idea, but do first check that the address you're using isn't assigned to anything. My employer's network is assigning addresses in 192.0.2.0/24 for example.
  • Peter
    Peter about 8 years
    Sadly you are correct, you can't rely on companies to stick with the nearly 18 million IP addresses allocated for private networks and not use addresses from the documentation-only sets. However, it seems like a dumb thing to do. I bet you can find one of the ranges they are not using, I'd try something in 203.0.113.0/24.
  • Peter
    Peter about 8 years
    I bet you can find one of the ranges they are not using, I'd try something in 203.0.113.0/24. I suspect the 192.0.2.0/24 range is being abused due its closeness and similarity to 192.0.0.0/24, which is a valid private range.
  • Peter
    Peter almost 6 years
    Those special ranges may not work. 127.0.0.1 should always work as local loopback, and in fact the entire 127.0.0.0/8 range is reserved for loopback, so it may connect to your local host. 169.254.0.0/16 is link-local, and has been used traditionally by Windows when DHCP is not working/configured. But it's a big range, and you'll nearly always not get a conflict in that range. As I mentioned in my answer, there are ranges that should never have conflict, if your network is standards-compliant. 203.0.113.0/24 is probably the safest, set aside for documentation only.
  • Mikol Graves
    Mikol Graves over 3 years
    According to en.wikipedia.org/wiki/0.0.0.0, the IP address 0.0.0.0 “is a non-routable meta-address used to designate an invalid, unknown or non-applicable target.”
  • hasni
    hasni over 3 years
    11 years later and the answer is found, nice work.
  • Mikol Graves
    Mikol Graves over 3 years
    Hahaha, yeah... Cheers!
  • nar8789
    nar8789 over 2 years
    This does not work in practice. On osx, if I set up a local web server and curl 0.0.0.0, I get a response. On linux, if I ping 0.0.0.0, it treats it as 127.0.0.1.
  • nar8789
    nar8789 over 2 years
    Should also note that 255.255.255.255 is the link-local broadcast address. So, in particular, unsuitable for ping.
  • Mikol Graves
    Mikol Graves over 2 years
    @nar8789, it appears you are correct. “[0.0.0.0 may be] a way to specify ‘any IPv4 address at all’.” “[0.0.0.0 may be] the address a host claims as its own when it has not yet been assigned an address. Such as when sending the initial DHCPDISCOVER packet when using DHCP.” “In the context of servers, 0.0.0.0 can mean ‘all IPv4 addresses on the local machine’. If a host has two IP addresses, 192.168.1.1 and 10.1.2.1, and a server running on the host is configured to listen on 0.0.0.0, it will be reachable at both of those IP addresses.” :sigh: