On Thu, 6 Jun 2002, Liam Bedford wrote:
> On Wed, 5 Jun 2002 21:52:35 +0100
> Conor Daly <conor.daly at oceanfree.net> blurted in message
>20020605215235.A20322 at Hobbiton.cod.ie:
>> > Um, so what's the netmask for a subnet of 192.168.0.8 broadcast
> > 192.168.0.15 ?
> >
> > And why?
> >
> the netmask stays the same, no matter what the network is. So if it's a
> network of 8 hosts, it will be 256 - 8 = 248 = /29 as kirk mentioned.
>> the confusing one is when it's something like 172.16.0.0/12, which covers
> more than one number in the second position (I'm making no sense :)). It
> goes from 172.16.0.0 to 172.31.255.255 (thanks Colm).
In this case I mentally shift the bits to the right and do the normal
calcuation then subtract.
ie. 172.16.0.0/12 the 12 is in the 2nd octet so I add 16 bits = 28
then I perform the subnetting as in the previous email
32-28 = 4 bits 2^4 = 16 - so a new subnet every 16
so this subnet is 0-15, 16-31,32-47, etc....
then I just left shift again and subtract the 16
so, the subnet mask would be 256-16 = 240 == 255.240.0.0
so the subnet is 172.16.0.0/12 == 172.16.0.0 255.240.0.0
hope this helps and makes sense.
-kirk
>> L.
>
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!