NetBSD rules - Go to the first, previous, next, last, above section, table of contents.

3.5.1 `/etc/netstart'

#!/bin/sh -
#
#	$NetBSD: netstart,v 1.23 1995/12/30 01:30:03 thorpej Exp $
#	@(#)netstart	5.9 (Berkeley) 3/30/91

# set these to "NO" to turn them off.  otherwise, they're used as flags
routed_flags=NO         # for 'normal' use: routed_flags=-q

As stated before, the following rules apply to routed_flags:

mrouted_flags=NO	# for 'normal' use: mrouted_flags=""

If you have set up multicast routing in your network, set this to "". Be sure to read mouted(8) before!

rarpd_flags=NO          # for 'normal' use: rarpd_flags="-a"

If you want to become a RARP-server (Reverse Address Resolution Protocol, converts Ethernet- to IP-addresses; see RFC903), enable this. Do this only if you know what you do, and read rarpd(8) before!

bootparamd_flags=NO     # for 'normal' use: bootparamd_flags=""

Set this to "" to run the bootparamd-RPC-service which is needed by diskless clients to boot via net.. Do this only if you know what you do, and read rpc.bootparamd(8) before!!!

sendmail_flags=NO       # for 'normal' use: sendmail_flags="-bd -q30m"

If you want to send and receive mail, you'll need to set this to "-bd -q30m" or any appropriate settings that fit your needs. You will also need a properly configured `/etc/sendmail.cf' for this to run.

Warning! If you're not on your own network, please consult your postmaster before doing anything fatal. It's very easy to produce mailloops etc. which can blow your whole site's mailsystem!!!

named_flags=NO		# for 'normal' use: named_flags="" 

This flag is used in deciding whether to start a local nameserver. Leave at NO unless you know what you're doing. See [CraigHunt] and [AlbitzLiu] for details.

timed_flags=NO

Leave this at "NO", it doesn't help anyway.

The timed is thought to keep all the clocks on a network in sync, but it doesn't help with that slight CIA-timer-inaccuracy in NetBSD/amiga. Use rdate instead to solve this problem.

# set the following to "YES" to turn them on
rwhod=NO

Set this to NO. rwhod is good for burning quite some CPU-cycles to tell other hosts on your network who's logged on. Set to "YES" if you want to be able to use rwho anyway, and create the directory `/var/rwho'.

nfs_server=YES

This is needed if you've got some directories to export to other machines via NFS. If you do so, set it to YES. If you want to mount your own disks via NFS (which is quite nonsense, but nevertheless possible), do so, too.

Set it to NO otherwise. E.g. it's definitely no fun to do NFS-mounts via a SLIP- or PPP-link, as this will be dead slow.

See exports(5) on how to export filesystems.

nfs_client=YES

If there's a host on your network which disks you want to use or you want to mount your own disks (see above), set this to YES. Set to NO otherwise.

gated=NO

Leave at "NO". This is a replacement for routed which is only useful in very complex network-setups, e. g. if you need to set up wide-area networking (WAN).

kerberos_server=NO

I've never used this, so you can most probably live without it, too. Set to YES if your site depends on Kerberos-security (and after contacting your local admin).

amd=NO

If you're a NFS-client and don't want to mount all the remote disks all the time, you can mount them "on demand" using the Auto Mount Daemon amd.

If you want to use this, read amd's man-page.

# miscellaneous other flags
# only used if the appropriate server is marked YES above
gated_flags=

If you need to use gated, put the appropriate flags for it to run here.

amd_dir=/tmp_mnt		# AMD's mount directory
amd_master=/etc/amd/master	# AMD 'master' map

If you intend to run amd, here's the place to set some central parameters. The first, amd_dir, tells under which directory temporary mounts are being made. This directory must exist before first use!

The second line, amd_master, gives the full path of the amd master configuration file. See section 4.8 Setting up `/net' with amd for an example of such a file.

# /etc/myname contains my symbolic name
#
hostname=`cat /etc/myname`
hostname $hostname

Put your host's name without domain into `/etc/myname', e.g. echo dusk >/etc/myname

if [ -f /etc/defaultdomain ]; then
        domainname `cat /etc/defaultdomain`
fi

This is only used by NIS, so if you're about to use NIS, put the name of your NIS-domain into `/etc/defaultdomain', e.g. echo nis1.rz.uni-regensburg.de >/etc/defaultdomain.

Beware! The domainname used here has nothing to do with the domain introduced by the domain name service (DNS)!

# configure all of the interfaces which we know about.
# do this by reading /etc/hostname.* files, where * is the name
# of a given interface.
#
# these files are formatted like the following, but with no # at the
# beginning of the line
#
# addr_family hostname netmask broadcast_addr options
# dest dest_addr
#
# addr_family is the address family of the interface, generally inet
# hostname is the host name that belongs to the interface, in /etc/hosts.
# netmask is the network mask for the interface.
# broadcast_addr is the broadcast address for the interface
# options are misc. options to ifconfig for the interface.
#
# dest is simply the string "dest" (no quotes, though) if the interface
# has a "destination" (i.e. it's a point-to-point link, like SLIP).
# dest_addr is the hostname of the other end of the link, in /etc/hosts
#
# the only required contents of the file are the addr_family field
# and the hostname.

(
    tmp="$IFS"
    IFS="$IFS."
    set -- `echo /etc/hostname*`
    IFS=$tmp
    unset tmp

    while [ $# -ge 2 ] ; do
        shift            # get rid of "hostname"
        (
            read af name mask bcaddr extras
            read dt dtaddr 

            if [ ! -n "$name" ]; then
                echo "/etc/hostname.$1: invalid network configuration file"
                exit
            fi

            cmd="ifconfig $1 $af $name "
            if [ -n "$mask" ]; then cmd="$cmd netmask $mask"; fi
	    if [ -n "$bcaddr" -a "X$bcaddr" != "XNONE" ]; then
		cmd="$cmd broadcast $bcaddr";
	    fi
            cmd="$cmd $extras"
            if [ "${dt}" = "dest" ]; then cmd="$cmd $dtaddr"; fi

            $cmd
        ) < /etc/hostname.$1
        shift
    done
)

First, please note that the order of arguments of the ifconfig-command, which are built here, might be different in your `/etc/netstart'. Put them in the above order (using your favourite editor), paying special attention that the destination-address (if any) is the last option to the ifconfig-command, after those extra-options!!!

Here's what diff says:

*** /usr/src/current/etc/netstart       Thu Feb  3 20:35:52 1994
--- /etc/netstart       Mon Mar 14 12:27:35 1994
***************
*** 73,83 ****
              fi

            cmd="ifconfig $1 $af $name "
-           if [ "${dt}" = "dest" ]; then cmd="$cmd $dtaddr"; fi
            if [ -n "$mask" ]; then cmd="$cmd netmask $mask"; fi
            if [ -n "$bcaddr" ]; then cmd="$cmd broadcast $bcaddr"; fi
            cmd="$cmd $extras"
--- 73,84 ----
            if [ -n "$mask" ]; then cmd="$cmd netmask $mask"; fi
            if [ -n "$bcaddr" ]; then cmd="$cmd broadcast $bcaddr"; fi
            cmd="$cmd $extras"
+           if [ "${dt}" = "dest" ]; then cmd="$cmd $dtaddr"; fi

            $cmd
          ) < /etc/hostname.$1

After that, create appropriate files `/etc/hostname.*', which describe your network-device(s):

Ethernet:
Put the following into `/etc/hostname.le0' (or .ed0, .ae0, etc., according to your card. See section 3.2.1 Configuring your ethernet-board):
inet <hostname> <netmask> <broadcast>
Arcnet:
The contents of `/etc/hostname.bah0' are basically the same for Arcnet as for Ethernet:
inet <hostname> <netmask> <broadcast>
SLIP:
Put the following into `/etc/hostname.sl0':
inet <local-hostname> <netmask> <broadcast>
dest <remote-hostname>
Please note that you don't need this file if you make SLIP-connects via bsddip.
PPP
Put the following into `/etc/hostname.ppp0':
inet <local-hostname> <netmask> <broadcast>
dest <remote-hostname>
Please note that you don't need this file if you make PPP-connects via pppd/chat.

Note also that both, the local and the remote host together with their IP-numbers must be in `/etc/hosts', as the resolver and default-router are not known at that time (and which you need to use the DNS).

# set the address for the loopback interface
ifconfig lo0 inet localhost

# use loopback, not the wire
route add $hostname localhost

As the comments say, this configures the loopback-device (127.0.0.1, localhost), so don't forget this in `/etc/hosts'. Furthermore, packets which are sent to $hostname will go to straight back instead of using any Ethernet, Arcnet, PPP- or SLIP-device.

# /etc/mygate, if it exists, contains the name of my gateway host
# that name must be in /etc/hosts.
if [ -f /etc/mygate ]; then
        route add default `cat /etc/mygate`
fi

If you're on a subnetted network, here's the chance to set up your default-router when booting up: just put it's name into `/etc/mygate'. For example, on DUSK (see Picture 1) I did echo 132.199.15.1 >/etc/mygate.

Note that you can use a hostname here, but it has to be in `/etc/hosts', as the nameserver is most probably not in your subnet and thus wouldn't be reachable at boottime to resolve the router's name.

# /etc/ifaliases, if it exists, contains the names of additional IP
# addresses for each interface. It is formatted as a series of lines
# that contain
# address interface
if [ -f /etc/ifaliases ]; then
(
    set -- `cat /etc/ifaliases`

    while [ $# -ge 2 ] ; do
	ifconfig $2 inet alias $1
	route add $1 localhost
        shift 2
    done
 )
fi

I haven't mentioned this so far, but one of NetBSD's specialities is to assign more than one IP-number to a networking interface, which might be of interrest e.g. if you want to set up several (virtual) WWW-servers on one machine. You then assign one IP-number to WWW.FOO.COM and another IP-number to WWW.BAR.COM, then all you have to do is to configure your networking interface for these two IP-numbers, set up the appropriate web-server (at least Apache and Spinner support this), and there you go. :)

If your networking device for the aboce case was your A2065 ethernet card, put the following in `/etc/ifaliases':

www.foo.com     le0
www.bar.com     le0

You'll have to have the hostnames you assign in `/etc/hosts' for this to work, unless you specify them as IP-numbers, which will work just as fine.


NetBSD rules - Go to the first, previous, next, last, above section, table of contents.