AWS Certified Advanced Networking – Specialty (ANS-C01)Network ImplementationMedium
A network engineer needs to configure a new VPC with a CIDR block of 10.0.0.0/20. The VPC requires at least five subnets, with the largest subnet needing to accommodate 100 EC2 instances and the smallest needing to accommodate 10 instances. What is the most efficient subnetting scheme to meet these requirements while minimizing wasted IP addresses?
- AUse one /25, one /26, and three /28 subnets.
- BUse five /24 subnets.
- CUse one /25, one /26, one /27, one /28, and one /29 subnet.
- DUse one /25, one /26, and three /27 subnets.
Show answer & explanationAnswer & explanation
Correct answer: B. Use five /24 subnets.
A /24 subnet provides 256 IP addresses (256-5 = 251 usable), which can accommodate 100 instances and 10 instances comfortably. Using five /24 subnets from a /20 VPC (which has 4096 addresses) allows for future growth and simplifies management, while still being efficient given the requirement for a subnet with 100 instances. This provides enough addresses for current needs and allows for expansion without complex VLSM for just five subnets.
Why the other options are wrong
- A. A /28 (11 usable IPs) is barely enough for 10 instances and leaves almost no room for growth, making it less efficient in the long run for dynamic environments.
- C. This scheme uses overly granular subnets, with /28 (11 usable) and /29 (3 usable) being too small for the '10 instances' requirement if growth is considered, and adds unnecessary complexity for just five subnets.
- D. A /25 (123 usable IPs) covers 100 instances. A /26 (59 usable IPs) does not cover 10 instances adequately if other subnets also need 10. Three /27s (27 usable IPs each) are too small for 10 instances if considering future growth.
VPC Subnet Sizing
The process of dividing a VPC's CIDR block into smaller subnets, considering the number of IP addresses needed for resources and future growth.
- AWS reserves 5 IP addresses in each subnet.
- Number of usable IPs = 2^(32-CIDR) - 5.
- Allocate slightly more IPs than immediately needed for flexibility.
Memory trick: CIDR math: Bigger number, smaller block, more granular.