Calculate CIDR given an IP address

1

I've been reading up on CIDR A lot today, and am curious to know, if you have a given ip address i.e. 192.50.50.1, can you determine what it's CIDR would be?

xpkiro

Posted 2015-10-09T21:13:52.967

Reputation: 138

Answers

5

No, you can not calculate it with just that information. But neither could you calculate it before CIDR.

A long long time ago

You got an IP address and you could look up if it was a class A, B,C etc etc by looking at the first few bits. E.g. 10.0.0.1 (or 00000110000000000000000000000001 would start with a leading 0, hence it belonged to a class A range. Knowing that you still would use a subnet mask to speed things up, rather than calculating it each and every time.

(Also see wikipedia on classful networks.)

Last few decades...

These days that is no longer possible. The range which used to belong to an old class A might have been chopped up in many smaller subnets. You will need to know which part is used as network and which indicates the rest. Either by looking at the network mask or at the /xx behind the network.

Neither of these can be calculated by just the IP. The person who gives you an IP (or an IP range) will also need to give you the network mask to use.

Hennes

Posted 2015-10-09T21:13:52.967

Reputation: 60 739