views:

1070

answers:

4

How can I find out whether a given IP address is an official internet address or an internal intranet IP address?

+6  A: 

Intranet IP's are often in the private IP range:

10.0.0.0 through 10.255.255.255
172.16.0.0 through 172.31.255.255
192.168.0.0 through 192.168.255.255

These are not usable for internet IP addresses.

See also http://compnetworking.about.com/od/workingwithipaddresses/f/privateipaddr.htm

Gamecat
However, there's no guarantee that they follow that rule. Some networks have actual, real internet IP's even internally. Especially some of the earlier internet savvy companies, schools and organizations that were allocated huge IP blocks (whole Class A's or B's)
Mystere Man
indeed - almost every public IP address in use actually forms part of _somebody's_ intranet - the Internet after all is nothing more than a network of networks...
Alnitak
It is true that some organisations use globally allocated IP addresses internally, but the reverse is not true in normal circumstances. A message from a private IP will not have come from the wider internet, or if it did, a router would certainly not let it go back there.
thomasrutter
+1  A: 

RFC 1918 defines some IP address ranges which can't exist on the internet, and are therefore suitable for intranet use (i.e. 10/8, 172.16/12, 192.168/16).

Apart from that, what do you mean? Are you trying to find out which IPs are on the same subnet as your own machine, or on some other 3rd party network?

See also http://en.wikipedia.org/wiki/Private_network

Alnitak
+1  A: 

10.0.0.0 - 10.255.255.255` (10.0.0.0/8, former Class A)

172.16.0.0 - 172.31.255.255` (172.16.0.0/12, former Class B)

192.168.0.0 - 192.168.255.255` (192.168.0.0/24, former Class C)

Founding out that given IP belongs to that, depends in what form do you have given IP. The best way to use bytes.

abatishchev
Class A/B/C don't exist as concepts any more.
Alnitak
Maybe you're right. But on CCNA courses last year we was told about classes. I'll read more about that. Thanks
abatishchev
hardly surprising that the CCNA course is out of date. It used to be that the subnet mask was implicit from the first octet (i.e. 0-126 = class A, 128 - 191 = class B, 192 - 223 = class C), and it was impossible to use a subnet mask longer than the "natural" mask for your network :(
Alnitak
+1  A: 

The Internet Assigned Numbers Authority (IANA) has reserved the following three blocks of the IP address space for private internets:

 10.0.0.0        -   10.255.255.255  (10/8 prefix)
 172.16.0.0      -   172.31.255.255  (172.16/12 prefix)
 192.168.0.0     -   192.168.255.255 (192.168/16 prefix)

source

Ken Browning