As the number of employees or departments increases, a router is added to the enterprise, which is divided into two network segments. Subnet A and subnet B are in different network segments. When there are multiple routers in the network, it is required that the subnets under different routers can communicate with each other and access the Internet through the broadband router. How to achieve this? 1. Case scenario 1 The enterprise accesses the Internet through a router R1, LAN1. Due to business needs, a router R2 was expanded and a new LAN segment LAN2 was added. To enable PC1 and PC2 to communicate with each other, you can make the settings as shown in the figure below. To achieve communication between pc1 and pc2, you can make the following settings:
Here, the R1 static route configuration is explained separately: a static route generally consists of three parts, the destination IP address, the subnet mask and the next hop (gateway) address. According to the analysis in the figure above, the information contained in a new static route should include the following content: the next hop address of the IP packet sent to the destination address 192.168.1.0 (the subnet mask is 255.255.255.0) is 192.168.0.100. For the specific configuration location, if it is in the router, taking TP-Link as an example, in the router configuration interface, there is a static routing table configuration: When setting up a static route, the gateway IP must belong to the same network segment as the LAN port IP of this router. If the destination IP address is the IP address of a host, the subnet mask must be 255.255.255.255 If it is on the server, you can configure static routes through the command line, including adding, deleting, and modifying. It can be seen that Case 1 is actually very similar to the bridging principle of a router. 2. Case scenario 2 Community shared broadband access, user A uses a broadband router to build a local area network, user B also uses a broadband router to build a local area network, and the hosts between the local area networks of users A and B cannot communicate with each other. The network topology is as follows: To achieve mutual access between PC2 and PC1, it looks similar to situation 1. Two static routes need to be added in the intranet gateway. Generally, the community gateway will not allow users to configure routes casually, and after such configuration, computers in other network segments can also access PC1 and PC2. How to set up mutual access between two routers in different network segments: Set the WAN ports of the two routers to one subnet, as shown above:
The LAN ports of the two routers can be set arbitrarily, as long as they are not in the same subnet as the WAN port. 3. Case scenario 3 In the above cases 1 and 2, both are for two routers. For an environment with multiple routers and multi-level routing devices in the network, this situation can be said to be an integration of scenario 1 and scenario 2. A similar network topology is as follows: three routers To achieve mutual access between PC1, PC2 and PC3, it is necessary to configure static routing for Router 1 and Router 3. How to configure it? In fact, it is just the integration of the situations in Case 1 and Case 2 above, which is Case 3. Analysis: (Here the router is represented by R) R1 is between R2 and R3. R1 itself is connected to pc2. If pc2 is to communicate with pc1 and pc3, the destination address of R1 is pc1 and pc3. The next hop of R1 is R2 and R3. The WAN port of R2 is connected to the LAN port of R1, so the LAN port address of R1 and the WAN port address of R2 are in the same network segment, and the WAN port address of R1 and the WAN port address of R3 are in the same network segment. So R1:
So R3:
If you don’t understand the above, you can look at it from another angle: From the perspective of router R3, it can only see R1 but not R2. Therefore, for R3, the two routes of R1 and R2 can be summarized into one, which is The destination address is 192.168.0.0, the mask is 255.255.0.0, and the next hop is 10.1.1.2. This network segment includes all subnets from 192.168.0.0 to 192.168.255.0, including R1 and R2. This static route will forward all packets with destination IP in this range to the 10.1.1.2 router R1. This method of aggregating multiple sub-routing entries into a total routing entry that includes all of them is called route aggregation. 4. Why should the subnet mask be written precisely in the network? On large routers, the routing table is often very long and large. Using route summarization can reduce the length of the routing table and improve router efficiency. Of course, route summarization is not always effective, because the division of subnets is artificial, and other network segments in the route summary may exist in other LANs. Rash summarization may lead to errors, so we must calculate the subnet mask very accurately in actual projects. This is why I have always advised us not to directly write the subnet mask as 255.255.0.0 when setting a Class B URL. The route summary in Example 3 above can be set more accurately. For 192.168.0.0 and 192.168.1.0, the first 23 bits of the network bits are the same. If you want to distinguish these two network segments by mask, you need to set the mask to 255.255.254.0, and it is not recommended to set it to 255.255.0.0. This improved summary route table should be written like this: The destination address is 192.168.0.0, the subnet mask is 255.255.254.0, and the next hop is 10.1.1.2. This summary route will only include the two subnets 192.168.0.0 and 192.168.0.1, which is an accurate route. This will help with future network expansion and maintenance. |
<<: 100 basic network knowledge popularization, read it to complete half of the network master
>>: In-depth study of principles - TCP long connection and heartbeat keep alive
According to foreign media reports, NASA is upgra...
5G messages continue to make new progress. Recent...
Virtono has launched a promotion where people can...
"Do you still believe in the light?" Th...
At HUAWEI CONNECT 2019, Huawei officially launche...
01/ Introduction Edge computing is a computing pa...
We work in weak current, and we have the most con...
I just shared the summary of RackNerd's histo...
Rising Star If the IT industry has learned anythi...
[[403098]] The development of 5G healthcare has e...
Routers are important network devices that realiz...
In this article, we will introduce the role of in...
On August 7, a team of domestic developers and le...
On January 6, the Ministry of Science and Technol...
The fourth industrial revolution, known as 4IR or...