Interview Prep/Networking/VPC & Cloud Network Design

Public IP, Elastic IP and private IP: how do they differ on EC2?

BeginnerScenarioVPC & Cloud Network Design
Answer

Situation read → Interviewers check whether you know which survives a stop/start.

What I'd do →

  1. Private IP stays with the instance for life in the VPC and is used for internal traffic
  2. Auto-assigned public IPv4 is released on stop and changes on start
  3. Elastic IP is a static public address you own until you release it and can remap to another instance or ENI
  4. Check with aws ec2 describe-addresses

Why → Public addressing is a pool resource; only an Elastic IP is stable.

Interview tip → Mention that idle or unattached Elastic IPs and all public IPv4 addresses are billed now, so you clean them up.

All Networking questions Roadmap: Networking for DevOps

More on VPC & Cloud Network Design