[ previous ] [ next ] [ threads ]
 
 From:  "Mike Maltese" <mike at pcmedx dot com>
 To:  "M0n0wall" <m0n0wall at lists dot m0n0 dot ch>
 Subject:  [m0n0wall] Re: Networking knowledge
 Date:  Mon, 8 Mar 2004 15:52:49 -0800
> You can see looking at this that the first 29 bits are turned on, so an
> address of 192.168.100.0/255.255.255.248 can also be expressed more
> simply as 192.168.100.0/29.
>
> The interesting side effect of all this is that you can take 32 and
> subtract the netmask bits to get the host bits.  In the above example,
> there are 3 host bits.  2 to the power of 3 is 8, meaning 8 host
> addresses.  It's really quite simple.  :)

Great explanations and examples. I just wanted to add something as a side
note.

Remember that you automatically lose two addresses right off the top, plus
one for the default gateway. The first number, 192.168.100.0 is the network
ID. You don't really lose this one because you never really had it to use,
but it is important nonetheless. Next, there is the broadcast address, which
is always the last possible address, 192.168.100.7 in this example.
Finally, there must be a default gateway for the subnet. Although it doesn't
have to be, this is traditionally the first assignable address, which would
be 192.168.100.1 in this case. While the default gateway is also a host, I
really don't consider it as usable when laying out a subnet. This leaves you
with a total of five usable host addresses for the 192.168.100.0/29 subnet,
192.168.100.2 through 6. This applies to any subnet regardless of it's size.
For example, a 192.168.0.0/24 can have a maximum of 253 hosts plus the
default gateway. Keep this in mind when deciding on a network/mask pair. As
another example, I use 192.168.240.240/28 for my home subnet because I may
need more than five but never more than 13 addresses.

Mike