Why do we need to set a default gateway

Source: Internet
Author: User

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, and the IP address range for Network B is" 192.168.2.1~192. 168.2.254 ", 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 two networks are connected on the same switch (or hub), tcp/ The IP protocol also determines that the hosts in two networks are in different networks based on the subnet mask (255.255.255.0). 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 on network B. The same is true of network B's process of forwarding packets to network A. 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 on network B. The same is true for network B to forward packets to network a so that only the IP address of the gateway is set up, the TCP/IP protocol can realize the 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).

Reference URL:

http://zhoutao.blog.51cto.com/425866/93629

Why do we need to set a default gateway

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.