NAT, or network address translation, is a technique that allows many devices on a private network to share a single public IP address. It modifies packet headers as traffic passes through a router so responses are returned to the correct internal device. NAT helps conserve public IP addresses and adds a layer of separation between private networks and the internet. Home routers, corporate firewalls, and cloud platforms all use NAT. Because NAT changes addresses, it can affect how external services reach internal machines.
how it works
When a device sends a packet to the internet, the NAT router replaces the source private IP with its public IP and tracks the connection in a translation table. When the response returns, the router consults the table and forwards the packet to the correct internal device. NAT complicates peer to peer applications and inbound connections, often requiring port forwarding. It is closely related to routing, firewalls, and IP address management. NAT is also used in cloud networks to protect internal resources while allowing outbound access.