What is NAT and why do several devices share a public IP?

Published on 2026-10-20 by frfrand

NAT explained with examples: public and private IP, port translation, outbound connections, port forwarding and CGNAT limitations.

What is NAT and why do several devices share a public IP?

Short answer: NAT is a technique that translates network addresses when data passes from one network to another. It is widely used in homes and offices so that multiple devices with private IP addresses can communicate with the Internet using a shared public address.

Its name comes from Network Address Translation. Although it may sound complex, it explains a very common mystery: how is it possible for five cell phones, a TV, and two laptops to browse at the same time if your provider gave you only one public IP?

The reception of a building

Imagine a building with twenty apartments and a single postal address. From outside, all packages arrive at the same address, but the reception knows which apartment to deliver each one to.

With NAT —and especially with a common variant called NAPT or PAT, which also translates ports—, the router keeps information that allows it to associate the communications of its internal devices with the connections going out to the Internet.

Each device can have a private IP, such as 192.168.1.10 or 192.168.1.11, while an external connection can see the router's outgoing public IP.

The analogy has limits: connections are not physical mail packages and translation rules depend on protocols and network states.

A step-by-step example

Suppose your laptop has 192.168.1.10 and opens a web page.

  1. Your notebook creates a connection to the destination server.
  2. The router receives traffic from a private address that is not routed directly over the Internet.
  3. A translation function can replace the source IP and, in NAPT, also the port used.
  4. The router keeps a temporary association to recognize the response traffic.
  5. When the page replies, it uses that association to deliver the response to your notebook.

At the same time, another cell phone can open the same website. The translations and ports allow distinguishing the communications.

NAT is not equivalent to encryption. The router changes addressing information; it does not necessarily protect the content of the data.

Private IP and public IP: what is the difference?

In IPv4, private networks often use ranges such as 10.0.0.0/8, 172.16.0.0/12 or 192.168.0.0/16. Those addresses are not routed directly on the public Internet in the same way as a global IP.

That is why two different houses can both have a computer with 192.168.1.20 without that generating a conflict between their private networks.

The public IP is the one that can be used to communicate with external networks. But watch out: not every address you see as "outgoing IP" belongs exclusively to your home.

What is CGNAT and why can it complicate things?

Some Internet providers also perform address translation on their own infrastructure; it is often called CGNAT, or carrier-grade NAT.

That allows several clients to share certain public addresses. If you are behind CGNAT, you may not be able to receive incoming connections to your router as expected, even after configuring local redirects.

Example: you want to host a game server at home. Everything works within your Wi-Fi, but your friends cannot connect from outside. It could be a firewall rule, a misconfigured redirect, or that your connection uses CGNAT.

Before paying for a different service or changing equipment, ask the provider what type of IPv4 connectivity it offers and what alternatives exist.

What is port forwarding or port redirection?

By default, an incoming connection from the Internet does not have to correspond to an active translation in the router. A port forwarding allows you to indicate to which internal device to send certain new connections.

For example, someone can configure the public port of a service to reach a private machine. That can be useful, but it also exposes that service to external traffic if the network and firewall allow access.

Do not forward a port just because a tutorial tells you "open everything and you're done". First ask yourself if the application really needs public access and how it will authenticate.

Is NAT a firewall?

No. NAT can make certain unsolicited incoming connections difficult due to how translations and states are managed, but it does not replace a firewall nor provide a complete security policy.

A misconfigured application, an incorrect port rule, or vulnerable software remain dangerous. A device can also initiate outbound connections to malicious destinations even if it uses NAT.

Does NAT exist in IPv6?

The need to share a public address does not work the same way in many IPv6 networks, where devices can have their own global addresses. Even so, translation solutions exist in certain IPv6 designs.

The important thing is not to confuse "having a global IP" with "allowing all access." Firewall rules remain relevant.

Where does ArduMaker come in?

An ArduMaker VPS is a container with a private address within a shared host; the public IP is the host's. That is why Internet traffic reaches your application only through two explicit paths: a domain published on the host's proxy (for websites) or a TCP/UDP port forwarding from a host port to a VPS port, which is exactly port forwarding. Forwarding rules accept any IP by default, and an Enterprise administrator can limit which IPs arrive using the IP policy.

Understanding NAT helps to understand why a program can respond within the VPS and not from outside: listening on a port is not enough if there is no entry path.

The fundamental idea: NAT translates addresses; NAPT can also translate ports to share an exit. It serves to connect networks, not to replace permissions, authentication, or security.

Frequently asked questions

How do I know if my connection is behind CGNAT?

Compare the WAN IP shown in your router's panel with the public IP you see from a "what is my IP" type site. If they do not match, or if the WAN starts with a range like 100.64.x.x (the 100.64.0.0/10 block, reserved for CGNAT), it is very likely that your provider is doing NAT before your router.

What is the difference between NAT and port forwarding?

NAT translates addresses of outgoing connections and their responses. Port forwarding is an explicit rule for new incoming connections: it tells the router which internal device to send what arrives at a specific port to.

Sources: RFC 3022: Traditional NAT · IPv4 Private Address Ranges, RFC 1918 · Port forwarding explained on ArduMaker.

What is NAT and why do several devices share a public IP?
  • NAT
  • redes
  • IP privada
  • IP pública

Keep reading

All articles · VPS plans