Briefly describe public network IP, private network IP, dynamic IP, static IP

           Briefly describe the four concepts of public IP, private IP, dynamic IP, and static IP.

1. Let’s talk about public IP and private IP

We have all heard of IP addresses, but we may be scratching our heads when it comes to public IPs and private IPs. Putting the IP issue aside, let's first talk about what is a public network and what is a private network. The public network is also known as the wide area network and the external network, which refers to the Internet we usually refer to. A private network, also known as an intranet or a local area network, refers to a local Internet network created under a router or switch. To put it simply, the function of the network is to interconnect multiple computers and transmit data to each other. The WAN realizes the interconnection of the wide area, and the LAN realizes the interconnection of the local area. Like we usually go online to watch news and movies, all we use is the Internet, which can also be said to be the public network. The internal Internet network created by routers or switches for a family, a community, and an enterprise is a local area network.

        The public network IP is the IP address used in the public network, and the private network IP is the IP address used in the local area network. As mentioned in the article "Introduction to IP Address and MAC Address", the IP address is composed of 4 groups of decimal numbers, each group has 1 to 3 digits, and the value range of each group number is 0 to 255. connected. For example, 127.0.0.1 and 101.199.216.234 are IP addresses. IP addresses are divided into five categories: A, B, C, D, and E. Among them, categories A, B, and C are for general purposes, and categories D and E are for special purposes. The public network IP or private network IP we are involved in daily life basically belongs to one of the three categories A, B, and C.

Class A address range: 1.0.0.1~126.225.255.254.

Class B address range: 128.0.0.1 to 191.255.255.254.

Class C address range: 192.0.0.1 to 223.255.255.254.

Class D address range: 224.0.0.0 to 239.255.255.255.

Class E address range: 240.0.0.0 to 247.255.255.255.

127.0.0.0 to 127.255.255.255 are reserved addresses for loop testing. For example, it will be used when doing web development locally.

        10.0.0.0~10.255.255.255 of class A, 172.16.0.0~172.31.255.255 of class B, and 192.168.0.0~192.168.255.255 of class C are private IP addresses. In addition, all other IPs in the three categories A, B, and C are public IPs. The private network IP will only appear in the private network, and the public network IP will only appear in the public network.

        What is the difference between public IP and private IP in use? . The public network IP is an independent identity that can directly access other IPs in the Internet, and can also be directly accessed by other IPs. With it, you can directly find other computers in the Internet, and can also be found by other computers. However, the private network IP is under the LAN. If it wants to access the Internet, it needs to be converted into a public network IP first. This public network IP is the gateway IP of the LAN. For other computers on the public network, no matter which device under the router accesses it, the IP of the other party it obtains is the same, which is the gateway IP of the LAN. As for which specific device in the LAN accesses it, it has no way of knowing.

        For example, there are four devices A, B, C, and D in the LAN, and their IP addresses are 192.168.0.10, 192.168.0.11, 192.168.0.12, and 192.168.0.13. The LAN is generated by the router, the router is the gateway, and the IP of the LAN is 192.168.0.1. Because the router is in both the public network and the private network, the router also has a public network IP, which is assumed to be 136.67.0.1. No matter which device A, B, C, D accesses the Internet, its final public IP is 136.67.0.1.

        The private network IP can directly access other IPs in the public network, but cannot be directly accessed by other IPs in the public network. This sentence may not be easy to understand for ordinary people, but those who have done websites and built servers will understand it better. The role of the IP address is to assign a unique identifier to a device on the network for identification. If we are a LAN IP, then we want to access a designated public IP is no problem. However, if other IPs on the public network want to find us, they cannot find us directly. It can only find the gateway layer of the LAN at most. As for the multiple devices under the router, it cannot distinguish them. This is why many people want their IP to be a public IP instead of a private IP. With the public network IP, it will be very convenient to realize remote control, remote monitoring, and remote file access. If we are a LAN IP, the above functions can also be realized, but it will be very troublesome and require a lot of extra work, such as port forwarding and intranet penetration. If the effect is not good, it usually costs extra money. Compared with the two, the public network IP is naturally the best choice.

        If you want to change your home broadband from a private network IP to a public network IP, you can apply to the operator. As for whether you can apply in the end, it is hard to say. IPV4 addresses are exhausted, and operators are generally reluctant to change the public network IP. The customer service does not know whether it is true or false. The first call response is generally that they do not understand, and it takes several calls to communicate. The general reason for everyone to change the public network IP is that there is surveillance at home, and it cannot be used without the public network IP. Some people say, what if people question that I can use surveillance without a public IP? In fact, there is no need to worry about this. The operator is well aware of it. The reason for asking is generally just a routine, and the specific reason is not important. But it should be noted that even if the application is made, it may not be permanent. It may suddenly change back to the private network IP, and you need to apply to the operator again. Moreover, this public IP is sealed with port 80, and it is usually a dynamic public IP, so there is no need to consider it when building a website.

        The public network IP and private network IP are finished, now let's talk about static IP and dynamic IP. These two are easier to understand. A static IP is a static IP, and a dynamic IP is a dynamically changing IP. Both public IP and private IP can be divided into dynamic and static. For example, your broadband IP is 163.128.0.1. If it remains unchanged permanently, it is called a static IP. If it changes from time to time, such as 163.128.0.10, it is called a dynamic IP. Generally, home broadband is basically a dynamic IP, and dedicated line broadband is a static IP.

To sum up, the best, or ideal IP type is static public IP. The specified device can be directly found on the Internet, and the IP is fixed and will not change, eliminating the need for dynamic domain name resolution and other troubles. Of course, this is only for users who have needs. For users who only need to access the Internet, no matter whether it is a dynamic IP, a static IP, or a public network IP or a private network IP, there is no need to worry about it, as long as they can access the Internet.

Guess you like

Origin blog.csdn.net/weixin_40845165/article/details/123609317#comments_25023348