all zeroes/all ones used in host IP's...

H. Peter Anvin hpa en transmeta.com
Vie Ene 28 23:55:51 CST 2000


Followup to:  <Pine.LNX.4.10.10001281235040.818-100000 en asdf.capslock.lan>
By author:    "Mike A. Harris" <mharris en meteng.on.ca>
In newsgroup: linux.dev.kernel
>
> I interpret the above as meaning that it is not legal to have a
> network like this:
> 
> 192.168.0.0/24   or 23.0.0.0/24
> 
> with hosts 192.168.0.1 through 192.168.0.254 or with hosts
> 23.0.0.1 through 23.0.0.254.
> 
> The first zero makes it illegal no?  Could someone in the know
> please clarify this as it has been bugging me for some time and
> nobody else seems to be able to say with 100% certainty what the
> proper rule is.  Also, would a network like:
> 
> 142.255.255.0/24 be illegal?
> 
> Someone has suggested that my interpretation is wrong, and if
> that is indeed so, I'd like to know the proper interpretation and
> share it with everyone.
> 

You are, indeed, completely wrong.  There rules are that neither the
*entire* network portion or the *entire* host portion of the address
can be all 0 or all 1.

In other words:

   ip_addr & netmask  != 0
   ip_addr & netmask  != netmask
   ip_addr & ~netmask != 0
   ip_addr & ~netmask != ~netmask

    -hpa
-- 
<hpa en transmeta.com> at work, <hpa en zytor.com> in private!
"Unix gives you enough rope to shoot yourself in the foot."

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo en vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



Más información sobre la lista de distribución Ayuda