NETWORKING / A CONCEPT NOTE

NAT

how private IPs reach the internet

~65 sec read

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

  1. Private host

    sends a packet to a public IP from its private IP.

  2. NAT Gateway

    intercepts the packet, replaces private source IP with its own public IP, and records the session.

  3. Remote server

    replies to the NAT gateway's public IP.

  4. 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.

EXAMPLE 01 · REFERENCE

check your public IP as seen behind NAT

curl ifconfig.me

EXAMPLE 02 · REFERENCE

see your local routing gateway

ip route show

Explore command anatomy in the CLI lab