Re: [ILUG] Linux Certification Exam Question

From: Kirk Bollinger (kirk at domain thebollingers.net)
Date: Thu 06 Jun 2002 - 18:18:48 IST


On Thu, 6 Jun 2002, Liam Bedford wrote:

> On Wed, 5 Jun 2002 21:52:35 +0100
> Conor Daly <conor.daly at domain oceanfree.net> blurted in message
> 20020605215235.A20322 at domain 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.
>



This archive was generated by hypermail 2.1.6 : Thu 06 Feb 2003 - 13:17:08 GMT