Cloud concept · Updated

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

In short

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.

Cloud Concepts Hub →

6 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.

01
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.

02
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.

03
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.

04
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.

05
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.

06
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.

Amazon VPCAmazon 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.

AWS Transit GatewayAWS 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.

AWS PrivateLinkAWS 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.

Subnetting exam questions

Real practice exam questions on Subnetting, with the correct answer and its explanation. Answer them with every option in the exam simulator.

SAA-C03

A company is expanding an application into a second Availability Zone. Its Amazon VPC uses the CIDR block 10.32.0.0/21 and has three existing subnets: 10.32.0.0/23 for application instances in the first Availability Zone, and 10.32.2.0/24 and 10.32.3.0/24 for databases. All existing subnets must remain unchanged.

The company needs one new application subnet in the second Availability Zone that supports at least 300 private IPv4 addresses. The company must use the existing VPC CIDR block without adding another CIDR block.

Which subnet allocation meets these requirements?

Show answerCORRECT ANSWER

Create a subnet with CIDR block 10.32.4.0/23 in the second Availability Zone.

This range is within the VPC's 10.32.0.0–10.32.7.255 address space and does not overlap any existing subnet. A /23 contains 512 IPv4 addresses, of which 507 are assignable in a standard AWS subnet, satisfying the capacity requirement.

SAP-C03

A company runs Amazon EKS worker nodes in private IPv4 subnets across three Availability Zones. The Amazon VPC CNI plugin uses IPv4 prefix delegation to assign addresses to Pods. In one Availability Zone, new worker nodes cannot obtain prefixes, and Pods remain pending.

The affected /24 subnet has 140 available IPv4 addresses. However, other workloads have allocated addresses throughout the subnet, and every aligned /28 range contains at least one allocated address. The worker instance types support prefix delegation, and network interface quotas are sufficient. The VPC contains unused address space for additional subnets.

The company must restore Pod scaling in the affected Availability Zone without renumbering or interrupting the non-EKS workloads. The solution must also protect address capacity for future Pod prefixes from allocations of individual addresses.

Which solution meets these requirements?

Show answerCORRECT ANSWER

Create a new worker subnet in the affected Availability Zone from unused VPC address space. Before launching resources, create prefix-type subnet CIDR reservations for aligned /28 ranges. Launch replacement workers in the new subnet and drain the affected workers.

IPv4 prefix delegation requires contiguous, aligned /28 blocks, not merely enough free individual addresses. A new subnet provides unfragmented space, and prefix-type reservations protect selected ranges from individual address allocations while permitting prefix assignment. Replacement workers can use the new subnet without changing the non-EKS workloads.

Practice Subnetting in a full exam

Questions on Subnetting in each practice exam, with every answer option and an explanation for each:

Start a free practice exam

What is Subnetting

3 min read

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.

Learn Subnetting in lessons

4 short lessons on Subnetting in 2 certification courses.

Open the lessons