6

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

Jon Seigel
  • 12,251
  • 8
  • 58
  • 92
  • Are you trying to figure out if an IP address is NAT'ed? What is the ultimate end goal that you are attempting to achieve? Maybe then we can better help you! – X-Istence Mar 02 '09 at 10:52

5 Answers5

14

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

Toon Krijthe
  • 52,876
  • 38
  • 145
  • 202
  • 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) – Erik Funkenbusch Mar 02 '09 at 08:23
  • 1
    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 Mar 02 '09 at 08:26
  • 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 Mar 02 '09 at 10:57
3

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
  • 98,240
  • 88
  • 296
  • 433
  • Class A/B/C don't exist as concepts any more. – Alnitak Mar 02 '09 at 08:21
  • Maybe you're right. But on CCNA courses last year we was told about classes. I'll read more about that. Thanks – abatishchev Mar 02 '09 at 08:25
  • 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 Mar 02 '09 at 08:28
1

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

Community
  • 1
  • 1
Alnitak
  • 334,560
  • 70
  • 407
  • 495
1

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

Community
  • 1
  • 1
Ken Browning
  • 28,693
  • 6
  • 56
  • 68
0

Besides those A,B,C intranet classes, there are other reserved addresses not used as public internet IPs, especially:

  • 127.x.y.z (loopback)
  • 0.x.y.z (can be reserved for broadcast explained here)
  • 224-255.x.y.z (multicast & future use)

There are also many wasted IP addresses (legacy from stupid ages). You won't see most addresses in range

  • cca 3-40.x.y.z (i.e. 17.x.y.z wasted for Apple Computers)
Jan Turoň
  • 31,451
  • 23
  • 125
  • 169
  • I know, old (and probably offtopic) question - but these ip ranges should not be ommited. – Jan Turoň Dec 19 '15 at 01:43
  • Never, have I ever heard this term, "reserved broadcast". I do know two things: i) 0.0.0.0 is non-routable meta-address. ii) Broadcast addresses are the address used for broadcasting when we create any form of network. – Pranav Apr 11 '21 at 07:30
  • @Pranav apologies for my English, I meant "reserved for broadcast". As I double checked, this use is non-standard, at least what is written in the link I added in the answer. – Jan Turoň Apr 11 '21 at 08:38
  • thanks for the correction. I was confused. I even googled it if such exist. – Pranav Apr 11 '21 at 09:12