Skip to content

CIDR (Classless Inter-Domain Routing) ranges

  1. CIDR Notation:
  2. CIDR is written as IP/prefix (e.g., 192.168.0.0/16), where:
    • IP is the network address.
    • prefix indicates how many bits are reserved for the network (subnet mask).
  3. The smaller the prefix (e.g., /16), the larger the range of IPs in that block.

  4. IP Address Range:

  5. Each /X corresponds to 2^(32-X) addresses for IPv4.
    • /24 → 256 addresses (most common for subnets).
    • /16 → 65,536 addresses (often for large VPCs).
    • /28 → 16 addresses (small subnets for things like NAT gateways or bastions).
  6. The first address is reserved for the network identifier and the last is for the broadcast address, leaving 2^(32-X) - 2 usable addresses.

  7. Common CIDR Blocks:

  8. For private subnets:

    • 10.0.0.0/8 (large range for private IPs).
    • 172.16.0.0/12 (medium range).
    • 192.168.0.0/16 (small range, often for home networks).
  9. AWS VPC and Subnetting:

  10. A VPC CIDR range must be between /16 and /28.
  11. Subnets divide the VPC CIDR into smaller blocks (subnet masks like /24 or /26).

  12. Overlapping CIDRs:

  13. VPC peering or hybrid cloud setups (e.g., with on-premises networks) require non-overlapping CIDR ranges.

  14. Subnet Calculations:

  15. Know how to calculate available IPs and split a given CIDR range into subnets. Example: Splitting a /16 (65,536) into /24 (256) subnets gives 2^(24-16) = 256 subnets, each with 256 IPs.

Things to Watch for in Exam Questions:

  • Ensure subnets fit into the VPC CIDR range.
  • Look for conflicts in CIDR blocks for multi-VPC or hybrid networking.
  • When choosing subnets, remember to allocate sufficient IP addresses for future scaling (e.g., NAT, ALB, etc.).