AWS VPC and Subnet CIDR calculation and allocation

Manmohan Singh Bohara
Geek Culture
Published in
4 min readJul 2, 2021

--

Photo by Jordan Harrison on Unsplash

Click the link to subscribe to my articles.

Its hard to understand CIDR calculation and allocation when we create our first virtual private cloud and subnets. I hope this article would be helpful for beginners.

Let’s first understand why CIDR allocation is so important while creating VPCs. When we have a single VPC then CIDR allocation may not be that important. However, when we need interconnectivity between multiple VPCs in same account or across different accounts, then its very important to plan ahead and define our CIDR blocks accordingly. When we have same CIDR blocks or overlapping CIDR blocks in two different VPCs, then we can’t use features like VPC peering.

So, now we understand that allocating CIDR blocks correctly is a critical task, let’s understand what CIDR is. CIDR, which stands for Classless Inter-Domain Routing, is an IP addressing scheme that improves the allocation of IP addresses. I had written an answer to a stackoverflow question (https://stackoverflow.com/questions/51734945/cidr-address-is-not-within-cidr-address-from-vpc/56051282#56051282), where I have explained how CIDR address range works. I hope this will provide more clarity in CIDR allocation.

An IPv4 address consists of 32 bits.

--

--

Manmohan Singh Bohara
Manmohan Singh Bohara

Written by Manmohan Singh Bohara

Software Engineering, Cloud Computing Professional

Responses (6)