Someone in the net group in Xiamen asked a question today.
Access sqlserver2005 on a machine in the LAN. The IP address of this machine is 172.23.0.0, And the IP address of the client is 192.168.0.12. Does this seem to be unable to connect?
Someone soon gave the answer that he would like to configure the route.
Then, the answer I gave was to configure Dual IP addresses, because according to my guess, his LAN should be physically connected. That is, many machines may be connected to a large switch or hub.
In this case, you should physically separate the two networks, connect them with one route, and then set static routes.
Or one machine has two IP addresses and then configures the soft route. (You can use a vro to connect both ends to the network and configure the route. If there is any problem, you have not tried it)
Then I was told that I do not understand the internet. In fact, many programmers do not understand the network, but I still understand some.
If there is a home broadband or a small company broadband,
We can see that it is basically easy to set
192.168.0.1 serves as the gateway and subnet mask is 255.255.255.0. You can understand that, of course, everyone is doing this, and you don't need to understand why.
When I was in college, I was curious that the IP address on my side was 192.168.0.2, and once I saw an Internet IP address starting with 192.172 (I originally thought that all the IP addresses starting with 192 were reserved addresses ).
Then the idea is not true. I was not quite clear at the time.
This is the reserved address.
In addition, it is manually specified. Some Reserved addresses.
We know that IPv4 is represented by four bytes, that is, 32 bits, and 32 can represent more than 4294967296 states, that is, 2 to 32 power, that is, 0.4 billion (less than Chinese)
All IP addresses should be equal.
However, for some convenience of computing
In binary format
Class A address. The first digit of the 1st bytes is 0.
The first two digits of a Class B address's 1st bytes are fixed as 10
The first three digits of the class C address's 1st bytes are fixed to 110
Class D should be the first three digits of the first 1st bytes fixed to 1110
Class E should obviously be 11110
Class F does not seem to have been written as 111110
In this case, it is represented in ten characters.
1.0.0.0 to 126.255.255.255 is a class
128.0.0.0 to 191.20.255 are Class B
192.0.0.0 to 223.255.255.255 is a class C.
224.0.0.0 to 239.255.255.255 Class D is used for special purposes.
240.0.0.0 to 247.20.255 is Class E. It is retained temporarily.
What are the advantages of this score?
Here we need to consider the network level, which network and host an IP belongs,
At the same time, people also stipulated that
The first byte of the Class A address belongs to the other three bytes of the network and belongs to the host.
The first two bytes of the B-type address belong to the host.
The first three bytes of the class C address belong to the second byte of the network and belong to the host.
OK. Now we have to go back to the Internet again.
How to ensure that the IP address in my subnet does not conflict with the Internet address, otherwise I will not know how to transmit this packet.
In this way, it is hard to stipulate that some addresses are private addresses, that is, they will not be allocated on the Internet.
10.0.0.0-10.00000000255 Class A can accommodate 255 machines to the power of 3 and 16581375
172.16.0.0-172.31.255.255 Class B is missing. Only (31-16) * 255*255 = 975375 machines
192.168.0.0-192.168.255.255 Class C is fewer than 65025.
In general, there can be 16581375 + 975375 + 65025 = 17621775 machines. If your enterprise is large, it will not work if you exceed this number and want to access the Internet.
Is this a bit wrong? So strange.
Isn't it often said that class C addresses only have 255 machines? Let's take a look at the definition of Class C addresses. "The first three bytes of the class C address belong to the second byte of the network and belong to the host ." He regards the last byte as the host.
Subnet Mask is now involved.
The default subnet mask for Class C addresses is 255.255.255.0 to convert to binary. The last byte of many 11111111 addresses is 0.
Hardware and communication are involved in the next step.
People share the CPU work. I cannot process all the data on my own. In this way, some of the packets in a network do not belong to me, and it is not very difficult for me to handle them. That is, when you judge that you are the same
Only when the network is connected and the data is sent to me can I process it.
The judgment of the same subnet is the IP address & subnet mask another IP address & subnet mask if the two IP addresses are equal, the two IP addresses are the same network.
Which of the above C-class address is reserved? The subnet mask of the address is set to 255.255.0.0. The entire network can use 65025 machines.
In the real world, who uses Class A reserved addresses? It is moving. Its WAP Gateway is a Class A address 10.0.0.172. (We can guess that it is based on the IP protocol. Details are unclear)
In this case, if 1.2 billion people in China want to access WAP at the same time, they will not be able to stand it.
A simple knowledge of routing.
We know that the home route has two addresses, one is internal and the other is external. When the data on the internal port is routed. (A gateway is the internal address of the route)
The route will determine whether the address is an internal network. If it is not, it will be sent out like an external port. Or, if there is a static route, it will detect the static route and forward it to which address.
It's hard to understand.
Sometimes I do not like to discuss it myself. I will write an article to refute it if I have no such character as Lao Zhao.
I often find that others lack a basic knowledge to deduce a point of view and discuss it with you.