A VPC can contain multiple subnets to segment and organize your resources.
Structure
- Region: AWS geographical area.
- VPC: The isolated network container within that region.
- Availability Zone (AZ): A distinct physical data center in the Region.
- Subnets:
- Public Subnet: Has a route to an Internet Gateway.
- Private Subnet: No direct internet route; used for internal-only resources.
Subnets are tied to a single AZ and cannot span multiple AZs.
VPC – Subnet IPv4 Addressing
In every subnet, AWS reserves 5 IP addresses that cannot be assigned to EC2 instances.
Example: Subnet CIDR
10.0.0.0/24Reserved IPs:
10.0.0.0→ Network address
10.0.0.1→ Reserved for the VPC router
10.0.0.2→ Reserved for Amazon DNS
10.0.0.3→ Reserved for future use
10.0.0.255→ Broadcast address (AWS does not support broadcast)
Exam Tip
If you need 29 usable IPs:
/27→ 32 total – 5 reserved = 27 usable → Not enough.
/26→ 64 total – 5 reserved = 59 usable → Sufficient.