NAT Network Address Translation Explained
In this article
Network Address Translation (NAT) is the process that lets many devices on a private network share one public IP address to reach the internet. It works by rewriting the source IP address and port in outgoing packets, and then mapping the responses back to the correct internal device. This article explains how NAT works, why it exists, its common types, and the practical issues it can cause.
Why NAT Exists
NAT was created to deal with IPv4 address exhaustion. The IPv4 address space has only about 4.3 billion unique addresses, and with the growth of the internet, that ran out. NAT lets an entire home, office, or even a large ISP use just one or a few public IPs for thousands of devices. It also provides a basic layer of privacy: internal addresses are not directly reachable from the internet unless you explicitly set up port forwarding.
How NAT Works
When a device on your private network (e.g., 192.168.1.10) sends a packet to a web server, the router's NAT engine does three things:
- It replaces the source IP (192.168.1.10) with the router's public IP (e.g., 203.0.113.5).
- It replaces the source port (e.g., 50000) with a new port chosen by the router (e.g., 40000).
- It stores this mapping in a table: (192.168.1.10:50000 → 203.0.113.5:40000).
When the response comes back, the router looks up the destination port (40000), finds the original mapping, and rewrites the destination back to 192.168.1.10:50000. This is called port address translation (PAT), a specific form of NAT that uses port numbers to multiplex many internal addresses onto one public IP.
Types of NAT
- Static NAT – one-to-one mapping between a private IP and a public IP. Used when an internal server must always appear with the same public address.
- Dynamic NAT – maps a private IP to the next available public IP from a pool. Not commonly used in homes, but seen in some enterprise networks.
- PAT (Port Address Translation) – the most common form, often just called NAT. Many private IPs share one public IP, distinguished by port numbers.
Common Problems with NAT
NAT breaks the end-to-end principle of the original internet design. Some practical issues:
- Incoming connections fail – unless you set up port forwarding, unsolicited inbound packets are dropped because there is no mapping.
- Peer-to-peer applications struggle – gaming, VoIP, and file sharing often need workarounds like UPnP, STUN, or hole punching.
- IPsec VPNs can break – NAT modifies headers, which can interfere with protocols that authenticate the original IP address. NAT-T (NAT Traversal) solves this by encapsulating the traffic.
- Multiple layers of NAT (double NAT) – when both your ISP's router and your own router do NAT, it can cause issues with port forwarding and online gaming. Putting one router in bridge mode fixes this.
NAT vs. IPv6
IPv6 was designed with a huge address space, so each device can have a globally unique public address. This removes the need for NAT in theory. However, many networks still use IPv6 NAT (or NPTv6) for privacy or policy reasons, and most consumer routers support IPv6 alongside IPv4. In practice, the transition is slow, and NAT remains essential for IPv4 connectivity.
How to Choose NAT Settings
For most home users, the default NAT (PAT) on your router is fine. You may need to adjust settings in these cases:
- Port forwarding – if you run a web server, game server, or security camera, you'll need to forward specific ports to the internal IP.
- UPnP – lets applications automatically create port mappings. Convenient, but a security risk if enabled on untrusted networks.
- Bridge mode – if you have two routers, put the ISP one in bridge mode to avoid double NAT.
Frequently Asked Questions
Is NAT a security firewall?
NAT provides a degree of protection by not forwarding unsolicited inbound traffic, but it is not a substitute for a real firewall. A firewall inspects traffic and can block based on rules; NAT only translates addresses. Many routers combine both, but they are separate functions.
Why does my public IP show differently than my router's IP?
Your router's WAN IP is the public address assigned by your ISP. If you see a different IP on a website, it's likely your ISP is using carrier-grade NAT (CGNAT), meaning you share a public IP with other customers. This can cause issues with port forwarding and online gaming.
What is double NAT and how do I fix it?
Double NAT happens when two routers in a row both perform NAT. You'll notice it if your router's WAN IP is a private address (like 192.168.x.x). To fix it, set the second router to access point mode or bridge mode, so only the first router does NAT.
Does NAT slow down my internet?
NAT itself adds negligible latency because the translation is done in hardware or fast software. However, if your router is underpowered and has many concurrent connections, it could become a bottleneck. That's a hardware limitation, not a NAT issue.
Can I use NAT with IPv6?
Yes, IPv6 can use NAT, but it's optional and often discouraged. IPv6's address space is so large that NAT isn't needed for address conservation. Some networks use IPv6 NAT for privacy or to hide internal topology, but it's not standard practice.