Topic lessonTopic: VPC: address and connectivity design
AWS VPC CIDR planning: address ranges, overlaps and expansion
A VPC CIDR is an IP address range associated with that VPC. A large amount of unused space is not enough for a good plan: the range must accommodate subnets, avoid conflicts with planned connections and allow viable expansion. This lesson applies CIDR knowledge to AWS-specific decisions.
Distinguish VPC and subnet CIDRs, then evaluate a plan using AWS IPv4 restrictions, overlap checks and secondary-CIDR constraints.
Understand IPv4 prefixes such as /16 and /24 and how one CIDR contains another. The shared CIDR lesson covers arithmetic; this page explains AWS-specific planning without requiring live AWS operations.
Choose VPC space, then allocate subnets
Allocate subnet CIDRs from an IPv4 CIDR associated with the VPC. Subnets in one VPC cannot overlap, even in different AZs. 10.64.16.0/24 and 10.64.17.0/24 are disjoint. By contrast, 10.64.16.128/25 is inside 10.64.16.0/24, so they cannot be separate subnets in that VPC.
- 10.64.0.0/16 → 10.64.16.0/24The /24 fits inside the primary /16 and must also avoid every other subnet.
- 10.65.0.0/16 → 10.65.0.0/24Allocate a separate subnet from the added CIDR; this does not resize an existing subnet.
- 10.64.0.0/16
- The VPC’s primary IPv4 range.
- 10.64.16.0/24
- An application subnet allocated from the primary range.
- 10.65.0.0/16
- A secondary range, added only after checking constraints.
- 10.65.0.0/24
- A possible subnet after associating the secondary range.
AWS IPv4 constraints go beyond CIDR arithmetic
| Item | Condition to check | Planning consequence |
|---|---|---|
| VPC IPv4 CIDR | Prefix length /16 through /28 | A mathematically valid /15 or /29 is not a valid ordinary VPC allocation |
| Subnet | Inside an associated VPC CIDR; ordinarily /16 through /28 | Fit the range inside the VPC without overlapping another subnet |
| Ordinary reserved addresses | The first four and last address in each subnet | Do not report the raw address count as assignable capacity |
| Disallowed space | Restrictions include 0.0.0.0/8, 127.0.0.0/8, 169.254.0.0/16 and 224.0.0.0/4 | Check AWS allocation rules rather than generating ranges by arithmetic alone |
| RFC 1918 space | Private ranges are recommended | Private space is not automatically unique within your organization |
Record the canonical network prefix. For example, the range described by 10.64.16.9/24 starts at 10.64.16.0. AWS APIs may canonicalize an input, so different strings do not necessarily identify different ranges. Choosing publicly routable IPv4 space for a VPC does not automatically assign public addresses to resources or establish internet access.
Check overlap beyond this VPC
| Compared ranges | Finding | Planning response |
|---|---|---|
| New VPC 10.64.0.0/16; corporate 10.64.32.0/20 | Overlap: corporate space is inside the VPC range | Select disjoint space and review the connection method’s constraints |
| VPC-A 10.64.0.0/16; VPC-B 10.64.0.0/16 | Identical space | Do not plan to join them later using ordinary VPC peering |
| New VPC 10.64.0.0/16; peer 10.65.0.0/16 | These two ranges do not overlap | Still check routes, additional CIDRs and other connected networks |
| New VPC 10.64.0.0/16; unknown destination ranges | Insufficient information | Request the inventory rather than marking an empty entry as conflict-free |
Record ranges with environment, account, Region, purpose and ownership so future connections and growth can be reviewed. Unallocated subnet space still belongs to the VPC CIDR for overlap checks. Currently unused addresses are not permission to reuse the same space in a connected network.
Choose an option to see the result and explanation.
Expansion adds a secondary CIDR; it does not resize the original
An existing VPC IPv4 CIDR cannot be resized after creation. Expansion can instead associate a qualifying additional CIDR and allocate new subnets from it. Check more than overlap: association quotas, permitted address-range combinations, route-table entries and peering constraints also matter. Free-looking space is not automatically eligible.
For example, an existing route to 10.0.0.0/24 prevents associating an equal or larger encompassing secondary block such as 10.0.0.0/24 or 10.0.0.0/16 under the documented association restriction. A smaller block may avoid that particular restriction; it must still satisfy every other condition.
Choose an option to see the result and explanation.
Plan IPv6 independently
A VPC has IPv4 address space and can also associate IPv6 space. IPv6 allocation methods and subnet sizing have different rules from IPv4 /16–/28. Adding IPv6 does not automatically resolve an IPv4-dependent workload’s capacity problem: resources, services, DNS, routing and controls must support the chosen address family.
Before adoption: arithmetic, AWS constraints and connection plans
- Inventory current allocations and every planned connection; explicitly mark missing ranges.
- Check containment and overlap. Separate ordinary reservations from each resource’s address use.
- Review AWS IPv4 rules, association quotas, existing routes and connection-specific constraints.
- Plan per-AZ growth, replacement and future connections, recording why the allocation was chosen.
- For an authorized real change, review routing and migration effects with the owner. This lesson performs no changes.
Check, then explain in your own words
- Explain why 10.64.16.0/24 and 10.64.16.128/25 cannot be separate subnets.
- List the networks that belong in an overlap inventory.
- Name at least three secondary-CIDR checks beyond prefix length.
Check your understanding: Can every mathematically valid CIDR be used directly for a VPC?
No. Check AWS range, size and association rules separately from the connection plan.
Arithmetic describes addresses; it does not validate AWS restrictions, existing routes, connected-network conflicts, quotas or resource-specific address use.
Sources and conditions checked
The official references used in this lesson are collected here with their scope, conditions and corresponding sections. Independent expert review and live AWS comparison have not been performed.
- VPC CIDR blocksChecked:
Scope and conditionsIPv4 /16–/28, prohibited ranges, canonical form, secondary CIDRs and association restrictions; not a generic CIDR calculator.
Used in this lessonChoose VPC space, then allocate subnets AWS IPv4 constraints go beyond CIDR arithmetic Check overlap beyond this VPC Expansion adds a secondary CIDR; it does not resize the original Plan IPv6 independently
- VPC subnet CIDR blocksChecked:
Scope and conditionsAWS subnet size restrictions and reserved addresses differ from generic arithmetic
Used in this lessonChoose VPC space, then allocate subnets AWS IPv4 constraints go beyond CIDR arithmetic Expansion adds a secondary CIDR; it does not resize the original Plan IPv6 independently
- Subnet basicsChecked:
Scope and conditionsOne AZ per subnet; address families and route-based public/private/isolated classification, distinct from traffic permission.
Used in this lessonPlan IPv6 independently
- Subnet route tablesChecked:
Scope and conditionsSubnet associations, implicit main-table use, destinations, targets and IPv4/IPv6 distinction.
Used in this lessonExpansion adds a secondary CIDR; it does not resize the original
Scope and conditionsInternet-gateway attachment/routing and public IPv4 for the selected direct-internet IPv4 method. Not a complete end-to-end connection guarantee.
Used in this lessonAWS IPv4 constraints go beyond CIDR arithmetic