ENES

NAT

How a whole home or office shares one public IP address on the internet.

Three home devices with private 192.168 addresses talk through one router, which rewrites them to a single public IP address on the way to the internet

NAT (network address translation) is what lets many devices share a single public IP address. At home, your phone, laptop and TV each get a private address like 192.168.0.12 from the router. Those addresses mean nothing on the internet; they are reused in millions of homes. Your internet provider gives the router just one public address, and the router translates between the two worlds.

When your laptop sends a packet to a website, the router rewrites the sender from 192.168.0.12, port 51000 to its own public address and a port it picks, say 200.45.10.7, port 40001, and writes that pairing in a table. When the answer comes back to port 40001, the router looks it up, rewrites the destination back to your laptop, and passes it in. Each conversation gets its own entry, so the phone and the laptop never get each other's replies.

NAT exists because IPv4 has only about 4.3 billion addresses, far fewer than the devices online, and it stretched them for decades. A side effect is that devices behind NAT cannot be reached from outside unless they started the conversation, which works as a basic shield but complicates video calls, online games and running your own server (hence port forwarding). Providers now often add a second layer, carrier-grade NAT, and IPv6, with enough addresses for every device, removes the need for it. In the cloud, a NAT gateway lets private servers reach the internet without being exposed to it.

Keep in mind

Go deeper

Related terms

More in Networks