[comp.unix.wizards] Setting netmask

VINCE%UCONNVM.BITNET@cunyvm.cuny.edu (11/26/88)

In trying to conect our Sun network to the outside world, we have run
into avery strange problem in trying to set the netmask.  Supposeddly
adding the netmask option to the ifconfig command in rc.boot will do
it.  In fact this works on the diskless clients (in fact one sees the
comforting message "Setting the netmask" during the boot process), but
it does not work on the file server, where the option seems to be ignored.
This leads to nasty consequenses for the clients, which can be corrected
by logging in as root (to the server of course) and typing the ifconfig
command with netmask option.  Something is clearly amiss, and we don't want
to have to type in this command after every boot.  What is the effective
way to set up the netmask.

***************** Long sigatures dont mix with slow tranmissions.
VINCE@UCONNVM.bitnet
Acknowledge-To: <VINCE@UCONNVM>

matt@oddjob.uchicago.edu (Matt Crawford) (11/26/88)

> In trying to conect our Sun network to the outside world, ...
> What is the effective way to set up the netmask?

What works here is, let the address be set in rc.boot with the standard

	/etc/ifconfig ie0 $hostname -trailers up

and put a line in rc.local to set the naetmask (and possibly the
broadcast address):

	/etc/ifconfig ie0 netmask 255.255.255.0 broadcast 128.135.0.0

				Matt

mike@istsists.ca (Mike Clarkson) (11/28/88)

In article <17644@adm.BRL.MIL>, VINCE%UCONNVM.BITNET@cunyvm.cuny.edu writes:
> In trying to conect our Sun network to the outside world, we have run
> into avery strange problem in trying to set the netmask.  Supposeddly
> adding the netmask option to the ifconfig command in rc.boot will do
> it.  In fact this works on the diskless clients (in fact one sees the
> comforting message "Setting the netmask" during the boot process), but
> it does not work on the file server, where the option seems to be ignored.

Perhaps people more knowledgable/intelligent than I can explain why, but 
my experience was that you have to rebuild the yellow pages master database
on your server.

ypinit -m

will do it.  It seems the yellow pages stashes a copy of the netmask
in some obscure and/or undocumented fashion.  Could someone explain this
or correct me if I'm wrong?

Mike.

-- 
Mike Clarkson					mike@ists.UUCP
Institute for Space and Terrestrial Science	mike@ists.yorku.ca
York University, North York, Ontario,		uunet!mnetor!yunexus!ists!mike
CANADA M3J 1P3					+1 (416) 736-5611

guy@auspex.UUCP (Guy Harris) (11/30/88)

>It seems the yellow pages stashes a copy of the netmask in some obscure
>and/or undocumented fashion.

Obscure, perhaps, but at least if you're running SunOS 4.0, not
undocumented; see NETMASKS(5).  I don't know whether, if earlier
releases had the "netmasks.byaddr" map, they had that man page or not.

lindberg@cs.chalmers.se (Gunnar Lindberg) (12/30/88)

In article <17644@adm.BRL.MIL>, VINCE%UCONNVM.BITNET@cunyvm.cuny.edu writes:
>...
>     In fact this works on the diskless clients (in fact one sees the
>comforting message "Setting the netmask" during the boot process), but
>it does not work on the file server, where the option seems to be
>ignored.

I guess this depends on what SunOS you run, but for 3.x (x >= 4) the
discless clients simply broadcast an "icmp(ICMP_MASKREQ)" on the net
and use the first reply. File servers don't - instead they depend on
"ifconfig" to explicitly set the mask.

The idea of using broadcast has a few disadvantages:

    1)	You may get bad answers (wrong byte order) e.g. from VAXen.
	This was fixed in 3.4.2.

    2)	If the network is large, many hosts may try to answer, which
	gives quite a peak in network traffic (first one ARP for
	each reply, than the reply itself). This was discussed in
	"comp.sys.sun" a while ago.

		Gunnar Lindberg