CIDR notation

From LQWiki
Jump to navigation Jump to search

To set up networking, you need to know the IP address and netmask of your computer. One way to note a netmask is like this:

IP: 192.168.0.1, netmask: 255.255.255.0.

With the CIDR notation, this goes easier. In this particular case it would be

IP/netmask: 192.168.0.1/24

The CIDR notation contains the IP address, then a slash ("/"), then the number of bits set in the subnet mask:

CIDR: 192.168.0.0/24

is an abbreviation for:

IP Address: 192.168.0.0
Netmask:    255.255.255.0 
(in binary) 11111111.11111111.11111111.00000000

because this subnet mask uses 24 bits for the network portion of the address.

Another example:

CIDR: 192.168.0.0/21

would look like:

IP Address: 192.168.0.0
Netmask:    255.255.248.0
(in binary) 11111111.11111111.11111000.00000000

And so on...

Because of its versatility, brevity, and easiness to understand CIDR notation is now the preferred method of identifying a network.

See also