Introduction
Imagine you have many devices at home but only one address to connect to the internet. NAT solves the problem of sharing a single address among many devices so they can all go online safely and efficiently.
Think of a receptionist in an office building who receives all mail for the building's tenants. The receptionist uses the building's main address to receive mail and then delivers it to the correct tenant inside based on their name or office number.
┌───────────────┐ ┌───────────────┐ │ Private Device│ │ Internet │ │ 192.168.1.10 │ │ │ └──────┬────────┘ └──────┬────────┘ │ │ │ Private IP │ Public IP │ │ ┌──────▼────────┐ ┌──────▼────────┐ │ Router │─────────▶│ Public IP │ │ NAT translates│ │ 203.0.113.5 │ │ 192.168.1.10 │ └───────────────┘ └───────────────┘