What is it?:
- CIDR (Classless Inter-Domain Routing) is a method for assigning IP addresses and IP routing.
- In AWS VPCs (Virtual Private Clouds), CIDR blocks define the IP address range for your network. For example,
10.0.0.0/16.
Key Concepts:
- IP Range: Specifies the IP range for the VPC using a CIDR block, such as
10.0.0.0/16, where 16 is the subnet mask.
- Private IP Addresses: VPC CIDR blocks often use private IP ranges (
10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16).
- Subnets: VPC CIDR blocks are divided into subnets for organizing different layers of your network (e.g., public and private subnets).
Important Points:
- VPC CIDR Block Size: Can range from
/16 (65,536 IP addresses) to /28 (16 IP addresses).
- Multiple CIDR Blocks: A VPC can have multiple CIDR blocks (IPv4 and IPv6) to extend the IP range.
- Non-overlapping CIDRs: CIDR blocks within a VPC or across peered VPCs must not overlap.
- Subnet Mask: The smaller the number after the slash (e.g.,
/16), the larger the range of IP addresses.
Best used for:
- Designing a scalable and secure network structure within AWS.
- Defining network boundaries for resources like EC2 instances, databases, and load balancers.