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 IP | Public IP | |
|---|---|---|
| Unique within | One local network | The whole internet |
| Assigned by | Your router, via DHCP | Your ISP, to your router |
| Reused elsewhere? | Yes, many homes use the same addresses | No |
| Common ranges | 10.x.x.x, 172.16–31.x.x, 192.168.x.x | Globally 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.
Related notes​
- DHCP Address Assignment - how private addresses are handed out
- How The Internet Connects - where routers fit