AWS VPC CIDR IP Address Subnet Calculation

Viewed 713

I have a current vpc with the cidr 192.168.0.0/16 and subnets "192.168.0.0/24", "192.168.1.0/24","192.168.4.0/24", "192.168.5.0/24"

  • Now I want to create a NEW VPC but I am not sure what CIDR IP to use.
  • I want to keep the same 192.168 .. however as I am new to all this I cannot identify which other CIDR I can use that will NOT overlap my first vpc cidr.
  • once I choose that CIDR, I also need to create 4 subnets from it (like I did for my first VPC)
1 Answers

General recommendation for VPC CIDRS is in AWS docs:

- 10.0.0.0 - 10.255.255.255 
- 172.16.0.0 - 172.31.255.255 
- 192.168.0.0 - 192.168.255.255

So you can use any of these. Often, people use VPC CIDRs from the first range. So if you would like to do this as well, you could choose any CIDR from below (increment second digit if you want to use /16):

 - 10.0.0.0/16 
 - 10.1.0.0/16
 - 10.2.0.0/16
 - 10.3.0.0/16
 - ....
 - 10.255.0.0/16

From these, to get subnets (/24), you increment third digit. For example, for VPC CIDR 10.0.0.0/16, your subsets would be:

 - 10.0.0.0/24
 - 10.0.1.0/24
 - 10.0.2.0/24
 - 10.0.3.0/24
 - ....
 - 10.0.255.0/24

The individual resources in your subsets, e.g. instances, will get IPs using the forth digit.

Related