Virtual Private Cloud (VPC) Explained for Network+ and Cloud+
Virtual Private Cloud Explained
· @Ken
What a Virtual Private Cloud Is
A public cloud provider runs an enormous shared physical network. Thousands of unrelated customers have servers in the same data centers, often on the same physical hosts, sharing the same switches and fiber. That arrangement raises an obvious question: how does your infrastructure get its own network without being exposed to everyone else's?
The answer is the virtual private cloud. A VPC is a logically isolated section of a provider's cloud where you define your own private network — your own IP address range, your own subnets, your own routing, and your own firewall rules. It looks and behaves like a network you built in your own data center, except the switches, routers, and cabling are software constructs running on the provider's hardware.
A VPC gives you the network you would have built on-premises, defined in software instead of hardware.
The isolation is real, and it is worth understanding where it comes from. Your VPC is not a separate physical network; it is an overlay. Provider traffic rides encapsulation protocols and a software-defined networking control plane that tags every packet with its VPC identifier. A packet from your VPC cannot be delivered into another customer's VPC, even if both use the same 10.0.0.0/16 address range, because the identifier attached to it is part of how the fabric forwards it. That is why two organizations can use identical private address space in the same region and never see each other.
Every major provider offers this under its own name. AWS and Google Cloud call it a VPC. Microsoft Azure calls it a virtual network (VNet). Oracle calls it a virtual cloud network. The naming differs, and a few architectural details differ — Azure VNets are regional, and Google VPCs are global, for instance — but the concept is the same across all of them, and CompTIA tests the concept rather than any one vendor's implementation.
The practical significance is that in cloud environments, the network is configuration, not cabling. No patch panel and no trip to the wiring closet. Everything is an API call, which means everything can be automated, versioned in Git, and deployed as code — and also that a single wrong line can expose a database to the internet in seconds.
The Building Blocks
A VPC is made up of a small number of pieces. Learn these six and the rest of cloud networking follows.
The CIDR block. When you create a VPC, you assign it a private IP range in CIDR notation — 10.0.0.0/16, 172.16.0.0/20, 192.168.0.0/16. This is the address space every resource inside will draw from. Two decisions matter here, and both are hard to undo. First, pick a range large enough for growth; a /24 with 256 addresses looks tidy until you need a third environment. Second, pick a range that does not overlap with your on-premises network or any network you might one day connect to, because overlapping CIDR blocks cannot be routed between. Organizations that carelessly stamp 10.0.0.0/16 on every VPC spend years untangling it.
Subnets. The VPC's range is carved into smaller subnets, each tied to a single availability zone. This is where standard subnetting math applies directly — the same calculations from Network+ work identically in the cloud. Be aware that providers reserve several addresses in each subnet for their own use (AWS reserves five per subnet), so /28 gives you 11 usable addresses, not 14.
Subnets are commonly described as public or private, but that distinction is not a checkbox you tick. A subnet is public because its route table has a path to an internet gateway. Remove that route, and it is private. The terminology describes routing, not a property of the subnet itself — a point worth remembering, because exam questions like to test it.
Availability zones. Each subnet lives in one AZ, which is one or more physically separate data centers within a region. Spreading subnets across at least two AZs is the baseline for high availability, and it is why production VPC designs almost always show subnets in pairs or triples.
Route tables. Every subnet is associated with a route table that tells traffic for a given destination where to go. A local route always covers the VPC's own CIDR, which lets subnets talk to each other without any configuration. Everything else — internet, on-premises, peered VPCs — is a route you add. When traffic in a cloud environment mysteriously does not arrive, the route table is the first place to look.
Network interfaces and IP addressing. Instances get an elastic network interface with a private IP from their subnet. You can attach a public IP or elastic IP for internet reachability. Crucially, the instance's operating system usually has no idea it has a public address — the mapping happens in the fabric, which is why ipconfig or ip addr on a cloud VM shows only the private address.
DNS and DHCP. The provider supplies both automatically. Instances get addresses via DHCP and resolve names through a provider resolver at a reserved address inside the VPC. You can override this with custom DHCP option sets pointing to your own DNS servers, and private DNS zones let you resolve internal names that never appear in public DNS.
Connecting a VPC to the Outside World
By default, a new VPC is a sealed box. Nothing gets in, and nothing gets out. You have to build every path deliberately, and each one is a distinct exam topic.
Internet gateway. A horizontally scaled, provider-managed component that allows two-way traffic between the VPC and the internet. Attaching it is not enough; a subnet only becomes internet-facing once its route table sends 0.0.0.0/0 to that gateway and the instance has a public IP.
NAT gateway. The common requirement is for private instances to reach out — for patches, package repositories, API calls — without being reachable from outside. A NAT gateway sits in a public subnet and performs source NAT for traffic from private subnets. Outbound works; unsolicited inbound does not. This is the same one-way logic as a home router, and it is the single most frequently deployed VPC component after the subnets themselves. IPv6 uses an egress-only internet gateway for the same purpose, since IPv6 addresses are globally routable and need no address translation.
Site-to-site VPN. An IPsec tunnel over the public internet joining your VPC to your on-premises network. Cheap, fast to set up, encrypted, and subject to whatever the internet is doing that day. Bandwidth per tunnel is limited, and latency is unpredictable.
Dedicated private connection. AWS Direct Connect, Azure ExpressRoute, and Google Cloud Interconnect provide a private circuit between your data center and the provider, bypassing the internet entirely. You get consistent latency, higher throughput, and lower data-transfer costs, at the price of weeks of lead time and a real monthly bill. Note that these circuits are not encrypted by default — a common exam point — so regulated workloads often run a VPN over the top of one.
VPC peering. A direct one-to-one connection between two VPCs, letting resources address each other by private IP. Two limitations define its use: peering is non-transitive (if A peers with B and B peers with C, A still cannot reach C), and the CIDR blocks must not overlap. Both of these show up as exam questions almost verbatim.
Transit gateway/hub-and-spoke. Once you have more than a handful of VPCs, full-mesh peering becomes unmanageable — n(n−1)/2 connections. A transit gateway (Azure calls the equivalent pattern a virtual WAN or hub VNet) acts as a central router that every VPC and every on-premises connection attaches to once. It solves the transitivity problem and turns the topology into a hub-and-spoke.
Private endpoints and PrivateLink. Cloud services such as object storage and managed databases normally live on public endpoints. A private endpoint projects that service into your VPC as a private IP address, so traffic to it never traverses the internet. This matters for compliance, for data-exfiltration control, and for cost. Gateway endpoints (used for storage in AWS) use route table entries; interface endpoints use an ENI in your subnet.
Securing a VPC
Two filtering mechanisms guard traffic inside a VPC, and the difference between them is one of the most reliably tested facts in cloud networking.
Security groups attach to instances and network interfaces. They are stateful: if you allow an inbound connection, the return traffic is allowed automatically, whatever the outbound rules say. They support allow rules only — there is no way to write a deny rule — so anything not explicitly permitted is implicitly denied. All rules are evaluated together, with no ordering. Think of them as a per-host firewall.
Network ACLs attach to subnets. They are stateless: return traffic must be explicitly permitted in the opposite direction, which is why NACL configurations need rules covering the ephemeral port range (roughly 1024–65535) for responses to work. They support both allow and deny rules, and rules are evaluated in numbered order; first match wins. Think of them as a router ACL at the subnet boundary.
The practical consequences are worth stating plainly. Traffic entering a subnet passes the NACL first, then the security group. Traffic leaving passes the security group first, then the NACL. Security groups are the primary control for almost all designs; NACLs are a coarse secondary layer, most useful for blanket blocks such as denying a hostile IP range across an entire subnet. And because security groups can reference other security groups as a source, you can write a rule that says "the database tier accepts port 5432 from the application tier" without hard-coding any IP addresses — an elegant capability with no on-premises equivalent, and one CompTIA likes to highlight.
Beyond the two firewalls:
- Flow logs record metadata about every connection — source, destination, ports, protocol, bytes, accept or reject. They do not capture payload. They are the primary forensic and troubleshooting record for a VPC, and they feed the beaconing and anomaly detection that security analysts rely on.
- Segmentation. The classic design puts a load balancer in public subnets, application servers in private subnets, and databases in isolated subnets with no route to the internet at all. Tiering this way means a compromise of the web layer does not hand the attacker the data layer.
- Egress filtering. Most teams lock down inbound rules and leave outbound wide open. That gap is precisely what command-and-control and data exfiltration exploit. Restricting outbound traffic to known destinations is one of the highest-value controls available in a VPC.
- Encryption in transit. Provider fabrics encrypt some inter-AZ and inter-region traffic, but assumptions here are dangerous. Application-layer TLS remains your responsibility.
- The shared responsibility model. The provider secures the physical network, the hypervisor, and the SDN fabric. You are responsible for your CIDR design, route tables, security groups, NACLs, and everything you run. Cloud breaches are overwhelmingly customer misconfigurations, not provider failures.
Common Mistakes and How to Troubleshoot Them
The same handful of errors account for most real-world VPC problems, and they make excellent exam scenarios.
A security group open to 0.0.0.0/0 on port 22 or 3389. SSH and RDP exposed to the entire internet. Automated scanners find these within minutes of creation. The fix is a bastion host, a provider session-manager service, or a VPN — never a global allow rule.
Resources public by accident. A subnet inherits a route table, and if that route table has a default route to an internet gateway, everything placed there with a public IP is reachable. Teams deploy a database into what they assume is a private subnet and discover otherwise.
Overlapping CIDR blocks. Discovered at the worst possible moment: when you try to peer two VPCs or connect to on-premises and the request is simply rejected. There is no clean fix short of re-addressing one side. Plan the address space centrally before the first VPC exists.
Subnet exhaustion. A /24 subnet feels generous until an autoscaling group, a container platform assigning an IP per pod, and a few managed services all draw from it. Subnets cannot be resized after creation.
Forgotten NACL return rules. Someone adds a restrictive NACL, connections hang, and the cause is that the ephemeral port range was never allowed inbound for responses. This is the stateless-versus-stateful distinction biting in production.
Missing routes. A peering connection or VPN tunnel is established and shows as "available," but nothing passes, because no one added the corresponding routes on both sides.
When traffic will not flow, work the path in order, and the answer usually appears within a few checks:
- Is there a route to the destination in the source subnet's route table?
- Does the source security group allow outbound traffic?
- Does the source subnet's NACL allow it outbound, and the return inbound?
- Does the destination NACL allow it inbound, and the return outbound?
- Does the destination security group allow it inbound?
- Is anything listening on the destination port, and is the host OS firewall permitting it?
Flow logs answer most of this quickly: a REJECT entry tells you the traffic arrived and was filtered, while no entry at all tells you it never got there — which points to routing rather than filtering.
Network+ (N10-009) Exam Tips
Network+ introduces the VPC as part of its cloud material, which sits in the Networking Concepts domain (23% of the exam). Coverage is conceptual — you need the vocabulary and the relationships, not hands-on provider skills.
What to know:
- Define a VPC and know the vendor-neutral terms. A logically isolated cloud network under your control. Recognize that Azure calls it a VNet.
- Cloud connectivity options and when each applies. Public internet, site-to-site VPN, and dedicated private connection. Expect a scenario that describes a requirement — consistent latency, lowest cost, quickest to deploy — and asks which one fits.
- Gateways. An internet gateway provides two-way internet access; a NAT gateway provides outbound-only access from private subnets. The distinction is heavily tested.
- Subnetting applies unchanged. The CIDR math you learned for on-premises networks is the same math you use to size VPC subnets. Do not treat cloud subnetting as a separate skill.
- Public versus private subnets is about routing. If a question asks what makes a subnet public, the answer involves the route to an internet gateway.
- Cloud service and deployment models. IaaS, PaaS, SaaS; public, private, hybrid, community. VPC questions often sit next to these.
- Related cloud networking terms. Network function virtualization, virtual switches and routers, elasticity and scalability, multitenancy, and the infrastructure-as-code idea that network configuration is now a text file.
- Connectivity troubleshooting. Network+ Domain 5 is Troubleshooting at 24%, the largest single domain, and a cloud connectivity scenario is fair game there — usually resolved by a missing route or a firewall rule.
Cloud+ (CV0-004) Exam Tips
Cloud+ covers VPCs in more depth than any other CompTIA exam. It is a hands-on, vendor-neutral cloud administration certification, and network design threads through nearly every domain: Cloud Architecture (23%), Deployment (19%), Security (19%), Operations (17%), Troubleshooting (12%), and DevOps Fundamentals (10%).
What to know:
- Design a VPC from requirements. Given a scenario — a three-tier application needing high availability across two zones with database isolation — be able to say how many subnets, in which AZs, with which route tables and gateways.
- CIDR planning and sizing. Choose a range, subdivide it, and avoid overlap with existing networks. Know that providers reserve addresses in each subnet, so usable host counts are lower than the raw math suggests.
- Every connectivity option in detail. Peering and its non-transitivity; transit gateways and hub-and-spoke; VPN versus dedicated circuit; private endpoints; and why a service endpoint keeps traffic off the internet.
- Security groups versus NACLs, cold. Stateful versus stateless, allow-only versus allow-and-deny, instance-level versus subnet-level, unordered versus numbered evaluation. This comparison appears in some form on nearly every Cloud+ attempt.
- Hybrid and multicloud networking. Connecting a VPC to on-premises, and connecting VPCs across two different providers, including the DNS and address-space problems that it creates.
- Load balancers, and the difference between internet-facing and internal. Which subnets each type belongs in.
- Troubleshooting methodology. Cloud+ expects a systematic path: routing, then security groups, then NACLs, then the host. Know what flow logs can and cannot tell you.
- Automation. Infrastructure as code, templates, and the operational argument that a VPC defined in a repository is reproducible and auditable while one built by hand is neither.
- Cost awareness. NAT gateways and cross-AZ data transfer carry real charges. Cloud+ asks cost-optimization questions, and network topology is often the lever.
Security+ (SY0-701) Exam Tips
Security+ approaches the VPC as a security boundary. You are not asked to build one; you are asked what it protects, how it fails, and who is responsible when it does.
What to know:
- The shared responsibility model. Where the provider's obligation ends, and yours begins, and how that line shifts between IaaS, PaaS, and SaaS. This is one of the most frequently tested cloud concepts on the exam.
- Segmentation and isolation as controls. Placing databases in subnets with no internet route is a security architecture decision, and Security+ frames it that way.
- Security groups and NACLs as cloud-native firewalls. Stateful versus stateless is fair game here too.
- Misconfiguration as the dominant cloud risk. Publicly exposed storage, wide-open management ports, permissive outbound rules. When a Security+ question describes a cloud breach, misconfiguration is usually the root cause.
- Apply least privilege to the network, including egress. Restricting outbound traffic limits command-and-control and data exfiltration.
- Zero trust in a cloud context. The VPC perimeter is not a trust boundary on its own; identity and per-request authorization still apply inside it.
- Logging and monitoring. Flow logs are the network record, and they capture metadata rather than packet contents.
- Encryption in transit and at rest, and which of those the provider handles by default.
- Related architecture vocabulary: virtualization, containerization, serverless, SDN, infrastructure as code, and the security implications of each.
SY0-701 is the current version at the time of writing, with a successor anticipated in the late-2026 to early-2027 window.
SecurityX (CAS-005) and Other Exams That Touch VPCs
SecurityX (CAS-005) — formerly CASP+ — is the advanced practitioner exam, and it treats cloud network design as an architecture problem rather than a configuration task. Expect scenarios with competing requirements: a regulated workload that must not traverse the public internet, a merger that joins two organizations with overlapping address space, a multicloud deployment with inconsistent security models. The test is your ability to choose among defensible designs and justify the trade-offs. Know hub-and-spoke topologies at scale, private connectivity for compliance, encryption requirements over dedicated circuits, cross-provider identity and network federation, and the governance problem of enforcing consistent VPC standards across dozens of accounts.
CySA+ (CS0-004) does not test VPC design, but it tests the artifacts a VPC produces. Flow logs are a core analyst data source, and cloud-specific detection — anomalous egress, connections to unexpected regions, a workload suddenly talking to the internet — depends on understanding what the network topology was supposed to look like.
Cloud Essentials+ (CLO-002) covers the VPC at a business and vocabulary level. You need to know what one is and why an organization would want isolated cloud networking, without any design or configuration depth.
PenTest+ (PT0-003) includes cloud attack surface. Misconfigured security groups, exposed management interfaces, overly permissive egress, and metadata-service access from a compromised instance are all in scope — which is the offensive mirror image of the misconfiguration list above.
A+ (220-1201/1202) touches cloud concepts only in passing. You will not see VPC design there, though the general cloud models appear.
Key Takeaways
- A VPC is a logically isolated network inside a provider's cloud, with your own address space, subnets, routing, and firewalls — the same network you would build on-premises, defined in software.
- Azure calls it a VNet. The concept is identical across providers, and CompTIA tests the concept, not a vendor.
- Plan the CIDR block before anything else. Overlapping address space cannot be routed between, and it is the one mistake you cannot easily fix later.
- A subnet is public because of its route table, not because of a subnet setting.
- Use an Internet gateway for two-way access, and a NAT gateway for outbound-only. Know the difference on sight.
- VPC peering is non-transitive and requires non-overlapping CIDRs. Beyond a few VPCs, use a transit gateway.
- Security groups are stateful, instance-level, allow-only, and unordered. NACLs are stateless, subnet-level, allow-and-deny, and evaluated in numbered order. This is the single most tested comparison in the topic.
- Lock down egress, not just ingress. Outbound rules are where exfiltration and C2 slip through.
- Troubleshoot in order: route table, security group, NACL, host. Flow logs distinguish "filtered" from "never arrived."
- Cloud+ goes deepest, Network+ covers the concepts, Security+ covers the boundary and the responsibility model, and SecurityX covers the architecture trade-offs.
Comments
Post a Comment