As the name implies, a gateway is a gateway connecting one network to another. According to different classification standards, there are many types of gateways. The gateway in the TCP/IP protocol is the most commonly used one. Here, the "gateway" we are talking about refers to the gateway under the TCP/IP protocol. So what exactly is a gateway? A gateway is essentially an IP address that connects a network to other networks. For example, there are networks A and B. The IP address range of network A is "192.168.1.1~192. 168.1.254", and the subnet mask is 255.255.255.0; the IP address range of network B is "192.168.2.1~192.168.2.254", and the subnet mask is 255.255.255.0. Without a router, TCP/IP communication between two networks is impossible. Even if the two networks are connected to the same switch (or hub), the TCP/IP protocol will determine that the hosts in the two networks are in different networks based on the subnet mask (255.255.255.0). To achieve communication between the two networks, a gateway must be used. If the host in network A finds that the destination host of the data packet is not in the local network, it will forward the data packet to its own gateway, which will then forward it to the gateway of network B, and the gateway of network B will forward it to a host in network B. The process of network B forwarding data packets to network A is the same. ??So, only by setting the IP address of the gateway can the TCP/IP protocol achieve mutual communication between different networks. So which machine's IP address is this? The IP address of the gateway is the IP address of a device with routing function. Devices with routing function include routers, servers with routing protocols enabled (essentially equivalent to a router), and proxy servers (also equivalent to a router). ??What is the default gateway??If you understand what a gateway is, the default gateway will be easy to understand. Just like a room can have multiple doors, a host can have multiple gateways. The default gateway means that if a host cannot find an available gateway, it will send the data packet to the default gateway, which will process the data packet. The gateway used by the host now generally refers to the default gateway. ??How to set the default gateway??The default gateway of a computer cannot be specified casually, it must be specified correctly, otherwise a computer will send data packets to a computer that is not a gateway, and thus cannot communicate with computers on other networks. There are two ways to set the default gateway: manual setting and automatic setting. ??1. Manual setting??Manual setting is suitable for situations where the number of computers is relatively small and the TCP/IP parameters are basically unchanged, such as only a few to a dozen computers. Because this method requires setting the "default gateway" on each computer connected to the network, it is very laborious. Once the IP address of the default gateway must be modified due to migration or other reasons, it will cause great trouble to the network administrator, so it is not recommended. ??In Windows 9x, the method to set the default gateway is to right-click on "My Network Places", click "Properties" in the pop-up menu, select "TCP/IP Protocol" in the Network Properties dialog box, click "Properties", and fill in the new default gateway IP address in the "Default Gateway" tab. ??It should be noted that the default gateway must be the IP address in the network segment where the computer is located, and the IP address in other network segments cannot be filled in. ??2. Automatic settings??Automatic settings use the DHCP server to automatically assign IP addresses, subnet masks and default gateways to computers in the network. The advantage of this is that once the default gateway of the network changes, as long as the default gateway settings in the DHCP server are changed, all computers in the network will obtain the new default gateway IP address. This method is suitable for networks with large scale and TCP/IP parameters that may change. ??Another way to automatically obtain the gateway is to install the client program of the proxy server software (such as MS Proxy) to automatically obtain it. Its principle and method are similar to DHCP.