Course contentsShow
← Cloud and Infrastructure
Lesson 191 of 2,9894. Cloud Networking BasicsFree lesson

NAT Fundamentals

Understand Network Address Translation and why private resources need NAT to access the internet.

NAT Fundamentals

What you'll learn: You'll understand why private resources need Network Address Translation (NAT) to communicate with the internet while staying secure.


What is NAT?

Network Address Translation (NAT) is a service that allows resources in private subnets to initiate outbound connections to the internet (for updates, downloads, API calls) without exposing themselves to inbound internet traffic.

Think of NAT like a receptionist at a company. When an employee (private resource) wants to send a package (outbound request) to the outside world, the receptionist sends it using the company's public address. When the response comes back, the receptionist knows which employee requested it and delivers it internally. However, strangers can't walk in from the street and demand to see a specific employee — inbound connections are blocked.

Why Private Resources Need NAT

Resources in private subnets have RFC 1918 private IP addresses (like 10.0.1.45). These addresses aren't routable on the public internet. Without NAT:

  • Your private database can't download security patches
  • Your backend application can't call external APIs
  • Your instances can't reach package repositories

NAT solves this by translating the private IP to a public IP for outbound traffic, then translating responses back.

How It Works (Simplified)

  1. Private instance sends request to internet
  2. NAT device replaces source IP with its own public IP
  3. Internet responds to the NAT's public IP
  4. NAT translates back and forwards to the original private instance

Key Takeaway: NAT enables private subnet resources to access the internet for outbound requests while preventing unsolicited inbound connections, maintaining security.