NAT explained: how dozens of devices share one public IP address
Your home might have phones, laptops, a TV and a dozen smart devices, yet your internet provider usually gives you just one public IPv4 address. Network Address Translation (NAT) is what makes that work.
The basic trick
Inside your home, devices use private addresses from reserved ranges such as 192.168.x.x or 10.x.x.x. These are not routable on the public internet. When a device sends a request out:
- The router replaces the private source address with its own public address.
- It records the mapping in a translation table, usually tracking the source port too.
- When the reply comes back, the router looks up the table and forwards it to the right device.
Because ports distinguish the connections, thousands of conversations can share one public address. This variant is often called PAT or NAT overload.
Side effects worth knowing
- Incoming connections are blocked by default. The router has no mapping for traffic nobody asked for, which acts like a basic filter. That is why hosting a game server at home needs port forwarding.
- Peer-to-peer gets harder. Video calls and games use techniques like STUN and relay servers to get around NAT.
- Carrier-grade NAT (CGNAT). Some providers put many customers behind a shared address, adding a second layer of translation. That can break port forwarding entirely.
NAT and IPv6
IPv6 has enough addresses for every device to have a globally unique one, so NAT is not needed for address sharing. Firewalls still provide the filtering that NAT gave as a side effect.
Questions for the thread:
- Is NAT a security feature or just an accident that people rely on?
- Has CGNAT ever caused you trouble with remote access or gaming?
Comments · 4
Quick follow-up for anyone confused: this is why you can't easily host a server at home without port forwarding. The router only knows which device a reply belongs to because your device started the conversation.
NAT is why hosting a game can be a pain. "Strict NAT" in console menus is exactly this, and port forwarding or UPnP usually fixes it.
It helps to think of the translation table as a hotel front desk that remembers who asked which room for a call. Without that record, the router wouldn't know where to send the reply.
IPv6 was designed partly to remove the need for NAT by providing enough addresses for every device. Adoption has been slow, so NAT is still everywhere.