Course contentsShow
← Security
Lesson 1828 of 3,05237. Cloud Security - Network ArchitectureFree lesson

Subnetting in Cloud VPCs

Understanding CIDR blocks, IP allocation, and subnet design for logical network segmentation within cloud VPCs.

Subnetting in Cloud VPCs

What You'll Learn

You'll learn how to design and allocate subnets within cloud VPCs using CIDR blocks to create logical network segments that improve security and organization.

What Is Subnetting in Cloud VPCs?

Subnetting divides your VPC's overall IP address space into smaller, isolated networks called subnets. Each subnet exists in a specific availability zone and gets its own CIDR block (a range of IP addresses) carved from the VPC's larger CIDR block.

Think of your VPC as a city, and subnets as neighborhoods. Each neighborhood has its own address range and can have different rules (security groups, NACLs) applied to it.

CIDR Blocks and IP Allocation

When you create a VPC, you define its CIDR block (like 10.0.0.0/16). This determines:

  • Total available IPs: A /16 provides ~65,000 addresses
  • Subnet boundaries: You subdivide this into smaller blocks

For example, from 10.0.0.0/16:

  • Public subnet: 10.0.1.0/24 (256 addresses)
  • Private subnet: 10.0.2.0/24 (256 addresses)
  • Database subnet: 10.0.3.0/24 (256 addresses)

Each /24 block gives you roughly 251 usable IPs (cloud providers reserve 5 addresses per subnet for management).

Logical Network Segmentation for Security

Strategic subnetting creates security boundaries:

  • Public subnets: Internet-facing resources (load balancers, bastion hosts)
  • Private subnets: Application servers with no direct internet access
  • Isolated subnets: Databases and sensitive data stores

By placing resources in different subnets, you apply distinct security controls (NACLs, route tables) to each tier. This follows the principle of least privilege at the network level—your database doesn't need the same connectivity as your web servers.

Poor subnet design (like putting everything in one large subnet) eliminates this defense-in-depth advantage.

Key Takeaway: Proper subnet design using CIDR blocks creates logical security boundaries within your VPC, enabling you to apply different access controls and routing rules to different resource tiers.