Skip to content

CIDR range examples

When you create a subnet you specify a CIDR block that is a subset of the VPC CIDR block. For IPv4 you cannot create a subnet with a CIDR block larger than a /16.

  • Minimum VPC or subnet size: /28 (16 addresses)
  • Maximum VPC or subnet size: /16 (65,536 addresses)
  • The primary CIDR block should come from the RFC 1918 private ranges:
    • 10.0.0.0/8
    • 172.16.0.0/12
    • 192.168.0.0/16
  • An Amazon-provided IPv6 CIDR block for a VPC is a /56.
  • Subnet IPv6 CIDR blocks are conventionally /64.
CIDRNetmaskCalculationAddressesTypical use
/32255.255.255.2552^(32-32) = 2^01Single host address (for example, a firewall rule)
/31255.255.255.2542^(32-31) = 2^12Point-to-point links between routers
/30255.255.255.2522^(32-30) = 2^24Router-to-router WAN links
/29255.255.255.2482^(32-29) = 2^38Very small office networks, IoT segments
/28255.255.255.2402^(32-28) = 2^416Smallest permitted AWS subnet
/27255.255.255.2242^(32-27) = 2^532Small department networks
/26255.255.255.1922^(32-26) = 2^664Medium department networks
/25255.255.255.1282^(32-25) = 2^7128Large department networks
/24255.255.255.02^(32-24) = 2^8256Standard enterprise subnet
/23255.255.254.02^(32-23) = 2^9512Large subnet spanning departments
/22255.255.252.02^(32-22) = 2^101,024Campus networks, data centre segments
/21255.255.248.02^(32-21) = 2^112,048Small ISP allocations
/20255.255.240.02^(32-20) = 2^124,096Medium ISP allocations
/19255.255.224.02^(32-19) = 2^138,192Large ISP allocations
/18255.255.192.02^(32-18) = 2^1416,384Regional ISP networks
/17255.255.128.02^(32-17) = 2^1532,768Large regional networks
/16255.255.0.02^(32-16) = 2^1665,536Largest permitted AWS VPC or subnet
/8255.0.0.02^(32-8) = 2^2416,777,216Largest organisations, legacy Class A
/00.0.0.02^(32-0) = 2^324,294,967,296The entire IPv4 address space

Usable address counts. On a conventional network two addresses per subnet are unusable (network and broadcast); in a VPC subnet AWS reserves five.

  • /24 = 256 addresses, 254 usable on a conventional network, 251 in a VPC subnet
  • /28 = 16 addresses, 14 usable, 11 in a VPC subnet
  • /27 = 32 addresses, 30 usable, 27 in a VPC subnet
  • /16 = 65,536 addresses, 65,534 usable, 65,531 in a VPC subnet

Given a VPC of 10.0.0.0/16:

  • The largest possible subnet is a /16, the same size as the VPC.
  • 10.0.1.0/24 is a valid subnet.
  • 11.0.0.0/24 is not valid — it falls outside the VPC CIDR block.

For 192.168.1.0/24 on a conventional network:

  • First usable address: 192.168.1.1
  • Last usable address: 192.168.1.254
  • Broadcast address: 192.168.1.255

Overlap:

  • 10.0.0.0/24 and 10.0.0.128/25 overlap — the second is contained in the first.
  • 10.0.0.0/24 and 10.0.1.0/24 do not overlap.

Splitting 10.0.0.0/24 into four equal subnets gives 10.0.0.0/26, 10.0.0.64/26, 10.0.0.128/26 and 10.0.0.192/26.