What is NAT? What is the difference between Source NAT and Destination NAT?
sobes.tech AI
Answer from AI
NAT (Network Address Translation) is a technology that allows changing IP addresses in IP packet headers as they pass through a router or firewall. The main goal of NAT is to hide the internal network behind one or more public IP addresses, which conserves address space and enhances security.
The difference between Source NAT and Destination NAT:
-
Source NAT (SNAT) — changes the source IP address of the packet. It is typically used when internal devices with private IP addresses access the internet. The router replaces the source address with its public IP so that return packets can come back.
-
Destination NAT (DNAT) — changes the destination IP address of the packet. It is used to redirect incoming traffic to internal servers. For example, requests to a public IP and a specific port are redirected to a private IP of a server inside the network.
Example:
- SNAT: An internal IP 192.168.1.10 sends a request to the internet. NAT changes the source address to 203.0.113.5.
- DNAT: An external request to 203.0.113.5:80 is redirected to 192.168.1.100:80 inside the network.