Operations 8 min read

How to Enable Inter‑Subnet Communication Across Multiple Routers with Static Routes

This guide explains how to configure static routes and precise subnet masks so that computers on different subnets and behind separate routers can communicate with each other, covering single‑router, dual‑router, and multi‑router scenarios and the concept of route aggregation.

Efficient Ops
Efficient Ops
Efficient Ops
How to Enable Inter‑Subnet Communication Across Multiple Routers with Static Routes

Scenario 1

In an enterprise, router R1 provides Internet access for LAN1. To add a new LAN2, router R2 is introduced. To allow PC1 (on LAN1) and PC2 (on LAN2) to communicate, the following settings are required:

Set PC1's gateway to R1 LAN.

Set PC2's gateway to R2 LAN.

Set R2 WAN gateway to R1 LAN.

Add a static route on R1 that forwards traffic destined for the 192.168.1.x subnet to R2.

Static route configuration on R1 : a static route consists of destination IP, subnet mask, and next‑hop (gateway) address. For the example, the destination is 192.168.1.0, mask 255.255.255.0, next‑hop 192.168.0.100. The gateway IP must belong to the same subnet as R1’s LAN interface. If the destination is a single host, use a mask of 255.255.255.255. On a server, the route can also be added via command line.

Scenario 2

In a shared broadband environment, user A and user B each have a router creating separate LANs that cannot communicate. To enable mutual access between PC1 and PC2, two static routes must be added to the internal gateway. The WAN ports of both routers are placed in the same subnet (e.g., 10.1.1.2 and 10.1.1.3), while their LAN ports use different subnets.

Scenario 3

When three routers are involved, the configuration combines the previous two cases. Router R1 sits between R2 and R3, connecting to PC2. To allow PC1, PC2, and PC3 to communicate, static routes are added on R1 and R3:

R1: destination 192.168.1.0/24, next‑hop 192.168.0.100; destination 172.16.0.0/16, next‑hop 10.1.1.3.

R3: destination 192.168.0.0/24, next‑hop 10.1.1.2; destination 192.168.1.0/24, next‑hop 10.1.1.2.

Because R3 only sees R1, the two routes through R1 can be summarized into a single aggregated route: destination 192.168.0.0, mask 255.255.0.0, next‑hop 10.1.1.2. This reduces the routing table size.

Why Precise Subnet Masks Matter

Large routers have extensive routing tables; route aggregation reduces table length and improves efficiency. However, overly coarse masks (e.g., 255.255.0.0) may unintentionally include other LANs, causing errors. For the example, a more precise mask 255.255.254.0 distinguishes the 192.168.0.0 and 192.168.1.0 subnets, resulting in an exact aggregated route that only covers the intended networks.

Precise routing aids future network expansion and maintenance.

Networkingnetwork operationssubnetrouter configurationstatic routing
Efficient Ops
Written by

Efficient Ops

This public account is maintained by Xiaotianguo and friends, regularly publishing widely-read original technical articles. We focus on operations transformation and accompany you throughout your operations career, growing together happily.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.