Intercommunication between routers on different network segments: Detailed explanation of three static routing cases

Unlock Best Pricing with In-stock, Ready-to-Ship Products

Hello everyone, recently many people have asked how two routers on different network segments can communicate with each other. At this time we need to configure static routing to solve this problem. Although the bridging function of routers is more common in home networks, in projects, the configuration of static routing is more common, mainly used to solve the mutual access between routers in different network segments. For some friends, there may be some doubts about the specific configuration of static routing. Let’s take a deeper look today.

In this article, we’ll go through three similar examples to resolve static routing configurations. This article involves a lot of technical content, but it is also very practical. It is recommended that you read it carefully.

Case 1: What is a static route?

When a router is connected to another router, and the two routers are connected to different network segments, in order for the two network segments to communicate, we need to configure static routing.

Case 2: How to configure static routing?

Assume that an enterprise accesses the Internet through a router R1 and has a local area network LAN1. For business needs, they added a router R2 and added a new LAN segment LAN2. In order to allow PC1 in LAN1 and PC2 in LAN2 to communicate with each other, we can make the following settings:

Set the gateway of PC1 to be the LAN interface of R1.

Set PC2’s gateway to R2’s LAN interface.

Set the gateway of R2’s WAN interface to R1’s LAN interface.

Specify a static route on R1, so that the data packets whose destination IP is the 192.168.1.x network segment are forwarded to R2.

Case 3: Solve the configuration of static routing again

Suppose there are two network segments as follows:

PC A: 192.168.0.165 255.255.255.0   PCB B: 192.168.0.148 255.255.255.0

In the above diagram, PC A and PC B belong to different network segments. In this case, B can ping A, but A cannot ping B. The reason is that after the IP of PC B passes through the NAT (network address translation) of the router, the external display is 192.168.0.148, and PC A does not know the real existence of PC B.

To make PC A able to ping PC B, we need to tell PC A how to access PC B, we can add a static route on PC A:

Enter the following command at the command prompt (or terminal):

route -p add destination address mask subnet mask gateway address

The meaning of this command is that if you want to find the “destination address”, send the data packet through the “gateway address”. Where -p means permanent effect.

So, based on the example above, the directive should look like this:route -p add 192.168.19.0 mask 255.255.255.0 192.168.0.148

Here 192.168.19.0 means that the route is applicable to all IP addresses under the 192.168.19 network segment. After the addition is complete, you can use the route print command to check whether the addition is successful. (Note that under Windows 10 you need to run Command Prompt as administrator to add static routes).

Conclusion:

Go beyond the boundaries of the network and experience the ultimate connection! Click to enter the Router-switch.com now to purchase the most advanced routers, switches and network equipment, so that your network experience can be upgraded instantly!

Check More Router-switch Products:

H3C Switches

Cisco Routers

Aruba Switches

Read More:

https://blog.router-switch.com/2023/07/join-router-switch-blog-as-a-guest-writer-and-columnist/

https://blog.router-switch.com/2023/07/cisco-c9200l-24p-4g-e-how-to-power-your-network-with-cutting-edge-technology/

https://blog.router-switch.com/2023/07/h3c-the-light-of-it-illuminates-the-future-of-moving-services/

Share This Post

Post Comment