When the internal network also uses the public network registered address (or the external legitimate address), if still using the standard static or dynamic NAT conversion, it may cause the conversion of the intranet address and the external network of legitimate address conflict, so that the packet back to the local network, which is certainly not possible. At this point we are going to use the overlapping network NAT conversion scheme, the destination address in the packet into the network is not the same segment of the global address.
Use overlapping (overlapping) NAT to implement address translation in cases where both the internal and external networks use registered IP addresses. The "overlap" here actually refers to the overlapping of IP address segments that are used by the external network (because they are all registered IP addresses on the public network). This section also includes two configurations: one is a statically overlapping NAT configuration, and the other is a dynamically overlapping NAT configuration. Let's begin by understanding how overlapping NAT works.
Figure 5-18 shows how to handle the NAT translation between overlapping networks. In the example, both the internal network and the external network use the 1.0.0.0/8 this registered IP address segment. The following is a demonstration example of overlapping network NAT address translation. The sequence number is corresponding to the sequence number in the figure.
(1) A host with an IP address of 1.1.1.1 in the internal network initiates a connection to host C in the external network through the computer name. The connection request first sends a query request to the DNS server with a name-to-IP address, and the request packet arrives at the source address of the 1.1.1.1 host before the router reaches the internal local address 1.1.1.1, with the destination address of the DNS server. After the router arrives, the source address of the request packet is replaced with the internal global address 2.2.2.2 of the 1.1.1.1 host, and the destination address is unchanged.
(2) When the DNS server issues a query request reply packet (where the source address is the DNS server address, The destination address is the internal global address of the 1.1.1.1 host 2.2.2.2, and includes understanding the IP address of the precipitated C host 1.1.1.3) after reaching the NAT router, if the return address has overlapping (that is, the returned address is used in the internal network), the returned address will be converted. The conversion method is to create a simple NAT entry that maps the parsed C host IP address 1.1.1.3 to an external local address 3.3.3.3 that is allocated from an externally configured external local address pool, see the following NAT table entry in the figure.
The DNS server checks each DNS reply to ensure that the resolved IP address is not the IP address used in the internal network, or the router translates the resulting IP address.
(3) When the IP address of the C host is resolved, the internal network 1.1.1.1 host initiates a connection to the external network C host with the mapped 3.3.3.3 address as the destination address.
(4) The router uses the information originally obtained to establish a NAT mapping table for internal this address, internal global address, external local address, and external global address, see the NAT mapping table entry in the figure.
(5) The router continues to send the connection request packet, the source address of the packet is replaced with the internal global address, the destination address in the packet is replaced with an external global address, and then the connection request packet continues to be sent.
(6) When the external network host C receives this packet, responds with a reply packet. The source address of the answer data name is the C host IP address 1.1.1.3, and the destination address is the internal network global address 2.2.2.2.
(7) When the router receives the reply packet, the destination address in the reply packet is replaced with the internal local address 1.1.1.1, and the source address is replaced with the external local address 1.1.1.3, forwarded to the internal network 1.1.1.1 host
Overlapping (overlapping) NAT