$linuxjunkies
>

NAT

also: Network Address Translation, IP masquerading, port forwarding

Network Address Translation (NAT) is a networking technique that translates IP addresses in packet headers as they pass through a router, allowing multiple devices on a private network to share a single public IP address.

NAT enables a router or firewall to modify the source and/or destination IP addresses of network packets in real-time. This is essential for connecting private internal networks (like your home WiFi) to the public internet while hiding internal IP addresses from external view.

In a typical home setup, your router uses NAT to translate requests from your internal devices (192.168.1.x) into requests from the router's public IP. When responses come back, the router translates them back to the internal addresses. This way, many devices can access the internet through a single public IP.

Example: Your laptop with internal IP 192.168.1.5 sends a request to 8.8.8.8. The NAT router intercepts this, changes the source IP to its own public IP (e.g., 203.0.113.45, tracks the translation, and forwards it. When Google responds to 203.0.113.45, the router translates it back and delivers it to your laptop.

Related terms