Lesson 1 of 3 Amazon VPC Configuration

Planning VPC CIDR Blocks, Subnets and IP Addresses

This lesson explains how to size the CIDR blocks and subnets of an Amazon Virtual Private Cloud (VPC) for growth from the start, because its address plan is hard to change later.

Learning outcomes

After completing this lesson, you will be able to:

  • Choose VPC CIDR blocks.
  • Size subnets, accounting for reserved addresses.
  • Manage addresses with IPAM.

VPC CIDR blocks

A VPC has a primary IPv4 CIDR block between /16 (65,536 addresses) and /28 (16 addresses), normally from the private ranges defined in RFC 1918 (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16). Up to four more secondary CIDR blocks can be added by default (quota adjustable) to expand a VPC that runs out of addresses, with some restrictions on which ranges can be combined. A VPC can also have an IPv6 CIDR (/56) from Amazon's pool, your own addresses (BYOIP) or IPAM. CIDRs must not overlap with networks you will connect through peering, Transit Gateway or VPN, because overlapping ranges cannot be routed.

True or false

VPC address ranges

Exam skills 5.1.1

Check facts about VPC CIDR blocks.

Log in to try this activity Interactive activities are free with an account.

Subnets

A subnet is a range of the VPC's CIDR in one Availability Zone, between /16 and /28. AWS reserves five addresses in each subnet (network, router, DNS, future use and broadcast). Subnets are described as public (their route table has a route to an internet gateway), private (outbound internet through NAT) or isolated (no internet route). The auto-assign public IPv4 subnet setting gives instances launched there a public IP. A typical design has public, private application and isolated data subnets in each of two or three AZs, with private subnets sized generously because containers, Lambda functions and endpoints consume IPs.

VPC IP Address Manager

Amazon VPC IP Address Manager (IPAM) plans, allocates, tracks and monitors IP addresses across accounts and Regions in an organisation. Administrators create pools (for example per Region and environment) with allocation rules, and VPCs receive non-overlapping CIDRs from them automatically. IPAM monitors utilisation of pools, VPCs and subnets, publishes CloudWatch metrics for alarms, detects overlapping or non-compliant CIDRs, keeps historical records of address assignments, and its public IP insights show public IPv4 usage and cost. IPAM pools can be shared with AWS RAM. The free tier covers basic features; the advanced tier adds organisation-wide management.

The following diagram shows a pool hierarchy from which VPCs receive their CIDRs.

IP address planning with VPC IPAM. A top-level pool is divided into Regional pools and then environment pools with allocation rules. New VPCs receive non-overlapping CIDRs from the right pool automatically, and IPAM monitors utilisation and flags overlapping or non-compliant CIDRs.
The ranges are illustrative.
Select all that apply

What IPAM provides

Exam skills 5.1.1

Identify the capabilities of VPC IP Address Manager.

Log in to try this activity Interactive activities are free with an account.
Worked example

Planning addresses for growth

A team plans a production VPC for an EKS platform expected to run 3,000 pods. With the VPC CNI, every pod uses a VPC IP address. A /16 VPC with three public /24 subnets, three private /19 subnets (8,187 usable addresses each) for nodes and pods, and three isolated /22 subnets for databases leaves room for growth. The CIDR is allocated from an IPAM pool for production in the Region, which guarantees it does not overlap with other VPCs or the on-premises ranges registered in IPAM, so Transit Gateway routing will work later.

Check yourself

What is the allowed size range of a VPC CIDR block?

Show answer

/16 to /28.

Exam Tips

Remember for the exam

  • VPC CIDRs are /16 to /28; add secondary CIDR blocks when space runs out.
  • Each subnet is in one AZ and loses five addresses to AWS.
  • Avoid overlapping CIDRs with any network you will connect.
  • IPAM allocates non-overlapping CIDRs and monitors utilisation across accounts.