How to determine subnet IPv4 CIDR address in AWS?
Asked Answered
A

1

6

How to determine subnet IPv4 CIDR address in AWS. Suppose my VPC CIDR block is 172.31.0.0/16 and I want to create a subnet with 172.31.1.0/16 but it says " *** is not within the range of ****/*. Please explain me how to determine CIDR?

Abagail answered 27/1, 2017 at 11:20 Comment(0)
K
11

172.31.0.0/16 represents these IP ranges:

CIDR Range      172.31.0.0/16
Netmask         255.255.0.0
Wildcard Bits   0.0.255.255
First IP        172.31.0.0
Last IP         172.31.255.255
Total Host      65536

172.31.1.0/16 represents the same IP range because of the /16 subnet mask which would be like 172.31.1.0/255.255.0.0:

CIDR Range      172.31.1.0/16
Netmask         255.255.0.0
Wildcard Bits   0.0.255.255
First IP        172.31.0.0
Last IP         172.31.255.255
Total Host      65536

Therefore it's not a subset of 172.31.0.0/16.

Perhaps you'd be comfortable with 256 IPs per subnet? In which case you could use 172.31.1.0/24 which would allow the IP range of 172.31.1.0 - 172.31.1.255:

CIDR Range      172.31.1.0/24
Netmask         255.255.255.0
Wildcard Bits   0.0.0.255
First IP        172.31.1.0
Last IP         172.31.1.255
Total Host      256

See https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing.

Karonkaross answered 27/1, 2017 at 11:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.