NAT vs PAT: What They Mean and How They Work
In this article
NAT (Network Address Translation) and PAT (Port Address Translation) are both methods that let multiple devices on a private network share a single public IP address to reach the internet. The short answer: PAT is a type of NAT that also changes the source port number, so thousands of devices can share one IP, while basic NAT only changes the IP address. In home and small office routers, what you actually use is almost always PAT, even though the router settings may call it "NAT."
Background: Why NAT and PAT Exist
Every device on the internet needs a public IP address to send and receive data. But the IPv4 address space is limited—there are only about 4.3 billion addresses, and the world has far more devices than that. NAT and PAT were developed in the early 1990s as a stopgap to let many devices share a single public address. They also add a layer of privacy, because devices behind a NAT are not directly reachable from the internet unless you set up port forwarding.
The Internet Engineering Task Force (IETF) documented NAT in RFC 1631 in 1994. PAT is described in RFC 2663 and is sometimes called "NAPT" (Network Address Port Translation) or "IP masquerading" on Linux systems. The terms are often used interchangeably, but they are not exactly the same.
How Basic NAT Works
Basic NAT, also called "one-to-one NAT," maps a private IP address to a public IP address. When a device on your LAN sends a packet to the internet, the router replaces the source IP (like 192.168.1.10) with the public IP (like 203.0.113.5). When the reply comes back, the router reverses the translation and delivers it to the correct device.
This works fine if you have as many public IPs as devices, but it does not solve the address shortage. It also does not allow multiple devices to share one IP. So basic NAT is rarely used in home networks—it is more common in business settings where you have a block of public IPs and want to expose internal servers.
How PAT Works (The One You Actually Use)
PAT is the technology inside your home router. It translates both the IP address and the source port. Here is a concrete example:
- Your laptop (192.168.1.5) sends a request to a web server at 198.51.100.7, using source port 55000.
- The router changes the source IP to your public IP (203.0.113.5) and changes the source port to something like 40001. It records this mapping in a table.
- The web server replies to 203.0.113.5:40001.
- The router looks up the mapping, changes the destination back to 192.168.1.5:55000, and forwards the packet to your laptop.
Because the router tracks the port numbers, it can tell which device each reply belongs to, even if thousands of devices share the same public IP. That is why PAT is also called "many-to-one NAT." Without port translation, you could only have one device per public IP.
NAT vs PAT: Key Differences
Here is a quick comparison of the two:
- Translation scope: NAT changes only the IP address; PAT changes both IP and port.
- Address usage: NAT needs one public IP per active session (or per device); PAT allows many devices to share one IP.
- Common use: NAT is used when you have a pool of public IPs; PAT is used in almost every home and small office router.
- Port forwarding: With PAT, you need port forwarding to receive unsolicited inbound connections; with basic NAT, you can map an entire public IP to an internal device.
Most people never need to choose between them—their router uses PAT by default. The only time you might see "NAT" in your router settings is when it refers to the overall feature, not the specific type.
Common Problems and Misconceptions
One common misconception is that NAT is a security firewall. It is not—it is a translation mechanism. It does block unsolicited inbound connections, but it does not inspect traffic or filter based on rules. A real firewall does that.
Another issue is that PAT can break certain protocols that embed IP addresses in the data payload, like FTP or some online games. To work around this, routers use "ALG" (Application Layer Gateway) features that inspect and modify those packets. If you have trouble with a specific game or app, you may need to enable or disable the ALG for that protocol in your router settings.
Also, PAT does not work well with IPsec VPNs unless the router supports NAT-T (NAT Traversal), which encapsulates the VPN traffic so the port changes do not corrupt it. Most modern routers and VPN clients support NAT-T automatically.
How to Configure NAT/PAT on Your Router
You usually do not need to configure PAT—it is on by default. But you may need to set up port forwarding to allow inbound connections (for example, to run a web server or play a game). Here is the general process, but note that exact menu labels vary by router brand and firmware version:
- Log into your router's admin page (often at 192.168.1.1 or 192.168.0.1).
- Find the section called "Port Forwarding," "Virtual Server," or "NAT."
- Enter the internal IP address of the device you want to expose.
- Enter the external port and the internal port (they can be the same).
- Choose the protocol (TCP, UDP, or both).
- Save and reboot the router if prompted.
If you are not sure about the exact menu path, search for your router model's manual. The steps are similar across most brands, but the names differ.
Alternatives to NAT/PAT
The long-term solution to IPv4 exhaustion is IPv6, which provides a huge address space and does not need NAT. With IPv6, every device can have its own public address. However, many networks still use NAT for IPv4 and will continue to do so for years.
Another alternative is a proxy server, which acts as an intermediary between clients and the internet. A proxy can also hide internal IP addresses, but it works at a higher layer and is not transparent to all applications. For most home users, PAT is the simplest and most practical solution.
Frequently Asked Questions
Is NAT the same as a firewall?
No. NAT translates addresses, and it does block unsolicited inbound connections by default, but it does not inspect or filter traffic. A firewall provides security rules and can block or allow specific traffic. Many routers combine both functions, but they are separate technologies.
Why do I need port forwarding if I have NAT?
Because PAT only allows outbound connections. When a device on the internet tries to reach you, the router does not know which internal device to send it to unless you have a port forwarding rule that tells it. Port forwarding creates a permanent mapping from a public port to an internal IP and port.
Does NAT affect my internet speed?
In most cases, the performance impact is negligible because the translation happens in hardware on modern routers. However, if you have a very old router or a slow CPU, NAT can become a bottleneck. Also, some advanced NAT features like ALG can introduce latency for certain protocols.
Can I disable NAT on my router?
Yes, but only if you have a public IP address for each device or you are using IPv6. Disabling NAT on a typical home router will break internet connectivity for all devices, because they will not have valid public addresses. If you have a business connection with a block of static IPs, you can set up "bridge mode" or "IP passthrough" to let one device use the public IP directly.
What is double NAT and why is it a problem?
Double NAT happens when you have two routers in a row, each performing NAT. For example, if you connect a second router to your main router, both will translate addresses. This can cause issues with port forwarding, online gaming, and VPN connections. The fix is to put the second router in "bridge mode" or "access point mode" so it does not perform NAT.