INFRASTRUCTURE LEARNINGINFRASTRUCTURE LEARNING
インフラ大全インフラ大全IT INFRASTRUCTURE / LEARNING
Infrastructure learning guide
Find a lesson or lab/

Esc to close · Search terms stay on your device

LEARNING日本語

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.

What you will learn

Distinguish VPC and subnet CIDRs, then evaluate a plan using AWS IPv4 restrictions, overlap checks and secondary-CIDR constraints.

Prerequisite

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.

Example allocations: arrows mean address containment, not traffic paths
Example allocations: arrows mean address containment, not traffic paths1: 10.64.0.0/16 — The /24 fits inside the primary /16 and must also avoid every other subnet. — 10.64.16.0/24. 2: 10.65.0.0/16 — Allocate a separate subnet from the added CIDR; this does not resize an existing subnet. — 10.65.0.0/241210.64.0.0/1610.64.16.0/2410.65.0.0/1610.65.0.0/24Example allocations: arrows mean address containment, not traffic paths1: 10.64.0.0/16 — The /24 fits inside the primary /16 and must also avoid every other subnet. — 10.64.16.0/24. 2: 10.65.0.0/16 — Allocate a separate subnet from the added CIDR; this does not resize an existing subnet. — 10.65.0.0/241210.64.0.0/1610.64.16.0/2410.65.0.0/1610.65.0.0/24
  1. 10.64.0.0/16 → 10.64.16.0/24The /24 fits inside the primary /16 and must also avoid every other subnet.
  2. 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

Constraints for ordinary IPv4 VPC and subnet planning
ItemCondition to checkPlanning consequence
VPC IPv4 CIDRPrefix length /16 through /28A mathematically valid /15 or /29 is not a valid ordinary VPC allocation
SubnetInside an associated VPC CIDR; ordinarily /16 through /28Fit the range inside the VPC without overlapping another subnet
Ordinary reserved addressesThe first four and last address in each subnetDo not report the raw address count as assignable capacity
Disallowed spaceRestrictions include 0.0.0.0/8, 127.0.0.0/8, 169.254.0.0/16 and 224.0.0.0/4Check AWS allocation rules rather than generating ranges by arithmetic alone
RFC 1918 spacePrivate ranges are recommendedPrivate 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

Synthetic connection inventory: compare ranges, not labels
Compared rangesFindingPlanning response
New VPC 10.64.0.0/16; corporate 10.64.32.0/20Overlap: corporate space is inside the VPC rangeSelect disjoint space and review the connection method’s constraints
VPC-A 10.64.0.0/16; VPC-B 10.64.0.0/16Identical spaceDo not plan to join them later using ordinary VPC peering
New VPC 10.64.0.0/16; peer 10.65.0.0/16These two ranges do not overlapStill check routes, additional CIDRs and other connected networks
New VPC 10.64.0.0/16; unknown destination rangesInsufficient informationRequest 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.

The new VPC is 10.64.0.0/16 and a planned corporate connection uses 10.64.32.0/20. What should you conclude?
Read the answer and reason

Answer: The corporate range is contained in the VPC range and overlaps · This /20 is inside the /16. Different prefixes or names do not prevent actual address overlap. Review connection-specific restrictions and revise the allocation plan.

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.

A VPC using 10.64.0.0/16 needs more address space. What is the correct planning step?
Read the answer and reason

Answer: Review an additional CIDR and plan new subnets · This is not a resize operation. Review overlap, routes, connections and quotas for an added range, then separately plan any resource migration.

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

  1. Inventory current allocations and every planned connection; explicitly mark missing ranges.
  2. Check containment and overlap. Separate ordinary reservations from each resource’s address use.
  3. Review AWS IPv4 rules, association quotas, existing routes and connection-specific constraints.
  4. Plan per-AZ growth, replacement and future connections, recording why the allocation was chosen.
  5. 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

  1. Explain why 10.64.16.0/24 and 10.64.16.128/25 cannot be separate subnets.
  2. List the networks that belong in an overlap inventory.
  3. 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.