SEARCH
— 葡萄酒 | 威士忌 | 白兰地 | 啤酒 —
— 葡萄酒 | 威士忌 | 白兰地 | 啤酒 —
In the previous articles, we were mainly focusing on internal networks (interested readers can follow the author to view the articles). But the world is vast, and we always want to explore it. In the network world, how do we connect from an internal network to an external network? This is where a gateway comes into play. Let’s first look at the following command:
ip route add 10.168.10.0/20 via 10.173.23.1 dev eth0
Those familiar with this command should know that it is used to configure a route in the router’s routing table. If you are not familiar with it, don’t worry, you can continue reading. Here, I mentioned routers, routing tables, and gateways. So, what is the relationship between a gateway, a router, and a routing table? First, let’s clarify that a router is a Layer 3 physical device that serves as a gateway. Therefore, we usually refer to a router as a gateway. However, a router has several ports, each connecting to a different target LAN. The routing table defines which port to use for forwarding to which LAN and what the next hop IP is. So, this combination of devices and routing rules meets our need to connect from an internal network to an external network. To understand its working principle, we need to start with the MAC header and IP header. Suppose there is a host A in LAN A that wants to access host B in LAN B.
We know that the MAC header and IP header formats of network data packets are as follows. Each forwarding of the request packet needs to contain the following content: The MAC header first contains the destination address, then the source MAC address, followed by the protocol type. The IP header usually contains the version type (typically IPv4), TOS, LLS, etc. We mainly focus on the source IP address and the destination IP address.
This routing method seems quite clear, right? It works fine when different LANs are in different network segments, but LANs are mutually unaware. It is quite possible that the IP addresses of machines in two LANs are exactly the same. For example, the IP address of Machine A is 192.168.1.100, and the IP address of Machine B is also 192.168.1.100. If data is sent in the above manner, it looks like sending data to itself.
At this point, we need to use a router with NAT (Network Address Translation) functionality. NAT’s full name is Network Address Translation. Its main forwarding principle is to convert the source internal network IP to a public IP during forwarding, allowing communication with the external network. It hides the internal network from the external network, so at least one public IP is needed for communication with the external network, greatly alleviating the shortage of IP resources. There are three main types of NAT:
For industrial production environments, having a high-speed network might not be the top priority, but a highly efficient and reliable network is essential. For a long time, wired networks have been the preferred choice in industrial settings due ...
View detailsWAN (Wide Area Network) ports are a crucial interface on industrial cellular routers, enabling external network connectivity and advanced functions. This article examines the key roles of the WAN port on the Yeaplink SR500 industrial cellular router.
View detailsWith the development of industrial internet, 4G industrial routers have been increasingly widely used. However, how to choose the appropriate 4G industrial router based on actual needs is a concern for many users. Therefore, this article will deep...
View detailsExplore the world of vehicle gateways with Yeaplink's technical support engineer Dominique. Learn about their crucial role in modern transportation, key applications, and real-world usage scenarios. Discover how vehicle gateways are shaping the fu...
View detailsMo