teluzia.Cloud Engineer · Day 44
CHAPTER 07 · AWS VPC AND NETWORKING

Public/private subnets and route tables

4–5 hours including independent practice3 topics
LET’S MAKE THIS SIMPLE

What you’re learning today

Classify subnets by routing behavior rather than their names. You will create a local route matrix for public, private-with-egress and isolated database subnets. A default route chooses a destination path; public instance access still requires addressing, filtering and a service listener. A public subnet has a route to an internet gateway for internet-bound traffic. The VPC-local route covers its internal address space. An instance also needs suitable public addressing and permitted network/application settings for IPv4 internet communication. Calling a subnet public does not make every contained resource publicly reachable. A private subnet lacks a direct internet-gateway route. It can have outbound IPv4 access through NAT, or remain isolated with only local and explicit private paths. Database subnets often need no general internet egress. Public inbound access and private outbound access are separate architectural decisions with different cost and exposure effects.

Think of it this way

A subnet’s label is a room sign; its route table is the set of doors that determines where occupants can actually go.

TOPIC 01 / 03Step by step

Public subnet routes

A public subnet has a route to an internet gateway for internet-bound traffic. The VPC-local route covers its internal address space. An instance also needs suitable public addressing and permitted network/application settings for IPv4 internet communication. Calling a subnet public does not make every contained resource publicly reachable. A public route table has the VPC-local route and 0.0.0.0/0 targeting an attached internet gateway; an instance with only a private IPv4 address does not gain a public address from that route. Route-based classification clarifies design intent and avoids using resource names as evidence when diagnosing internet connectivity or reviewing where public-facing components should be placed. Naming a subnet public while leaving its route table isolated changes no connectivity; inspect actual route associations and gateway targets rather than trusting tags.

WORKED EXAMPLE
A public route table has the VPC-local route and 0.0.0.0/0 targeting an attached internet gateway; an instance with only a private IPv4 address does not gain a public address from that route.
Why this matters

Route-based classification clarifies design intent and avoids using resource names as evidence when diagnosing internet connectivity or reviewing where public-facing components should be placed.

A common trap

Naming a subnet public while leaving its route table isolated changes no connectivity; inspect actual route associations and gateway targets rather than trusting tags.

MAKE IT VISIBLE

Explore a network boundary

CHANGE ONE VALUE. SEE WHAT HAPPENS.

Where does this network begin?

A CIDR prefix reserves the first bits for the network. More network bits means fewer addresses inside each network.

00001010000000000000000100101010
Network bits: 24Host bits: 8
NETWORK10.0.1.0/24
ADDRESS RANGE10.0.1.0 – 10.0.1.255
TOTAL ADDRESSES256
AWS SUBNET USABLE251
✦

AWS reserves five addresses in each subnet. Conventional IPv4 host counting often subtracts two instead. This explorer uses the AWS subnet count. AWS IPv4 subnet sizes range from /16 to /28; values outside that range are shown here to teach CIDR math.

Read all topics in this lesson

A complete reference to revisit alongside the guided steps above.

Public subnet routes

A public subnet has a route to an internet gateway for internet-bound traffic. The VPC-local route covers its internal address space. An instance also needs suitable public addressing and permitted network/application settings for IPv4 internet communication. Calling a subnet public does not make every contained resource publicly reachable. A public route table has the VPC-local route and 0.0.0.0/0 targeting an attached internet gateway; an instance with only a private IPv4 address does not gain a public address from that route. Route-based classification clarifies design intent and avoids using resource names as evidence when diagnosing internet connectivity or reviewing where public-facing components should be placed. Naming a subnet public while leaving its route table isolated changes no connectivity; inspect actual route associations and gateway targets rather than trusting tags.

WORKED EXAMPLE
A public route table has the VPC-local route and 0.0.0.0/0 targeting an attached internet gateway; an instance with only a private IPv4 address does not gain a public address from that route.

Why this matters

Route-based classification clarifies design intent and avoids using resource names as evidence when diagnosing internet connectivity or reviewing where public-facing components should be placed.

A common trap

Naming a subnet public while leaving its route table isolated changes no connectivity; inspect actual route associations and gateway targets rather than trusting tags.

Private and isolated subnets

A private subnet lacks a direct internet-gateway route. It can have outbound IPv4 access through NAT, or remain isolated with only local and explicit private paths. Database subnets often need no general internet egress. Public inbound access and private outbound access are separate architectural decisions with different cost and exposure effects. An app subnet’s 0.0.0.0/0 can target a NAT gateway; an isolated database subnet can retain only local and required private routes, with administration handled through a deliberate private path. Choosing private egress intentionally prevents unnecessary networking cost and gives each tier a clear reachability contract instead of granting broad outbound access by default. Assuming every private subnet requires NAT adds cost even when workloads only call services reachable through endpoints or never need general internet access.

WORKED EXAMPLE
An app subnet’s 0.0.0.0/0 can target a NAT gateway; an isolated database subnet can retain only local and required private routes, with administration handled through a deliberate private path.

Why this matters

Choosing private egress intentionally prevents unnecessary networking cost and gives each tier a clear reachability contract instead of granting broad outbound access by default.

A common trap

Assuming every private subnet requires NAT adds cost even when workloads only call services reachable through endpoints or never need general internet access.

Associations and longest-prefix routing

Each subnet uses a route table through explicit association or the VPC’s main-table fallback. Route selection favors the most specific matching destination. A correct route table that is not associated with the intended subnet has no effect on its traffic. Inventory association and route state alongside destination and target. A database subnet accidentally using the main public route table differs from the intended isolated table even if an unassociated table named db-private exists with correct local routes. Association checks make configuration operational rather than decorative and expose a common source of mismatch between a diagram and the actual forwarding behavior applied to a subnet. Editing the intended table without checking association can leave the real subnet path unchanged; inspect associations and route state before concluding a route repair failed.

WORKED EXAMPLE
A database subnet accidentally using the main public route table differs from the intended isolated table even if an unassociated table named db-private exists with correct local routes.

Why this matters

Association checks make configuration operational rather than decorative and expose a common source of mismatch between a diagram and the actual forwarding behavior applied to a subnet.

A common trap

Editing the intended table without checking association can leave the real subnet path unchanged; inspect associations and route state before concluding a route repair failed.

KEEP THESE WITH YOU

Today’s takeaways

Classify by routes.

Separate egress from ingress.

Verify subnet associations.

CLOSE THE LOOP

Ready to complete this day?

Verify the practical steps and pass the knowledge check (at least two thirds correct).

Lab steps verifiedKnowledge check passed