On Sun, 07 Sep 2003 16:28:31 -0700, Siddharth Mathur wrote:
> Hello all,
>
> I run some hosts that span a rather strange range of IP addresses. I want to
> convert the range into CIDR notation so that I can add these hosts to my
> Linux hosts.allow/deny file.
>
> The Class B address range that I have been alotted for my LAN is
> p.q.r.120 to p.q.r.129
>
> As I understand I can split these 10 IPs into 2 groups for the sake on CIDR
> classification.
> p.q.r.120 -> p.q.r.127 can be represented as p.q.r.120/29
> and
> p.q.r.128 -> p.q.r.129 can be represented as p.q.r.128/31
Basically yes except you cannot have /31 as it would be a pointless range.
Remember each network (or subnet) MUST have a broadcast address and a
network address.. so in every network there are 2 ip addresses that cannot
be used for hosts. So in your above example you have lost 4 ip addresses
(the /31 would just be a broadcast and a network address so not terribly
useful).
Typically (as I understand it) the network address is the lowest possible
so p.q.r.120 is your network address and p.q.r.127 would be your broadcast
address.
> Can someone please comment if my understanding is correct. Is there any
> other clean way to add these range of IPs to my allow/deny file?
> Also I am not sure how to convert the range p.q.r.210 -> p.q.r.229 to CIDR
> notation.
from what I can tell that isn't a valid subnet range. A useful resource
I use is:
http://www.subnetonline.com/subcalc/subnet9.html
you can play to your hearts content and see how it all works and whats
valid etc
hope thats of some help
Graeme