Saturday, June 01, 2019

How To Calculate How Many Smaller IP Ranges Can Be Gotten From a Bigger IP Range

This post is about how to calculate how many smaller IP range are there in a bigger IP range. It is part of series of posts on Tips to Quickly Perform Binary and CIDR Operations.

How many smaller IP ranges can be gotten from a bigger IP range


Task:
You have a big IP range, and you want to break it into smaller IP range, and you want to know how many of those smaller IP range you will end up with. For example, having a /22, how many /25 are in a /22

Steps to answer:
  • Subtract the ranges.
  • Calculate 2 raised to the power of the value above.
  • The number in the previous step will be the amount of the smaller range in the big range

Example:
How much /25 are in /22?
  • 25 - 22 = 3
  • 2 raised to power 3 = 8
  • There are 8 /25 in /22


Previous post: How To Quickly Tell The First And Last IP In a CIDR Range
Next post: How to tell if two IP ranges are adjacent

No comments: