AWS VPC Create a subnet in another zone

I already have VPC configured (not the default) that Amazon EC2 uses.

I need to create another subnet (not the default) in the same VPC with a different availability zone.

So when I try to add data, I am stuck in a CIDR block. I get 2 errors when trying to set different IP addresses for CIDR.

  • The CIDR block 192.168.250.225/16 overlaps with the existing CIDR block 192.168.0.0/16 from the subnet-6afacb2c (192.168.0.0/16) | Public Subnet AvtarSingh.

  • 192.167.250.225/16 is not in the range 192.168.0.0/16

I tried many combinations that I could think of, but none of them work for me.

I'm sorry, but I don't know CIDR very well. So can you give me the correct CIDR for the current configuration? Right now, I just want to set up the development environment so that it can be verified.

The following are the current VPC and Subnet data:

  • Vpc

    VPC ID: vpc-8fe804ea | AvtarSingh VPC Network ACL: acl-406a8725 State: available Tenancy: Default VPC CIDR: 192.168.0.0/16 DNS Resolution: yes DHCP Options Set: dopt-0d6a7c6f DNS Hostnames: yes Route Table: rtb-18739f7d 
  • Subnet

     Subnet ID: subnet-6afacb2c | AvtarSingh Public Subnet Availability Zone: us-west-2c CIDR: 192.168.0.0/16 Route Table: rtb-1b739f7e State: available Network ACL: acl-406a8725 VPC: vpc-8fe804ea (192.168.0.0/16) | AvtarSingh VPC Default Subnet: no Available IPs: 65530 
+6
source share
3 answers

So, you created your subnet in the range 192.168.0.0/16, which also means the subnet mask 255.255.0.0 . Your address range for this block is 192.168.0.0-192.168.255.255 , so you can use any range in this block for your CIDR block.

Thus, the CIDR block 192.168.250.225/16 will also have the same address range 192.168.0.0/16 , because you are using the same subnet mask 255.255.0.0 (which means /16 at the end of the address).

You can learn more about this here: http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing

What you want is a CIDR block, which is within the range of 192.168.0.0/16 , so such blocks will work, for example: 192.168.0.0/24 , 192.168.1.0/24 , 192.168.2.0/24 , 192.168.3.0/24 , 192.168.128.0/24 , (these blocks have 256 possible addresses - broadcast and gateway) 192.168.20.0/23 (This block has 512 possible addresses - broadcast and gateway). Thus, in essence, everything that is inside 192.168.0.0/16 does not overlap with the existing CIDR block.

Hope this helps.

+9
source

Your cidr and your VPC are the same size.

You need to delete your first subnet so that you can cut multiple subnets.

Rico led you on the right track with his / 24 examples.

Another good tip is to use the CIDR calculator when your subnets see how many addresses you will accept when you announce a new subnet.

One of the easiest to use in my opionin is here

+4
source

You need to edit the CIDR for your VPC and add another CIDR block, say - 192.169.0.0/16. Then go to subnets and create a subnet with this range, as shown below:

enter image description here

+2
source

All Articles