I want to have 1000 private IP addresses in my VPC. Can I use the IP address range 192.168.0.0/22
for achieving this?
NETMASK: 255.255.252.0
CIDR BASE IP: 192.168.0.0
BROADCAST IP: 192.168.3.255
COUNT: 1,024
FIRST USABLE IP: 192.168.0.1
LAST USABLE IP: 192.168.3.254
The subnet mask /22
means that the first 22
bits of the IP address are network bits, leaving 32 - 22 = 10
bits for host addresses. The subnet consists of 1024
IP addresses (2^10), but not all of them are usable because some addresses are reserved for network address, broadcast address. Is my calculation correct and can I use the 192.168.0.0/22
for my VPC?
Yes your calculation is correct. This is indeed how subnet masks work.
2
The addresses to avoid are 0
, 254
and 255
.
This gives 1024 – 3 = 1021, which is more than 1000.
1