1

I'm struggling to understand how to compute the CIDR number from an IP address for hours. Examples I've seen don't explain how the provided answer was found. For example, if I have the IP 197.18.0.0, I thought the CIDR number was 24 because 197.18.0.0 is a class C address with a subnet mask of 255.255.255.0 so the first 24 bits would be 1s. Is this answer correct? If not, please explain how to find the CIDR number in this case. Thanks.

sam_smith
  • 15
  • 3

1 Answers1

0

Network classes were deprecated in 1993 by RFCs 1517, 1518, and 1519, which defined CIDR. Modern networking does not use network classes.

The CIDR number is simply the number of one bits in the network mask. You cannot get a CIDR number from an address, it comes from the network mask.

You have no idea what the number is for your example of 197.18.0.0, but if you had the mask 255.255.255.192, you would know that it is 26. So, 197.18.0.0 with a mask of 255.255.255.192 would be 197.18.0.0/26.

Ron Maupin
  • 102,040
  • 26
  • 123
  • 202