AWS Certified Cloud Practitioner (CLF-C02) / Cloud Technology and Services

VPCs, subnets and network boundaries

Lesson 24 of 42. Open to read. No account needed.

A Network Boundary, Not a Security Guarantee

Amazon VPC gives you a logically isolated virtual network. You choose address ranges and routes rather than treating every resource as an undifferentiated part of the internet. A VPC is Regional; each subnet belongs to one Availability Zone. An application that needs resources in two zones therefore uses at least two subnets.

An IP address identifies an interface. A route selects the next destination for traffic. A traffic rule determines whether a connection is allowed. Those three jobs are related but not interchangeable.

Follow One Private Instance's Request

A private EC2 instance sends an outbound IPv4 request through a public NAT gateway and internet gateway; replies return on that path.

Read the diagram upward from EC2. The private subnet's default IPv4 route points to a public NAT gateway. This example uses a zonal NAT gateway in a public subnet, with an Elastic IP. The public subnet routes internet-bound traffic to the VPC's internet gateway. The green arrows show the initiated request; responses return through the established translation.

Only one Availability Zone is shown to keep the path readable. This is not a complete high-availability design. The VPC and subnet outlines identify placement; they do not mean every packet is allowed.

Public and Private Describe Routing

A public subnet has a direct route to an internet gateway. For an EC2 instance to communicate directly over IPv4, it also needs a public IPv4 address and suitable traffic rules. Simply naming a subnet "public" changes nothing.

A private subnet has no direct internet-gateway route. It can still communicate through other configured paths. In this example, the private instance initiates internet access through NAT without becoming a destination for unsolicited inbound internet connections. NAT is not the same thing as allowing visitors to open a new connection to that instance.

This example is explicitly IPv4. Do not carry its NAT explanation over unchanged to every IPv6 design. IPv6 addressing and egress routing need their own consideration.

Compare the Traffic Controls

ControlMain jobImportant distinction
Route tableSelect the traffic pathA route is not an access permission
Security groupAllow traffic for associated resources/interfacesStateful; permitted connection responses are tracked
Network ACLFilter traffic entering or leaving a subnetStateless; allows and denies, with return traffic considered separately

Security groups use allow rules, not explicit deny rules. Opening an inbound port in a group does not repair a missing network route. Likewise, a route to a gateway does not override the group.

Network ACL rules are evaluated in number order until a match. Their stateless nature matters when a request is allowed but its response is not. Do not confuse this subnet-boundary control with an application checking a user's password.

Diagnose a Small Example

A private reporting server needs to download an update. An administrator adds a public internet-gateway route to a different subnet and expects the server to work.

Start with the reporting server's own subnet and associated route table. A route in an unrelated table does not affect its path. In the illustrated design, its internet-bound route must target the NAT gateway. The NAT gateway's side then needs the internet path, and relevant traffic controls must allow the exchange.

Now change the requirement: the administrator wants an external user to initiate a connection to the reporting server. The same outbound NAT arrangement does not satisfy that new requirement. A carefully designed entry point is needed; removing isolation indiscriminately is not the default fix.

This distinction helps prevent a common mistake: treating "the server can download updates" as evidence that "anyone can reach the server." Connection direction matters.

Read a Route and an Access Rule Separately

The following is an illustrative route-table extract, not an AWS CLI command. CIDR notation names an address range: 10.20.0.0/16 is the VPC's private range in this example, while 0.0.0.0/0 covers all IPv4 destinations.

Private subnet route table
Destination       Target
10.20.0.0/16       local
0.0.0.0/0         nat-gateway-example

The more specific local route handles a destination inside the VPC range. The default route handles an outside IPv4 destination through the example NAT gateway. The target label is illustrative, not a real resource ID. No row here says which application port is permitted or which user may read a report.

Now read a separate security-group rule:

Direction: inbound
Protocol: TCP
Destination port: 443
Source: 10.20.1.0/24

A port identifies a service endpoint on a host; TCP port 443 commonly carries HTTPS. This rule allows matching new inbound connections from the stated private range. It does not create an internet route, install a web server, configure TLS or let that server read S3 objects. Widening the source to 0.0.0.0/0 would allow matching connections from any IPv4 source that can reach it, not fix those missing dependencies.

A stateful security group tracks permitted connections and their replies. A stateless network ACL evaluates the request and response separately. That is why a correct inbound rule is not the entire explanation of connectivity.

A TCP request reaches server port 443; the response goes to an example client port 53000. A network ACL checks each direction, while a security group tracks a permitted connection.

Follow the green request downward and the blue reply upward. The client chose 53000 as its temporary source port in this illustration; the server's reply therefore targets that port, not port 443 on the client. Actual client port ranges depend on the system. The stateless subnet filter must permit the relevant response as well as the request. Connection tracking at the security group does not override a blocking network ACL. The diagram assumes the routes and a working server already exist; it is not a ready-to-apply rule set.

Check Your Understanding

An IPv4-only EC2 instance has only a private address. Its subnet has a route directly to an internet gateway. Does that route alone let the instance reach a public internet endpoint?

Answer and Reasoning

No. Direct IPv4 internet communication through the internet gateway requires a public IPv4 address as well as routing and permitted traffic. The route alone is insufficient. A private instance can instead use a correctly configured NAT path for outbound access. Changing a security-group rule alone does not provide the missing addressing or translation, and renaming the subnet has no effect.

References

Example-specific references checked on 8 October 2026:

Service references checked on 25 September 2026. No AWS resources are required for this lesson.

Study this course with an account

Course access adds revision notes, the Exam Cheat Sheet, saved progress, bookmarks and your own notes.

INR 199 plus 18% GST. 90 days of online access. No auto-renewal.

See course access

This website is operated by VECTAMETRIC EDTECH (OPC) PRIVATE LIMITED, operating as Vectametric.

Corporate Identity Number (CIN): U85499KA2026OPC229822. GSTIN: 29AAMCV8281D1ZS. Registered office: RS NO/38/2A/1 BASTAND, ROAD MAHANTESH NAGAR, Ramdurg, Ramdurg, Belgaum- 591123, Karnataka.

Queries and grievances: Prajval Honnungar, Grievance Officer and Data Protection Contact.

Telephone: +91 94800 09310. Support: support@vectametric.com. Grievances: support@vectametric.com.

Copyright 2026 VECTAMETRIC EDTECH (OPC) PRIVATE LIMITED. All rights reserved.

Vectametric home · Roadmaps · Vecta IT Exams · Vecta Government Exams · Vecta Banking & Finance Exams · Vecta Entrance Exams · About us · Contact · Privacy Policy · Terms and Conditions · No-Refund Policy