Reputation: 365
I'm asked to update our current aws vpc environment, our current vpc cidr is 172.30.0.0/24
,
below are subnets and avilability zones:
172.30.0.0/26
- public1
- az1
172.30.0.128/26
- private1
- az1
172.30.0.64/26
- public2
- az2
172.30.0.192/26
- private2
- az3
I'm not able to recreate the vpc because some other services have been deployed to them, as you can see, in az2 and az3, there are only one subnet, and I want to add one subnet in az2 and az3
But I don't know how can I split it, could you please give some idea
Upvotes: 1
Views: 298
Reputation: 270104
Using a CIDR calculator:
Your VPC 172.30.0.0/24
goes from 172.30.0.0
to 172.30.0.255
:
172.30.0.0/26
goes from 172.30.0.0
to 172.30.0.63
172.30.0.64/26
goes from 172.30.0.64
to 173.30.0.127
172.30.0.128/26
goes from 172.30.0.128
to 173.30.0.191
172.30.0.192/26
goes from 172.30.0.192
to 173.30.0.255
Therefore, the VPC range is full!
Upvotes: 1
Reputation: 238747
can I use 172.30.1.64/26 for new subnet at az2
Sadly, you can't, as your VPC cidr is 172.30.0.0/24
. Since you can't delete any of your current subnets, I think the best way is to add new cidr to your VPC. You can add 172.30.1.0/24
, and then you will be able to create 172.30.1.64/26
subnet.
Upvotes: 2