IP We often hear the word address , What exactly is it? I won't talk about it here , I suggest you take a look at the of this series of articles 《IP Address and MAC Address profile 》 One article . This article mainly distinguishes the public network IP, Private network IP, dynamic IP, static state IP These four concepts .
Let's start with the public network IP And private network IP.
We've all heard of it IP address , But for the public network IP And private network IP Maybe it's easier to scratch your head . hold IP Put your questions aside , Let's talk about what is a public network first , What is a private network . Public network, also known as Wan , Extranet , It refers to what we usually call the Internet . Private network, also known as Intranet , LAN , Refers to the local interconnection network created under the router or switch . The function of the network is to make multiple computers interconnected , Data can be transmitted to each other . Wan realizes wide area interconnection , LAN realizes local area interconnection . Like we usually watch news online , watch movie , All on the Internet , It can also be said to be a public network . The router or switch is a home , A community , The internal Internet created by an enterprise is LAN .
Public network IP It is used in the public network IP address , Private network IP It is used in LAN IP address .《IP Address and MAC Address profile 》 It was mentioned in the article ,IP Address by 4 Group consisting of decimal numbers , Each group 1～3 position , The value range of each group is 0～255, Between groups . to be connected . as 127.0.0.1,18.104.22.168 All IP address .IP The address is divided into A,B,C,D,E Five categories . among A,B,C Class is for general use ,D,E Class for special purpose . The public network we are involved in everyday IP Or private network IP Basically belong to A,B,C One of three categories .
A Class address range ：22.214.171.124～126.96.36.199.
B Class address range ：188.8.131.52～184.108.40.206.
C Class address range ：192.0.0.1～220.127.116.11.
D Class address range ：18.104.22.168～22.214.171.124.
E Class address range ：240.0.0.0～247.255.255.255.
127.0.0.0 reach 127.255.255.255 Is a reserved address , Used for cycle test . For example, do it locally web It will be used in development .
A Class 10.0.0.0～10.255.255.255,B Class 172.16.0.0～172.31.255.255,C Class 192.168.0.0～192.168.255.255 Private network IP. besides ,A,B,C All the rest of category III IP They are all public networks IP. Private network IP Will only appear in the private network , Public network IP It will only appear in the public network .
Public network IP And private network IP What is the difference in use ?. Public network IP Is one of the Internet that can directly access other IP, It can also be used by others IP A separate identity for direct access . With it , You can find other computers on the Internet directly , It can also be found by other computers . Private network IP Under LAN , If it wants to access the Internet, it needs to be converted into a public network first IP of , This public network IP Is the gateway of LAN IP. For other computers on the public network , No matter which device under the router accesses it , It gets the other party IP It's all the same , Are LAN gateways IP. As for which device in the LAN accesses it , It cannot be known .
for instance , A in LAN , B , C , D four devices ,IP namely 192.168.0.10,192.168.0.11,192.168.0.12,192.168.0.13. LAN is generated by router , The router is the gateway , LAN IP yes 192.168.0.1. Because the router is in the public network , In the private network again , So the router also has a public network IP, Assuming 126.96.36.199. No matter which device accesses the Internet , It is finally transformed into a public network IP All 188.8.131.52.
Private network IP You can directly access other in the public network IP, But it can't be used by others in the public network IP Direct access . This sentence may not be easy to understand for ordinary people , Done website , People who have built servers will know better .IP The function of address is to assign a unique identification to the device on the network , For identification . If we were a LAN IP, Then we want to access a designated public network IP No problem . But others on the public network IP Want to find us , You can't find it directly , It can only find the gateway layer of the LAN at most , As for multiple devices under the router , It can't be distinguished . That's why many people want their own IP It's a public network IP, Not private IP. With the public network IP, Realize remote control , Remote monitoring , Remote file access will be very convenient . If we were a LAN IP, The above functions can also be realized , But it will be troublesome , A lot of extra work needs to be done , For example, port forwarding , Intranet penetration . The effect is not good , It usually costs extra money . Two phase comparison , Public network IP Nature is the best choice .
If you want to see your IP Is it a public network IP, See this series of articles 《 How to query this machine IP Is it a public network IP》 One article .
If you want to transfer the broadband at home from the private network IP Change to public network IP, You can apply to the operator . As for whether we can apply in the end , It's hard to say .IPV4 Address exhaustion , Operators are generally reluctant to change to the public network IP. Customer service doesn't know whether it's true or false , The first call response is generally not understood , It always takes a few more calls to communicate . Let's change to the public network IP The general reason is that there is monitoring at home , No public network IP It won't work . Some people say , In case people question me, I don't need the public network for monitoring now IP What if it works ? Don't worry about this , Operators also know it , Asking reasons is usually just routine , The specific reason is not important . But be careful , Even if the application comes down , It may not be permanent , It may suddenly turn back to the private network IP, You need to apply to the operator again . And this public network IP It's sealed 80 Port , Usually dynamic public network IP, So you don't have to consider building a website .
Public network IP And private network IP That's it , Now static IP And dynamic IP. These two are easier to understand , static state IP Is static IP, dynamic IP It's dynamic IP. Public network IP And private network IP There are dynamic and static . Like your broadband IP yes 184.108.40.206, If permanent , That's called static IP, If it changes from time to time , For example, become 220.127.116.11, This is called dynamic IP. General home broadband is basically dynamic IP, Private broadband is static IP.
in summary , best , Or the most ideal IP The type is static public network IP. You can find the designated device directly on the Internet ,IP It's fixed again , It won't change , Avoid the trouble of dynamic domain name resolution . of course , This is only for users in need , For users who only need to surf the Internet , Whether dynamic IP, static state IP, Or the public network IP, Private network IP, There's no need to tangle , Just get online .
okay , That's all the content of this article , Thanks for watching .
【 If you need various programming , Please contact 】
Thank you for your support , thank you .