Distinguish the between intranet and official IP addresses

后端 未结 5 604
粉色の甜心
粉色の甜心 2021-02-06 11:03

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

相关标签:
5条回答
  • 2021-02-06 11:39

    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

    0 讨论(0)
  • 2021-02-06 11:48

    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

    0 讨论(0)
  • 2021-02-06 12:03

    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

    0 讨论(0)
  • 2021-02-06 12:04

    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.

    0 讨论(0)
  • 2021-02-06 12:04

    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 (reserved broadcast)
    • 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)
    0 讨论(0)
提交回复
热议问题