NETWORKING / A CONCEPT NOTE
NAT
how private IPs reach the internet
Overview · mechanism
pitfall · examples
01 / THE SHORT VERSION
The idea in a few sentences.
Network Address Translation (NAT) maps multiple private IP addresses inside a local network to a single public IP address, allowing local resources outbound access while keeping them hidden from inbound traffic.
02 / FOLLOW THE MECHANISM
How nat translation flows
Private host
sends a packet to a public IP from its private IP.
NAT Gateway
intercepts the packet, replaces private source IP with its own public IP, and records the session.
Remote server
replies to the NAT gateway's public IP.
NAT Gateway
looks up the session table and translates the destination back to the private host.
04 / COMMAND NOTES
Read the command, then the result.
Inspect the flags and arguments before trying an example. Snippets can need local setup, replacement values, or resources in your own environment.
check your public IP as seen behind NAT
curl ifconfig.mesee your local routing gateway
ip route show05 / CHECK YOURSELF
Could you explain NAT to a teammate?
Try it out loud in two sentences: what it is, and the one detail that changes the picture. If you stall, the gap is the part to reread.
Up next in NetworkingSubnets & CIDRwhat /24 really means