AWS SAA – Lecture 47: Private vs Public vs Elastic IP

Published on
Written by Henry Nguyen

Phase Verbs / Action Phrases

PhraseMeaning
assign (an IP)allocate an IP address to an instance
mask (a failure)hide service disruption by quickly moving an Elastic IP to another instance
attach (Elastic IP to instance)associate a fixed public IP with an EC2 instance
identify (a machine)distinguish one host from another using an IP address
connect (via NAT)allow a private IP to reach the internet through a proxy device

Technical Vocabulary

TermDefinition
IPv4IP address format: 4 numbers 0-255 separated by dots (e.g., 192.168.1.1); ~3.7 billion addresses
IPv6Longer address format (letters + numbers); used mainly in IoT; AWS supports it
Public IPGlobally unique IP; accessible from the internet
Private IPAccessible only within a private network; two different networks can share the same private IP range
Elastic IPA static public IPv4 you own and can reassign between instances
NAT (Network Address Translation)Device that lets private IPs communicate with the internet
Internet GatewayAWS network component that connects a VPC to the public internet
DNSDomain Name System — maps human-readable names (like example.com) to IP addresses

Key Concepts

IPv4 vs IPv6

  • IPv4: Most common; 3.7 billion addresses (running low); used everywhere in this course
  • IPv6: Much larger address space; mostly for IoT; AWS supports it but not the focus of SAA

Public IP

  • Accessible from anywhere on the internet
  • Must be globally unique — no two machines can share the same public IP
  • AWS assigns one automatically when you launch an EC2 instance (unless disabled)
  • Changes when you stop and restart the instance

Private IP

  • Accessible only within the same private network (VPC)
  • Not routable on the public internet
  • Two separate networks can use the same private IP range (no conflict)
  • Private IP is stable — does not change when an instance is stopped/started

Elastic IP

  • A static public IPv4 address you own (doesn’t change when you stop/start instance)
  • You pay for it even when not attached to a running instance
  • Can be remapped instantly to another instance (useful for failover)
  • Max 5 Elastic IPs per account by default (can request increase)
  • Best practice: avoid Elastic IPs — they’re often a sign of poor architecture

Better Alternatives to Elastic IP

Better OptionWhy
Use a random public IP + DNS name (Route 53)More scalable, easier to manage
Use a Load Balancer (no public IP on EC2 at all)Best practice on AWS

EC2 Default IP Behavior

WhenIP
LaunchGets private IP (always) + public IP (if in public subnet)
SSH from outsideMust use public IP (or Elastic IP) — private IP only reachable via VPN
Stop → StartPublic IP changes; private IP stays the same

Exam Tips

  • EC2 gets a new public IP each time it stops and starts — use Elastic IP or DNS to avoid this
  • Elastic IP = static public IP; max 5 per account; considered poor architecture in most cases
  • Private IP = stable; doesn’t change; not internet-routable
  • Prefer Load Balancer + DNS over Elastic IP for production workloads