Skip to main content

IP Addresses And NAT

Summary: An IP address labels a device so traffic knows where to go. Home devices use private addresses that only need to be unique locally; the router lets them all share one public address through NAT (Network Address Translation).

At a glance​

Private IPPublic IP
Unique withinOne local networkThe whole internet
Assigned byYour router, via DHCPYour ISP, to your router
Reused elsewhere?Yes, many homes use the same addressesNo
Common ranges10.x.x.x, 172.16–31.x.x, 192.168.x.xGlobally allocated ranges

How NAT works​

  • Outgoing: the router replaces the device's private source address (and usually its port) with the router's public address, and records the mapping.
  • Reply: traffic comes back to the public address; the router looks up the mapping and forwards it to the right private device.
  • Side effect: outside machines can't start a connection to a private device unless the router is configured to allow it (for example, port forwarding).

Example​

laptop 192.168.1.10:51000 -> router -> internet sees 203.0.113.7:40001
reply to 203.0.113.7:40001 -> router looks up mapping -> 192.168.1.10:51000

Caveats​

  • CGNAT: some ISPs give your router a shared address and apply NAT again on their side, so your router's "public" address isn't globally unique.
  • IPv6: offers enough addresses for each device to have a globally unique one, which reduces the need for NAT.

Remember​

  • Private = unique at home; public = unique on the internet.
  • NAT is a translation table on the router, not a second address on your device.