Routing gateway setting forwarding principle (specific configuration)

A gateway serves as the "entry point" between networks, operating at the network layer. A routing gateway is a device that enables access to the internet through a gateway. It functions as a path-finding device that connects different networks, acting as an exit point for the network where the device resides. It can communicate with both hosts, but direct communication between the two hosts is not allowed.

Web Environment:

Routing gateway setting forwarding principle (specific configuration)

Let’s explore the network environment. There are three servers, each located in a completely isolated network—network 1 and network 2 cannot communicate with each Other. Server1 is in network 1, Server3 is in network 2, and Server2 has two network interfaces, connecting it to both network 1 and network 2. Since Server3 is on a different network, it cannot directly access Server1. To enable communication between them, Server2 must act as a gateway. If Server3 wants to reach Server1, it sends the data to Server2, which then forwards it to Server1.

Specific Configuration:

Server3 needs to add a route so that traffic destined for the 192.168.100. network segment is directed to Server2. Initially, I thought it should only be set for the 109.105.115. network segment, but the correct setup requires the following configuration:

Routing gateway setting forwarding principle (specific configuration)

You can see that the route for the 192.168.100.* network segment has been added to the routing table. Next, we configure Server2. Its network interfaces are as follows:

Routing gateway setting forwarding principle (specific configuration)

At this point, if you try to ping Server1 directly from Server3, it still doesn’t work. However, using the tcpdump command on Server2, we observe that the data is indeed being sent to Server2. This means the issue lies in the fact that Server2 is not properly forwarding the packets.

Routing gateway setting forwarding principle (specific configuration)

Therefore, the next step is to enable the IP forwarding function on Server2. After enabling it, the configuration looks like this:

Routing gateway setting forwarding principle (specific configuration)

After enabling the forwarding feature, when we try pinging Server1 from Server3, it works successfully. Now, the communication between the two servers is fully established through the routing gateway, demonstrating how gateways play a crucial role in connecting isolated networks.

Phone Jack

Phone Jack Connectors,Switches,Quality Phone Accessories

Wenzhou Hesheng Electronic Co., Ltd. , https://www.heshengelec.com

This entry was posted in on