简体   繁体   中英

AWS VPC CIDR IP Address Subnet Calculation

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)

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, eg instances, will get IPs using the forth digit .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM