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 simultaneously, but direct communication between the two hosts is not allowed.

Web Environment:

Routing gateway setting forwarding principle (specific configuration)

Let’s discuss the network environment. There are three servers located in two completely isolated networks—network 1 and network 2. These networks cannot communicate directly with each other. Server1 is on network 1, Server3 is on network 2, and Server2 has two network interfaces, connecting it to both network 1 and network 2. Since Server3 is on a different network than Server1, it cannot reach Server1 directly. To enable communication between them, Server2 must act as a gateway. If Server3 wants to access Server1, it sends 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 sent to Server2. Initially, I thought only the 109.105.115. network segment should be used, so the configuration should be set up like this:

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. Now, let's configure Server2. The network interfaces on Server2 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, by using the tcpdump command on Server2, we can confirm that the data is indeed being sent to Server2.

Routing gateway setting forwarding principle (specific configuration)

The only remaining possibility is that Server2’s forwarding function is disabled. Therefore, we need to enable IP forwarding on Server2.

Routing gateway setting forwarding principle (specific configuration)

After enabling the forwarding function, when we try pinging Server1 from Server3, it works successfully. We’ve now achieved inter-network communication through the gateway setup.

FRP Duct Rodder

FRP Duct Rodder,Fiberglass Duct Rodder,Frp Duct Rodder Snake,Snake Duct Rodder

Hebei Dingshengda Composite Material Co., Ltd. , https://www.frpdsd.com