On 10-May-2000 Richard June wrote:
> Just out of curiosity, the kernel apparently doens't set the broadcast
> address on a device according to the netmask of said device, i.e. ifconfig
> eth0 10.10.10.1 netmask 255.255.255.252 will assign the ip and netmask as
> specified, but will set broadcast to 10.255.255.255 even though(If I
> understand correctly) broadcast should be 10.10.10.3, am I off my rocker,
> or is this true? and if so, why does the kernel set netmask if not
> specified, but not figure out the broadcast?

This is correct behavior for kernel or ifconfig. Unspecified parameters are
set to some default values. In that case default values are for class A
address, and broadcast is 10.255.255.255
In the case when you don't specify netmask it will be 255.0.0.0 for class A
address space.

You must explicitly set broadcast address for variable subnet masks.

ifconfig tap0 10.10.10.1 netmask 255.255.255.252 broadcast 10.10.10.3

if you type only part of it, like you did:

ifconfig tap0 10.10.10.1 netmask 255.255.255.252

you will have results as you had.

if you type: ifconfig tap0 10.10.10.1
and then ifconfig tap0 you will get:

Link encap:Ethernet  HWaddr FE:FD:00:00:00:00  
inet addr:10.10.10.1  Bcast:10.255.255.255  Mask:255.0.0.0



----------------------------------
E-Mail: Milan P. Stanic <[EMAIL PROTECTED]>
Key fingerprint = EA81 54A6 7F35 5A38 FCE6  9EF6 9D24 E68E 5C1D AF15
----------------------------------
-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to [EMAIL PROTECTED]

Reply via email to