Quoting Michael J. McGillick ([EMAIL PROTECTED]):

> I'm trying to understand how netmasks work.  We want to set up a small
> pool of IP Addresses, and the only thing we can do is specify the network
> and the netmask.  They want the pool to start at 192.168.1.85, and have 5
> usuable IP Addresses.  What do I specify for the netmask, and more
> importantly, why?  I understand about setting up a network range, when the
> network is specified at 0, but this 80 is throwing off my thinking.

Netmasks are probably easiest to handle if you think of IP addresses
as 32-bit values rather than dotted quads, especially when you're dealing
with sub/super-nets.  I'll ignore non-contiguous netmasks, because they're
not really relevant here.  This means that any subnet must contain a
number of addresses equivalent to some power of two.  It also means that
the lower boundary of each subnet (ie the network address) must be some
multiple of the size of the subnet.  This just falls out of the way the
netmask works.

In your example, you can't have a subnet starting at 192.168.1.85.  If
you want a minimum-size subnet for five real hosts, you need an
eight-address subnet (2^3).  This would have to start at either
192.168.1.80 or 192.168.88 (both being multiples of 8; though this is
clearer if you write them in binary).  The netmask must be sufficent that
to give an eight-address subnet (ie three bits for the host mask) and
must therefore be 29 bits long.  Converting that back from binary to
dotted quad gives you 255.255.255.248.  If you chose 192.168.1.80 as
your network address that would give you six usable IP addresses from
192.168.1.81 to 192.168.1.86 and a broadcast address of 192.168.1.87.

The problem with dotted-quad notation is that people get so used to it
they end up believing it defines the way the network works, when really
it's just a convenient representation.  If you stop thinking in terms of
dotted quads and class A/B/C, preferring instead to consider addresses
as a 32-bit integer and a netmask as something that gets ANDed with it,
things do become a great deal more simple.

James.
-- 
 "Yield to temptation --             | Consultancy: [EMAIL PROTECTED] 
  it may not pass your way again"    | http://www.cloud9.co.uk/james
                                     |
        - Lazarus Long               |              James Fidell


-- 
To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe"
as the Subject.

Reply via email to