Velvet Star Monitor

Standout celebrity highlights with iconic style.

updates

non-routable IP address [closed]

Writer Matthew Martinez

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.

11 Answers

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.

2

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.

Anything in the

10.0.0.0/8
172.16.0.0/12
192.168.0.0/16

ranges will be dropped by any Internet router - they are intended for internal use only and are not routed. There isn't a single address but using one from a block you don't use internally, as long as your router isn't too clever will do the job.

Of course if you have a managed router it may well drop these anyway and not let them go out of the internal network.

RFC-3330 lists these, and lots of other blocks as well

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.

4

192.0.2.0

According to

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

According to , the IP address 0.0.0.0 “is a non-routable meta-address used to designate an invalid, unknown or non-applicable target.”

4

Well, the answers given are more or less correctly. What you can do is to assign some of the special addresses that are commonly only used as net masks. These will never be encountered in the wild as IP-addresses, so are safe - as long as you don't actually try to use them in the wrong circumstances.

The best ones are:

0.0.0.0 - but be careful to not use it to open a socket, since it will then open a socket to the current main interface on the computer

255.255.255.255 - this one is never assigned, so it should be the best sentinel, unless you need to interact with netmasks.

1

I had a similar question and I went to figure; if I understood properly; to use a non-forwardable network such as : 169.254.0.0/16 or 127.0.0.0/8

1

Will IPv6 work for your purposes? It looks like IPv6 has a whole range specifically reserved for blackhole usage: 100::/64

So, specifically, 100:: should work.

Wikipedia reference:

RFC:

depending on what the test is you might be able to use the subnet broadcast address. i.e.

network = 192.168.1.0 /24

broadcast = 192.168.1.255

For IPV4 the non-routable addresses ranges are from 10.1.1.1 to 10.255.255.254, from 172.16.1.1 to 172.31.255.254, and from 192.168.1.1 to 192.168.255.254. These IP addresses will not be recognized outside of a private network.