3.23 Introduction AWS Network Recall

This lesson is a refresher on IP networking before diving into AWS-specific addressing. IP version 4 (IPv4) is written as four octets ranging from 0 to 255 — for example 192.168.0.1 — and remains the standard for the vast majority of corporate and consumer infrastructures. IP version 6 (IPv6), written in hexadecimal, was introduced to address the explosion of connected devices, but throughout this AWS training we will work exclusively with IPv4.

Public IPs vs private IPs

  • Public IP: reachable from the Internet, unique worldwide, geolocatable, can only be assigned to one machine at a time.
  • Private IP: reachable only inside a private network, the same address can be reused across different private networks, machines reach the Internet through NAT on the router.
  • Specific ranges (RFC 1918): classes A, B, C reserved for private networks (e.g. 10.0.0.0/16, 192.168.0.0/16).
  • Two organizations with private networks need a VPN to communicate, otherwise routing must be set up through their public routers.

On AWS, every time you stop and restart an EC2 instance, its public IP changes. To keep a stable public IP, you need an Elastic IP: an IP that you reserve and own (paid service). It can be assigned to one instance at a time, you are limited to five per account by default, and it is mainly useful to mitigate the failure of one instance by re-mapping the IP to a replacement quickly.

That said, relying on DNS is strongly recommended over Elastic IPs. Pinning a static IP often hides poor architectural decisions. The better approach is to buy a domain name and bind it to your instance through Route 53 — DNS can be updated even when the underlying IP changes. You can also place an Elastic Load Balancer in front of multiple instances to expose a single entry point without managing many records. By default, EC2 instances use private IPs to talk to each other inside a VPC, and a public IP to be reachable from outside. In the next lesson we will see how to fix IPs and reserve Elastic IPs from the console.

Summary

This lesson covers fundamental AWS networking concepts, including IPv4 and IPv6 address types, public versus private IP addresses, and their roles in AWS infrastructure. It explains how public IPs enable internet connectivity while private IPs function within networks, introduces Elastic IP addresses for persistent public assignments, and advocates for DNS and load balancing as preferred architectural approaches over direct IP management.

Key points

  • IPv4 remains the standard protocol for enterprises and individuals; IPv6 addresses the needs of IoT and connected devices
  • Public IP addresses are globally unique and reachable from the internet, while private IPs are only accessible within their respective networks (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16)
  • Elastic IP addresses provide persistent public IPs for EC2 instances; instances lose their public IP when stopped unless an Elastic IP is attached
  • EC2 instances have both private and public addresses—SSH access requires the public IP, while internal network communication uses private IPs
  • AWS limits accounts to five Elastic IP addresses by default; exceeding this requires consulting AWS pricing
  • Route 53 DNS and load balancing are recommended over Elastic IP assignment for better architectural flexibility and scalability

FAQ

What is the difference between public and private IP addresses in AWS?

Public IP addresses are globally unique and reachable from the internet, enabling external communication. Private IPs are only accessible within specific network ranges and cannot be reached directly from the internet; they allow internal communication between instances in the same network.

What happens to the public IP address when you stop an EC2 instance?

When an EC2 instance is stopped, its public IP address changes automatically upon restart unless an Elastic IP address is reserved and associated with it.

Why are Elastic IPs not recommended as a primary solution for persistent IP addresses?

Elastic IPs represent poor architectural decisions. AWS recommends using DNS and load balancing instead, which provide greater flexibility and scalability without relying on fixed IP addresses.