Skip to content

CIDR

Resources

Basics

CIDR: Classless Inter Domain Routing

An IPv4 IP address is made up of 32 bits:

ip-address-32-bits

If we want a representation of all IPs starting with 10.10, we can use the CIDR representation as:

cidr

number of hosts

10.10.0.0/16 will give us a total of 256*256 hosts. Similarly, 10.10.0.0/24 will give us a total of 256 hosts.

single IPv4 address

A single IPv4 address in CIDR notation is: 10.10.101.5/32.

All Wildcards

If we want to represent the entire set of possible IPv4 addresses:

all-wildcards

Example

Use this and this to visualize.

Let's say VPC CIDR is: 10.0.0.0/26, which means 64 total IPs (62 usable).

vpc-cidr

We can subnet this VPC into two subnets, having the following CIDRs:

  • 10.0.0.0/27
  • 10.0.0.32/27

subnets

subnet-1

subnet-2