CLOUD CONCEPT

Subnetting

Subnetting divides an IP address block into smaller, non-overlapping networks to organize address allocation, routing, and connectivity boundaries.

Cloud Concepts Hub →

What is Subnetting

Subnetting uses IP prefixes to divide address space into networks sized for particular workloads and operational needs. In cloud environments, it supports scalable network design across accounts, Regions, and virtual networks, while helping engineers avoid address conflicts and establish routing and security boundaries.

Subnetting divides a larger IP network into smaller address ranges by extending its network prefix. In Classless Inter-Domain Routing (CIDR) notation, the number after the slash specifies how many bits identify the network. An IPv4 /16 contains 65,536 addresses, while a /24 contains 256. Dividing 10.20.0.0/16 into /24 subnets creates 256 distinct ranges, such as 10.20.1.0/24 and 10.20.2.0/24. Longer prefixes mean smaller networks, and each subnet must start on a boundary appropriate to its size.

Cloud designs typically allocate address space hierarchically: an organization reserves large blocks, assigns smaller blocks to Regions and virtual networks, and subdivides those into workload subnets. For example, an organization might reserve 10.0.0.0/8, allocate 10.20.0.0/16 to one VPC, and use separate /24 subnets for application and database workloads in each Availability Zone. In AWS, a VPC is regional and each subnet belongs to one Availability Zone. A resilient application therefore uses multiple subnets across multiple zones rather than treating a subnet as a multi-zone resource.

Subnet sizing must account for usable addresses, not just the mathematical block size. In a standard AWS IPv4 subnet, five addresses are reserved, so a /24 provides 251 assignable addresses and a /26 provides 59. Capacity planning should include instances, container networking, load balancers, private endpoints, managed-service network interfaces, and temporary scaling or deployment capacity. Small subnets conserve address space but can exhaust unexpectedly; large subnets simplify growth but consume scarce IPv4 space. An existing AWS subnet cannot be resized in place, so correcting an undersized allocation usually requires creating another subnet and migrating resources.

A subnet is an address and routing boundary, not an automatic security barrier. In AWS, subnets in the same VPC can normally communicate through local routing unless security controls restrict traffic. Use route tables, security groups, network ACLs, and firewalls to implement the intended segmentation. A public subnet has a route to an internet gateway, but that route alone does not make every resource internet-accessible: an IPv4 instance also needs a public address and permissive security controls. A private subnet can have outbound internet access through a NAT gateway without supporting unsolicited inbound internet connections.

Across accounts, Regions, VPCs, and on-premises networks, coordinate allocations before establishing connectivity. Two isolated VPCs can both use 10.20.0.0/16, but ordinary routing cannot unambiguously connect identical destination addresses in both networks. AWS VPC peering rejects overlapping VPC CIDR blocks. Transit Gateway also does not resolve overlap; overlapping VPC address ranges are not propagated as normal distinct destinations. Adding more-specific routes is not a general solution because duplicate addresses, local routing behavior, and return-path requirements remain.

The preferred long-term overlap solution is renumbering one network into unique address space. When renumbering is impractical, address translation can expose unique translated ranges, with additional operational complexity and potential application limitations. For access to a specific service rather than an entire network, a private endpoint architecture such as AWS PrivateLink can connect consumers and providers despite overlapping CIDRs. This does not provide unrestricted routed connectivity between the networks. DNS must direct clients to the appropriate endpoint or translated address.

Choose connectivity patterns separately from address allocation: peering can suit a small number of direct relationships, while a transit hub can simplify larger multi-account topologies. Both require deliberate routes and return paths. Contiguous allocations can support route summarization, reducing routing-table complexity, but summaries must not accidentally advertise ownership of unrelated networks. Centralized IP address management helps track assignments, detect conflicts, and preserve growth space. IPv6 uses the same prefix-based principles, although capacity planning generally emphasizes consistent hierarchy and provider constraints rather than conserving individual addresses.

Key aspects of Subnetting

Effective subnetting combines correct CIDR sizing, coordinated address allocation, deliberate routing and security controls, and explicit plans for growth and overlapping networks.

CIDR boundaries and address capacity

A prefix determines a subnet's size and valid address boundaries; increasing the prefix length reduces the address count. Calculate usable capacity using the cloud provider's reservations and workload-specific address requirements.

Hierarchical, non-overlapping allocation

Allocate address blocks systematically across organizations, Regions, accounts, and virtual networks. Reserve contiguous space for growth and route summarization while checking for conflicts with on-premises networks and partner environments.

Routing and security are separate controls

Subnets provide useful boundaries for route-table and network-policy assignments, but separate subnets do not inherently prevent communication. Enforce segmentation with explicit routing, security rules, and inspection where required.

Availability and growth planning

Distribute workload subnets across the failure domains required by the platform; in AWS, each subnet occupies one Availability Zone. Include scaling, rolling deployments, and managed-service interfaces in capacity estimates.

Overlap remediation

Prefer unique addressing or renumbering when full routed connectivity is required. Where that is impractical, use carefully designed translation or service-specific private endpoints, recognizing that neither is equivalent to unrestricted network connectivity.

Connectivity-aware route design

Design prefixes and routes together for direct peering, hub-and-spoke, and hybrid connectivity. Validate route propagation, summarization, security policy, and return paths rather than assuming a network attachment makes every subnet reachable.

Cloud services for Subnetting

Amazon VPC defines subnet boundaries and applies the routing and security controls used by workloads. VPC IPAM coordinates address allocation across accounts and Regions, reducing conflicts before networks are connected. For broader connectivity, Transit Gateway connects VPC and hybrid attachments through controlled routing domains, but still requires an addressing plan that avoids ambiguous destinations. When overlapping networks need access to a particular application rather than unrestricted network connectivity, PrivateLink can expose that service through consumer-side endpoints. Together, these services separate address management, subnet implementation, routed connectivity, and service-level access; none eliminates the need to size subnets and validate security rules and return paths.

Virtual private cloud VPC_32 image Amazon VPC

Amazon VPC provides regional virtual networks containing Availability Zone-specific subnets, route tables, and network security controls. Its peering feature connects VPCs with non-overlapping address ranges, subject to explicit route and security configuration.

Open Amazon VPC →
AWS Transit Gateway image AWS Transit Gateway

Transit Gateway provides a regional routing hub for connecting VPCs and on-premises networks, with route tables that support separate connectivity domains. It does not translate overlapping addresses, so address planning remains necessary; inter-Region connectivity also requires explicit peering and routing configuration.

Open AWS Transit Gateway →
AWS PrivateLink image AWS PrivateLink

PrivateLink supports private access to specific services through endpoints rather than full routed connectivity between consumer and provider networks. It can support service access when their CIDR ranges overlap, avoiding the need to route directly to the provider's original addresses.

Open AWS PrivateLink →