Search code examples
amazon-web-servicesvpccidr

Conflict between IPv4 CIDR block for the VPC and recomended CIDR block size


From the AWS VPC docs

When you create a VPC, you must specify an IPv4 CIDR block for the VPC. The allowed block size is between a /16 netmask (65,536 IP addresses) and /28 netmask (16 IP addresses).

Then a few sentences later:

When you create a VPC, we recommend that you specify a CIDR block (of /16 or smaller) from the private IPv4 address ranges as specified in RFC 1918:

10.0.0.0 - 10.255.255.255 (10/8 prefix)

172.16.0.0 - 172.31.255.255 (172.16/12 prefix)

192.168.0.0 - 192.168.255.255 (192.168/16 prefix)

To me it seems that 2/3 of the recommended block sizes are outside of the allowed range.

What's the deal?


Solution

  • The 3 blocks listed are IANA RFC 1918 reservations. The VPC docs are not recommending that you use one of these verbatim but that you use a subrange of one of these that fits the VPC requirements (between /16 and /28). For example:

    • 10.0.0.0/16
    • 172.16.0.0/16
    • 192.168.0.0/16