[Avg. reading time: 3 minutes]
CIDR
CIDR = Classless Inter-Domain Routing
It defines how many IP addresses are in a network (or subnet) using a “slash” notation.
Example: 192.168.10.0/24
- Network address: 192.168.10.0
- Prefix Length: /24 means this network will have 256 total IPs
Number of IPs = 2^(32 - prefix)
But AWS and most networks reserve 5 IPs in each subnet:
- 1 for network address
- 1 for broadcast address
- 3 reserved by AWS (for internal routing, DNS, etc.)
/24 subnet gives 251 usable IPs
| CIDR | Subnet Mask | Total IPs | Usable in AWS | Typical Use |
|---|---|---|---|---|
/16 | 255.255.0.0 | 65,536 | 65,531 | Entire VPC range |
/20 | 255.255.240.0 | 4,096 | 4,091 | Large subnet |
/24 | 255.255.255.0 | 256 | 251 | Typical small subnet |
/28 | 255.255.255.240 | 16 | 11 | Small test subnet |
/32 | 255.255.255.255 | 1 | 0 | Single host route |
192.168.10.0 = 11000000.10101000.00001010.00000000
Last 8 digits goes like this
00000100
00000101
00000101
00000110
.....
.....
11111111