CIDR (Classless Inter-Domain Routing) is a notation for expressing IP addresses and their associated routing prefix. Here’s a cheat sheet for CIDR notation:
CIDR Notation Format
IP Address followed by Slash and Prefix Length:
- Example:
192.168.1.0/24
CIDR Prefix Lengths and Subnet Sizes
- /32:
- Single Host (IPv4 Address)
- /31:
- Used in point-to-point links (2 Hosts)
- /30:
- 4 Hosts
- /29:
- 8 Hosts
- /28:
- 16 Hosts
- /27:
- 32 Hosts
- /26:
- 64 Hosts
- /25:
- 128 Hosts
- /24:
- 256 Hosts
- /23:
- 512 Hosts
- /22:
- 1024 Hosts
- /21:
- 2048 Hosts
- /20:
- 4096 Hosts
- /19:
- 8192 Hosts
- /18:
- 16384 Hosts
- /17:
- 32768 Hosts
- /16:
- 65536 Hosts
CIDR Example Subnetting
Example: Subnetting /24 into /27:
- Divide a /24 network into eight /27 subnets.
Original Network: 192.168.1.0/24
Subnet 1: 192.168.1.0/27
Subnet 2: 192.168.1.32/27
...
CIDR IPv6 Notation
IPv6 CIDR Notation Format:
- Example:
2001:0db8::/32
CIDR Notation Calculation
- Network Address:
IP & Netmask
- First Host:
Network Address + 1
- Last Host:
Broadcast Address - 1
- Broadcast Address:
Network Address | ~Netmask
CIDR for IPv6
- /64:
- Standard subnet size for IPv6
- /48:
- Commonly used for site-level addressing
- /32:
- Represents a full IPv6 address
This cheat sheet provides a quick reference for CIDR notation and subnetting in IPv4 and IPv6. CIDR notation is a concise way to represent IP address blocks and their associated routing prefixes.