CIDR, which stands for classless inter-domain routing, is a way to describe a range of IP addresses. An IP address generally comes in two flavors, IPv4, and IPv6. This article will address CIDR notation for IPv4 address ranges. There are a total of 2^32, or 4,294,967,296 IPv4 addresses.
CIDR for IPv4 ranges have four numbers, which can be from 0 to 255, and a number of the slash character, which is referred to as the subnet mask. The subnet mask, represented by the integer after the slash, refers to how many leading 1 bits are represented in a range. For CIDR notation for IPv4 addresses, this number can range from 0 to 32. Every binary number after the subnet mask can be a 1 or a 0, which results in a range of IP addresses.
Specifying one IP address
To specify one IP address, you could write
10.255.32.30/32. This CIDR
notation only references the IP address
10.255.32.30 and because the subnet
mask is 32, this means the number of leading bits is 32. By stating that the
subnet mask is 32, every possible bit must be accounted for, so the range of
IP addresses is the same IP address previously specified.
On the other hand to specify every IPv4 address, this notation,
encompasses every IP in the IPv4 because each of the four numbers can go from
0 to 255 and the possible permutations of this is 2^32.