NAT Routing
Network Address Translation (NAT) is mapping one IP address space to another one by modification in transit.
Main Flow
- Your server IP (10.0.1.5) sends a packet to the Internet.
- Packet hits the NAT gateway; which sees its IP address belongs to the private ip address range.
- NAT Gateway modifies the packet with its public IP. NAT Gateway logs to itself that 10.0.1.5 Port 50001 is NAT’s IP port 1001.
- The Internet sees the packet now. And sends a packet back.
- NAT Gateway sees the returned packet and checks its table. It can route it accordingly.
Note a connection (TCP/IP) is:
- Source IP
- Source Port
- Destination IP
- Destination Port
- Protocol
In an absolute sense, the client and ultimate server don’t know this switch has happened.