Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the smallest subnet one can create on AWS in the VPC?

I want to limit the number of instances that can run in a subnet to the smallest number of instances possible. This in combination with an IAM role will allow me to limit how many instances a user can create on my AWS account (see https://forums.aws.amazon.com/thread.jspa?threadID=174503 requirement #4 which reflects my motivations).

What is the smallest subnet one can create on AWS in the VPC and what would the IPv4 CIDR be?

like image 533
dmohr Avatar asked Jan 30 '17 23:01

dmohr


1 Answers

16 IPs is the smallest range for a VPC Subnet -- /28 netmask.

For example, you could create a VPC with the CIDR range 10.0.0.0/26 which would support up to 64 IPs in the range of 10.0.0.0 - 10.0.0.63.

Then you could create 4 subnets, each with 16 available IPs using the following VPC CIDR ranges:

10.0.0.0/28   (10.0.0.0  - 10.0.0.15)
10.0.0.16/28  (10.0.0.16 - 10.0.0.31)
10.0.0.32/28  (10.0.0.32 - 10.0.0.47)
10.0.0.48/28  (10.0.0.48 - 10.0.0.63)

NOTE: See important comment below by @sqlbot. Not all 16 in range can be used for instances.

like image 154
Dave Maple Avatar answered Oct 29 '22 10:10

Dave Maple