View Single Post
Old 2008-10-24, 10:09 PM   #2
cd34
a.k.a. Sparky
 
cd34's Avatar
 
Join Date: Sep 2004
Location: West Palm Beach, FL, USA
Posts: 2,396
Quote:
Originally Posted by Doug E View Post
range examples...

61.14.41.136 61.14.41.143
61.14.132.32 61.14.132.95
61.14.132.128 61.14.132.255
61.14.133.32 61.14.133.47
Well, the first thing you would need to do is to find the netblocks that are associated with each one.

The first one consists of 8 addresses, which is a /29

61.14.41.136/29 is that netblock

The second one is not truly on a valid netblock boundary, but, I believe apache will still parse it properly. Since it is 64 IPs,

61.14.132.32/26 would match that netblock

61.14.132.128/25 covers that block.

61.14.133.32/28 covers the last block.

Its all CIDR math. So, the simple conversion is to take the size of the block, i.e. 16 IPs, which is 2**4. 32-4 = 28, which is your CIDR subnet.

So, if you take your list, figure out the number of IPs in the range, and determine the CIDR netmask, you can convert it to the CIDR notation, and append it to the starting IP in the block.
__________________
SnapReplay.com a different way to share photos - iPhone & Android
cd34 is offline   Reply With Quote