Skip to content

NAT

Network Address Translation

Medium — good to knowNetworking

ELI5 — The Vibe Check

NAT is how your home router lets all your devices share one public IP address. Your phone, laptop, and TV each get a private IP (192.168.x.x), but to the outside world, they all look like ONE IP address. The router keeps track of who asked for what and routes responses back correctly.

Real Talk

NAT is a method that remaps IP addresses by modifying packet headers as they pass through a router. The most common form, NAPT (Port Address Translation), maps many private IP:port combinations to a single public IP with different port numbers. Widely used to extend IPv4 address space.

Show Me The Code

# Private IP ranges (RFC 1918)
10.0.0.0/8        # Large private networks
172.16.0.0/12     # Medium private networks
192.168.0.0/16    # Home/small office networks

# Example NAT translation:
# Internal: 192.168.1.100:54321 → google.com:443
# External: 203.0.113.1:54321   → google.com:443
# (router translates 192.168.1.100 to 203.0.113.1)

When You'll Hear This

"All devices behind the NAT router share one public IP." / "NAT makes it hard to host services without port forwarding."

Made with passive-aggressive love by manoga.digital. Powered by Claude.