AWS VPC Design issue – CIDR conflicts

amazon-vpcamazon-web-servicesnetworking

I am planning to create subnets on this newly created VPC. At the moment, I have created four subnets on three AZs and fourth one kept as spare.

I would then break each of the four subnets and create subnets inside those for public and private purpose. To give an example:

10.0.0.0/18 — AZ A
      10.0.0.0/19 — Private
      10.0.32.0/19
              10.0.32.0/20 — Public
              10.0.48.0/20
                  10.0.48.0/21 — Protected
                  10.0.56.0/21 — Spare

This will be repeated for all other ones. The complete picture will look like

10.0.0.0/16:
    10.0.0.0/18 — AZ A
        10.0.0.0/19 — Private
        10.0.32.0/19
               10.0.32.0/20 — Public
               10.0.48.0/20
                   10.0.48.0/21 — Protected
                   10.0.56.0/21 — Spare
    10.0.64.0/18 — AZ B
        10.0.64.0/19 — Private
        10.0.96.0/19
                10.0.96.0/20 — Public
                10.0.112.0/20
                    10.0.112.0/21 — Protected
                    10.0.120.0/21 — Spare
    10.0.128.0/18 — AZ C
        10.0.128.0/19 — Private
        10.0.160.0/19
                10.0.160.0/20 — Public
                10.0.176.0/20
                    10.0.176.0/21 — Protected
                    10.0.184.0/21 — Spare
    10.0.192.0/18 — Spare

I have followed this link Practical VPC Design for the above plan.

However, I have getting error as CIDR conflicts. I was wondering whether you can help.

Best Answer

I am guessing that you have created 4 of these: 10.0.0.0/18 and by doing so you have "spent" all of the resources.

You would need to create subnets as follows:

AZ A

10.0.0.0/19 (8192) - Private

10.0.32.0/20 (4096) - Public

10.0.48.0/21 (2048) - Protected

10.0.56.0/21 (2048) - Spare

Total: 16384

AZ B

10.0.64.0/19 (8192) - Private

10.0.96.0/20 (4096) - Public

10.0.112.0/21 (2048) - Protected

10.0.120.0/21 (2048) - Spare

Total: 16384

AZ C

10.0.128.0/19 (8192) - Private

10.0.160.0/20 (4096) - Public

10.0.176.0/21 (2048) - Protected

10.0.184.0/21 (2048) - Spare

Total: 16384

AZ D

10.0.192.0/18 (if you want to divide this one, you will need to delete this subnet and create smaller chunks.

Total: 16384

===================================

Grand total: 65536