Non-routable IP address

ip-addressnetworkingtcp

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.

Best Solution

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.

Related Question