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

VPC subnet design: plan Availability Zones, CIDRs and routes

A subnet assigns part of a VPC’s address space to one Availability Zone (AZ). A “public” or “private” name does not configure connectivity. Work through a two-AZ application example, separating address allocation, route tables and traffic permissions.

What you will learn

Allocate non-overlapping subnets across AZs and use their actual route-table associations to explain public routing and outbound access.

Prerequisite

Know what CIDR ranges, VPCs, AZs, route tables and security groups mean. The example uses IPv4 with ordinary AWS address reservations. No AWS login or resource creation is required.

A subnet connects an AZ, an address range and a purpose

An internet gateway (IGW) supports traffic between a VPC and the internet; route tables determine which traffic is sent there. A security group controls traffic at the resource, while a network ACL controls traffic at the subnet boundary. Neither replaces routing.

A VPC belongs to a Region; a subnet belongs entirely to one AZ. One subnet cannot span two AZs. A multi-AZ design therefore needs separate subnets. Record the AZ, CIDR, intended resources and route-table association as distinct decisions.

Distinguish placement boundaries from traffic configuration
TermWhat it definesWhat it does not establish
VPC CIDRAn address range associated with the VPCWhich subnets can reach external destinations
SubnetAn address allocation within one AZApplication health or security
Route tableWhere matching destination traffic is sentSG, NACL or application permissions
Public / privateClassification by direct routing to an IGWA change produced by a name or tag alone

Worked design: four subnets in two AZs

Use 10.64.0.0/16 for this synthetic VPC. AZ-A and AZ-B are explanatory labels, not actual AWS AZ names. Allocate one /24 for ingress resources and another /24 for applications in each AZ. “Ingress” describes a purpose; the next section defines routing. This example creates no applications or load balancers.

Placement diagram: two AZs inside one VPC, with distinct subnet CIDRs
VPC10.64.0.0/16

AZ-A

AZ-AIngress A: 10.64.0.0/24; rt-ingress. Application A: 10.64.16.0/24; rt-app-aIngress A10.64.0.0/24rt-ingressApplication A10.64.16.0/24rt-app-a

Separate ingress and application address ranges.

AZ-B

AZ-BIngress B: 10.64.1.0/24; rt-ingress. Application B: 10.64.17.0/24; rt-app-bIngress B10.64.1.0/24rt-ingressApplication B10.64.17.0/24rt-app-b

Use ranges that do not overlap with AZ-A.

Boxes show placement and address allocations, not traffic paths. Review route tables in the following table.

The boxes show placement and address containment, not a traffic sequence. All four /24 ranges are inside 10.64.0.0/16 and do not overlap. Unallocated space remains, but this diagram alone does not prove compatibility with future services or connected networks.

Route tables: inspect associations rather than names

Each subnet uses one route table at a time. Without an explicit association it uses the VPC’s main route table. Several subnets may share a table. Renaming a subnet changes neither its association nor its routes.

Synthetic IPv4 route tables; assume the IGW is attached to this VPC
Associated subnetsTableDestination → targetWhat this establishes
Ingress A and Brt-ingress10.64.0.0/16 → local; 0.0.0.0/0 → IGWA direct default route to the IGW
Application Art-app-a10.64.0.0/16 → localNo default route outside the VPC in this table
Application Brt-app-b10.64.0.0/16 → localNo default route outside the VPC in this table

The ingress subnets are public in this example, but that does not prove an EC2 instance is reachable from the internet. An IPv4 instance using the IGW also needs a public IPv4 address and suitable SG, NACL, OS and listening-service settings. Application subnets have no direct IGW route; even traffic matching local routes can still be denied by controls.

Choose an option to see the result and explanation.

A subnet named private-app inherits a main table with 0.0.0.0/0 → IGW. Which interpretation is correct?
Read the answer and reason

Answer: It has a direct IGW route regardless of its name · Classify the subnet from its effective routes. A route to the IGW and successful access to a particular instance or application are separate facts.

Address capacity: /24 does not mean 256 instances

In an ordinary AWS IPv4 subnet, AWS reserves the first four addresses and the last address. A /24 contains 256 addresses, normally leaving 251 assignable addresses. In 10.64.16.0/24, .0–.3 and .255 are reserved. This is an address count, not a promise of 251 EC2 instances. Allow for multiple addresses and service-managed network interfaces. BYOIP exceptions are outside this example.

Questions for an address-capacity plan
AreaWhat to review in this example
Normal operationCount ENIs and addresses, including resources other than EC2
Scaling and replacementAllow for old and new resources to overlap during changes
An AZ failurePlan for added resources and address demand in the remaining AZ
Future connectionsRecord ranges that do not overlap with other VPCs or corporate networks

Choose an option to see the result and explanation.

Which statement fits an ordinary AWS IPv4 /24 subnet?
Read the answer and reason

Answer: Normally 251 assignable addresses; resource IP usage determines capacity · Subtract the usual five reserved addresses from 256 to get 251. Subnet CIDRs in one VPC cannot overlap, even across different AZs.

When outbound access is needed, identify destinations first

A NAT gateway translates source addresses for connections initiated inside. A VPC endpoint provides VPC-side connectivity to supported services or other supported destinations. They are not interchangeable exits for every destination: select the type that fits the traffic.

The application route tables have no outbound default route. If the workload needs updates or AWS APIs, identify the destinations and purpose. Suitable NAT architecture can support general IPv4 internet egress; supported AWS services may be reached through VPC endpoints. These choices have different scope and cost, so making every application subnet public is not a substitute for a design.

Review placement and routing together

  1. Check overlaps with planned VPC and corporate connections. Ensure subnets are inside the VPC range and do not overlap.
  2. Record each subnet’s AZ and purpose. Two AZ boxes alone do not establish resilience.
  3. Record actual route-table associations; inspect the main table when there is no explicit association.
  4. For each destination, separate routing, address family, SG/NACL controls and service permissions.
  5. Estimate address use and costs during normal operation, updates and failures; fix missing conditions without broadly increasing exposure.

Check, then explain in your own words

  1. Explain why the four subnet ranges fit without overlap.
  2. Identify Application A’s route table and whether it provides external routing.
  3. List the additional conditions needed to reach an EC2 instance in Ingress A.
Check your understanding: If Application B is renamed public-app, does it gain external connectivity?

A name change does not provide connectivity; inspect the associated route table and required traffic conditions.

The example’s rt-app-b contains only a local route. Design routing, addressing, controls and destination requirements for the intended traffic, then validate the changed environment separately.

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.