🚧 Under construction — VoTechWorks is being built. A free tech program — complimentary, as our commitment to get America working.
voTechWorksGrade 13 · a vocational technology learning center, by urbanicity
newSchoolWorks.com › VoTechWorks › Technology & Design › IT Support / Networking › Cloud Basics for IT Support and Networking › Lesson 6
TEC-ITS43-05 · Lesson 6 · 13.5 clock hours · lab

Cloud Networking: VPCs, Subnets, and Security Groups

Objective. Students will design and build a Virtual Private Cloud with at least one public and one private subnet, configure an internet gateway, set up route tables, and apply security group rules to control inbound and outbound traffic.

⚠ Pending professional review

This lesson, its worked examples and its practice questions has not yet been verified by an industry-certified professional or by a certification or approval body. It is a study draft and may contain errors. Do not use it as instructions for work on a job site or on live equipment. Always follow your instructor, your supervising professional, and current official references and regulations.

VoTechWorks program approval and accreditation are still in progress. Credentials are issued only by the certifying bodies named in each program, after their own exams.

What Is a Virtual Private Cloud?

A Virtual Private Cloud (VPC) is a logically isolated section of a public cloud provider's network where you can launch resources in a virtual network that you define. Think of it as your own private data center inside the cloud — you control the IP address ranges, subnets, route tables, and network gateways. AWS, Azure, and Google Cloud all offer this concept under slightly different names, but the principles are the same across providers.

When you create a VPC, you assign it a CIDR block — a range of IP addresses expressed in Classless Inter-Domain Routing notation. A common starting point is a /16 block such as 10.0.0.0/16, which provides 65,536 addresses for your use inside that VPC.

Subnets: Public vs. Private

Within a VPC you divide the address space into subnets. A subnet is simply a smaller CIDR block carved out of the VPC range. Two subnet types matter most in this lesson.

Public subnet — A subnet whose route table contains a route that sends internet-bound traffic (0.0.0.0/0) to an internet gateway. Instances here can communicate directly with the internet if they also have a public IP address.

Private subnet — A subnet whose route table has no route to an internet gateway. Instances here cannot be reached directly from the internet and cannot initiate outbound internet connections unless additional components (such as a NAT gateway) are in place.

A /24 subnet such as 10.0.1.0/24 provides 256 addresses (with a few reserved by the provider for internal use). Placing your web servers in the public subnet and your databases in the private subnet is a foundational security pattern you will see in almost every production architecture.

Internet Gateways and Route Tables

An internet gateway is a horizontally scaled, redundant VPC component that allows communication between your VPC and the internet. Attaching one to your VPC is not enough on its own — you must also add a route in the public subnet's route table that points 0.0.0.0/0 (all traffic) toward the internet gateway.

A route table is a set of rules (routes) that determines where network traffic is directed. Each subnet is associated with exactly one route table at a time. The local route (for example, 10.0.0.0/16 → local) is always present and allows all instances within the VPC to reach each other. You add the internet gateway route only in the route table associated with your public subnet.

Security Groups: Stateful Firewalls

A security group acts as a virtual firewall for EC2 instances, controlling inbound and outbound traffic at the instance level. Security groups are stateful, meaning that if you allow an inbound connection, the return traffic is automatically allowed regardless of outbound rules — and vice versa. This differs from network ACLs, which are stateless.

When you add a security group rule, you specify:

For a public web server you would typically allow inbound TCP port 80 (HTTP) and port 443 (HTTPS) from anywhere (0.0.0.0/0), and inbound TCP port 22 (SSH) from your specific management IP only. Restricting SSH to known IP ranges is an important security practice — leaving SSH open to the world exposes the instance to brute-force attacks.

How Traffic Flows: Putting It Together

When a browser on the internet requests a page from your public EC2 instance, the traffic path is: Internet → Internet Gateway → Public Subnet Route Table → Security Group Inbound Rules → Instance. The response follows the reverse path, allowed automatically because security groups are stateful.

When you try to reach your private EC2 instance from the internet, the VPC has no route to forward that traffic — the private subnet route table only contains the local route. The connection fails at the network level before it even reaches any security group. This is the core of network-layer isolation.

If the public instance tries to reach the private instance, it stays inside the VPC on the local route. Success or failure then depends on the private instance's security group — if the security group allows ICMP (ping) from the public subnet's CIDR, the ping succeeds.

Safety and Best Practices

Cloud misconfigurations are one of the most common causes of data breaches in enterprise environments. Treat security group rules with the same discipline you would apply to physical access controls:

Key terms8

Virtual Private Cloud (VPC)A logically isolated virtual network inside a public cloud provider's infrastructure, where the customer controls IP ranges, subnets, route tables, and gateways.
CIDR BlockA notation for specifying a range of IP addresses using a base address and a prefix length (for example, 10.0.0.0/16), used to define VPC and subnet address spaces.
SubnetA subdivision of a VPC's IP address range, associated with its own route table; classified as public if it routes to an internet gateway, or private if it does not.
Internet GatewayA VPC component that enables communication between instances in the VPC and the internet; must be attached to the VPC and referenced in a public subnet's route table.
Route TableA set of routing rules associated with a subnet that determines how network traffic is directed; the local route allows intra-VPC traffic, and an additional route points to the internet gateway for public subnets.
Security GroupA stateful virtual firewall applied at the instance level in a VPC; it evaluates inbound and outbound rules and automatically allows return traffic for established connections.
Stateful FirewallA firewall that tracks the state of network connections and automatically permits return traffic for allowed sessions, without requiring a matching rule in the opposite direction.
Principle of Least PrivilegeA security practice that grants users, systems, or network rules only the minimum access necessary to perform their required function, reducing the attack surface.
In class: Instructor demo and diagram: draw a VPC architecture on the whiteboard showing CIDR block allocation, public subnet with internet gateway route, private subnet with no direct internet route, and security group as a stateful firewall; students copy the diagram. · Guided lab: students create a custom VPC (using a /16 CIDR), add a public /24 subnet and a private /24 subnet, attach an internet gateway, update the public subnet route table, and launch an EC2 instance in the public subnet with HTTP and SSH security group rules. · Students attempt to ping the private subnet instance from the internet (should fail) and from the public subnet instance (should succeed if security group allows ICMP); they document the results and explain the security implication in their lab log.
Materials: Cloud lab sandbox, network diagram worksheet, lab log template, CompTIA Network+ study guide (cloud and network security sections), Cisco CCST study materials (networking fundamentals)
Check: Students must demonstrate a reachable public instance (HTTP response in browser) and an unreachable private instance from the internet, and correctly explain the route table and security group logic to the instructor; pass requires both connectivity tests correct plus accurate written explanation.

Practice check8

Answer each question, then check it. Nothing is recorded; this is your own practice.

CompTIA Network+ — Cloud Networking / IP Addressing
1. A technician creates a VPC with the CIDR block 10.0.0.0/16. Which of the following subnets is valid within this VPC?
CompTIA Network+ — Cloud Networking
2. Which action is required to make a subnet 'public' in a VPC?
CompTIA Network+ — Cloud Networking / Network Security
3. A student attempts to ping a private subnet EC2 instance from the internet and the connection fails. What is the MOST likely reason?
CompTIA Network+ — Network Security / Cloud
4. Which characteristic describes a security group in a VPC?
CompTIA Security+ / CompTIA Network+ — Network Security
5. A junior technician opens inbound TCP port 22 in a security group with a source of 0.0.0.0/0 on a production server. What is the PRIMARY security concern?
CompTIA Network+ — Cloud Networking / Network Security
6. A public subnet instance can successfully ping a private subnet instance. What must be true for this to work?
CompTIA Network+ — IP Routing / Cloud Networking
7. Which of the following BEST describes the purpose of a route table in a VPC?
CompTIA Network+ — Cloud Networking / Cisco CCNA — Network Design
8. A network administrator needs to allow a new application server in a private subnet to download software updates from the internet without making the server directly reachable from the internet. Which solution follows cloud networking best practices?
Record this lesson on my transcript. Sign in with your key and enrollment email to record lessons (enroll free if you have no key). This page stays open to read and practise.