lkml.org 
[lkml]   [1997]   [Jan]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Is netmask 255.255.255.254 illigal?
On Sun, 12 Jan 1997, Richard B. Johnson wrote:

> > ifconfig eth0 206.42.0.97 netmask 255.255.255.254 broadcast 206.42.0.255
> >
> > works fine.
> >
> > kernel 2.1.20
> >
> > ifconfig eth0 206.42.0.97 netmask 255.255.255.254 broadcast 206.42.0.255
> > SIOCSIFNETMASK: Invalid argument

> Depending upon your network (A, B, C, etc.) Your netmask would probably
> be 255.255.255.0
> 255.255.248.0 ... etc. I don't think the last byte would ever be anything
> but "0" unless you "own" a very small piece of the address. You want your
> address "97" to fit into the mask, i.e., 0 to 97 inverted.

There are quite a lot of cases when you might not want a full class-C
network. Something like 255.255.255.192 is a perfectly valid subnet mask.
In this case the last octet is both the `host number' _and_ a couple of
bits of the subnet mask, so 97 doesn't have to "fit in" to it.

255.255.255.254 is bogus though. You can't give _all_ your bits over to
the network number. 255.255.255.240 is probably about the smallest
network that's likely to be useful.

> The kernel is now being "pickey" and actually checking these things. Try
> 255.255.255.0 even though you might not "own" 255 addresses. Just don't
> use the ones you don't own.

No. It's BAD BAD BAD<tm> to get your netmask wrong, particularly if you
give it fewer bits than it needs. In that situation, any hosts that are
'local' according to your netmask but distant in reality will be
unreachable.

phil


\
 
 \ /
  Last update: 2005-03-22 13:38    [W:1.491 / U:0.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site