As we all know, walking from one room to another must pass through a door. Similarly, sending information from one network to another must pass through a "gateway", which is the gateways. As the name implies, the gateway is the "gate" of a network connected to another network.
According to different classification standards, there are many kinds of gateways. The gateway in the TCP/IP protocol is the most common, and here we refer to the "gateway" refers to the TCP/IP protocol gateway.
So what exactly is a gateway? A gateway is essentially an IP address of a network to another network.
For example, network A and network B, network A's IP address range is "192.168.1.1~192." 168.1.254 ", the subnet mask is 255.255.255.0; The IP address range for Network B is "192.168.2.1~192.168.2.254"and the subnet mask is 255.255.255.0. In the absence of a router, TCP/IP communication between the two networks is not possible, even if the two network connections on the same switch (or hub), the TCP/IP protocol will determine the subnet mask (255.255.255.0) on the two network hosts in a different network. To achieve communication between the two networks, you must pass through the gateway. If the host in Network a discovers that the destination host for the packet is not on the local network, forwards the packet to its own gateway, which is then forwarded by the gateway to Network B's gateway, and the gateway of Network B is forwarded to a host of network B (as shown in the accompanying drawings). The process by which network B forwards packets to network A.
So, only set up the IP address of the gateway, the TCP/IP protocol can realize the mutual communication between different networks. So which IP address is the IP address of the machine? The IP address of the gateway is the IP address of the device with routing capabilities, a router with routing capabilities, a server with a routing protocol enabled (essentially a router), and a proxy server (also equivalent to a router).
Principle and application of TCP/IP protocol Note 05: Gateway