IP address 192.168.X.X in the LAN

The original text comes from hereReading link

1. Why are our IPs all 192.168.X.X?

Because with the development and popularization of the Internet, more and more people are using the Internet, and IPV4 addresses are about to be exhausted. Although people have created new types of IPV6 addresses for this purpose, and they can perfectly solve this problem, there will always be Due to historical issues, many network devices are still based on IPV4, and NAT (Network Address Translation) technology has been applied in this transitional stage to solve the problem of scarcity of IPV4 addresses. Everyone will definitely find a problem in their daily life. The IP on our computers and mobile phones are basically 192.168.x.x, but the IP of Baidu’s local machine is not this IP. This makes us very confused and puzzled. , and this is what we call NAT technology. The 192.168.x.x type IP address is the intranet address (private network address), and the local address on Baidu is the public network address, and NAT is what maintains the two. exist.

2. IP address

IP addresses are divided into five categories: ABC and DE. Among them, DE does not matter and is used for special purposes such as scientific research and other high-level activities. The most commonly used category is ABC, and the number of IP addresses in each category is different. And we deducted one IP segment from the ABC class IP as the internal networkIP, and another IP address segment as the loopback address: 127. x.x.x, that is, the local address, is used for testing (the specific content can be found on Baidu), and other ABC categories are used as public IPs.

3. What is an intranet IP? What is a public IP?

Intranet IP
The IP address used in the intranet is used for communication within the LAN. That is, I communicate with my dad at home without going out to the Internet. Xiao Ming and his dad also We communicate at home, but there is no contact between the two. Although my father and Xiaoming’s father have the same IP address, Xiaoming’s father will definitely not receive the data I send to his father, so there is no need to be afraid of IP address conflicts, and the addresses can be reused

Category C: 192.168.0.0 - 192.168.255.255 (commonly used in intranets)
Category B: 172.16.0.0 - 172.31.255.255
Class A: 10.0.0.0 - 10.255.255.255

Public IP

The public IP is assigned to us by the operator and cannot be repeated, because once it is repeated, the address of Xiao Ming's home is the same as the address of my home. Once a guest comes to visit, I don't know which one my home and Xiao Ming's home are, and an IP address conflict occurs.

A category 0.0.0.0 - 127.255.255.255
B category 128.0.0.0 - 191.255.255.255
C category 192.0.0.0 - 223.255.255.255

What is Network address translation?
Essence: Convert the intranet IP address to the public network IP address a>
Due to the scarcity of IPV4 addresses, operators (Telecom, China Mobile, China Unicom) allocate only one address to us, which is the public network address, and the IP addresses used by our devices (computers, mobile phones, smart TVs) are basically They are all intranet addresses. The IP addresses used internally in every household or office (LAN) are 192.168.x.x, and this kind of intranet IP can only be used for communication within the scope of the LAN. Once it goes out of the scope of the LAN , there is no way to communicate, and there is only one way to communicate with the outside world, networkAddress TranslationNAT. Whenever we want to communicate with the outside world, NAT technology It will help us convert the intranet address to a public network address to communicate with the outside world. This is equivalent to multiple intranet users sharing a public network address.

4. Examples from real life

For example, on the weekend, you and your father, mother, brother, and sister happily play with your mobile phone at home, together with a WIFI, that is, surfing the Internet in the same intranet (wireless LAN), you click on the wifi you are connected to. You will find that your IP is 192.168. (router), that is, your home router. Your home router assigns an intranet IP (192.168.x.x) to each of you through WIFI, and then when you access the Internet (check Douyin, Baidu, and see (See Moments), NAT will convert your 192.168.x.x to a public network address on the router, and then access the Internet. When the content is returned to the router, NAT will convert the public network IP to your internal network IP. , the content is returned to your mobile phone through WIFI.

Guess you like

Origin blog.csdn.net/chumingqian/article/details/134434391