This is Info file nwf.info, produced by Makeinfo-1.55 from the input
file nwf.ti.

This file documents the setup of networking with NetBSD-Amiga.

Copyright (C) 1994 Hubert Feyrer.


File: nwf.info,  Node: e_netstart,  Next: e_rc,  Prev: UseOnEtc,  Up: UseOnEtc

`/etc/netstart'
---------------

     #!/bin/sh -
     #
     #       @(#)netstart   5.9 (Berkeley) 3/30/91
     #       $Id: netstart,v 1.15 1994/01/10 16:57:24 mycroft Exp $
     
     # 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':

   * `NO': no need for routed if you're hooked up via SLIP or PPP.

   * `"-q"': Useful if you've got a Ethernet-card and you are hooked
       up to a non-trivial network (i.e. there's at least one gateway,
     ...)

   * `""': Use this if your machine's a gateway itself.

     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 for
remote boot of diskless clients. 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!!!

     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 CIA-timer-inaccuracy in NetBSD-Amiga (744).

     # set the following to "YES" to turn them on, "NO" to disable.
     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.

     nfs_server=YES

This is useful 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.

     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.

     name_server=NO

Leave at `"NO"' unless you know how to set up your own nameserver. See
[CraigHunt] for details.

     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.

     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
     # gated_flags only used if gated == YES
     gated_flags=

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

     # /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/YP, 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" ]; 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':
          inet <hostname> <netmask> <broadcast>
          dest

SLIP:
     Put the following into `/etc/hostname.sl0':
          inet <local-hostname> <netmask> <broadcast>
          dest <remote-hostname>

PPP
     Put the following into `/etc/hostname.ppp0':
          inet <local-hostname> <netmask> <broadcast>
          dest <remote-hostname>

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, 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.


File: nwf.info,  Node: e_rc,  Next: e_rclocal,  Prev: e_netstart,  Up: UseOnEtc

`/etc/rc'
---------

There's only NIS left, for which there isn't a flag yet:

     if [ -f /usr/sbin/ypbind -a -d /var/yp ]; then
             echo -n ' ypbind';              ypbind
     fi

This is only started if the directory `/var/yp' exists. As there need
to be several config- and datafiles in this directory in order to have a
working NIS, be sure that you know what you do when creating `/var/yp'.


File: nwf.info,  Node: e_rclocal,  Next: Advanced,  Prev: e_rc,  Up: UseOnEtc

`/etc/rc.local'
---------------

Besides starting local daemons, `/etc/rc.local' is useful for either
starting `pppd' or `slattach'. In order to not block any
networking-services that are also started in `/etc/rc.local', the
corresponding command should occur quite early, best place is after
`/etc/motd' is generated.

Configure `/etc/hostname.ppp0' or `/etc/hostname.sl0' and `/etc/mygate'
as described above. Also, change the baudrate to fit your needs.

SLIP:
     In order to start up SLIP at boottime, insert the following lines
     into  `/etc/rc.local':

          # Start SLIP-networking
          echo -n 'Preparing SLIP-interface ... '
          slattach 9600 /dev/tty00 >/dev/null 2>&1
          echo -n 'ready.'

PPP:
     This should work, although I've never tried it:

          # Start PPP-networking
          echo -n 'Preparing PPP-interface ... '
          pppd /dev/tty00 9600
          echo -n 'ready.'

     The big problem that stays with PPP is that you've to start it up
     on  the other side at (exactly) the same time, and there must no
     timeout  occur in order to get a connection. Use SLIP if this is a
     problem.

Note that there's barely a way to dial out during boot-time, so the
above mainly belongs to direct (nullmodem) connections.


File: nwf.info,  Node: Advanced,  Next: FTP,  Prev: e_rclocal,  Up: Top

Advanced features and how to set them up
****************************************

I'd like to explain how to set up the following services here:

* Menu:

* FTP::              Anonymous File Transfer Protocol (FTP).
* NFS::              Network File System (NFS).
* rTools::           The Berkeley r-tools.
* X11::              The X Window System.
* DNS::              The Domain Name Service (DNS).
* Mail::             Electronic Mail.
* RemPrint::         Remote printing.


File: nwf.info,  Node: FTP,  Next: NFS,  Prev: Advanced,  Up: Advanced

Anonymous FTP server
====================

Read `ftpd'(8).


File: nwf.info,  Node: NFS,  Next: NFSmount,  Prev: FTP,  Up: Advanced

Network File System (NFS)
=========================

Sun's Network File System (NFS) has become a standard for using remote
disks not only in the Unix- but in the whole TCP/IP-world. The idea is
quite simple: one host "exports" a directory, and other hosts can mount
that directory and access it and its subdirectories.

When users from several machines want to use the same set of files,
special care has to be taken for the user-ids and group-ids the files
have: UID and GID of the users must be unique across the (NFS-)network,
or one won't be able to read a file on one machine created on another
one (where the same user had a different UID).

There are also some security-mechanisms built in to prevent unauthorized
machines from mounting directories or which prevent root-access to files
from remote machines. I won't introduce those mechanisms here and I'll
assume no special measures for mounting/exporting filesystems here. If
you need to know about those mechanisms, please read `mount'(8),
`exports'(5).

See RFC 1094 for a description of NFS.

* Menu:

* NFSmount::          Mounting remote filesystems.
* NFSexport::         Exporting filesystems.


File: nwf.info,  Node: NFSmount,  Next: NFSexport,  Prev: NFS,  Up: NFS

Mounting remote filesystems
---------------------------

Mounting a directory from a remote host is pretty simple. All you have
to know is the host's name (`remote-host'), the directory exported by
the remote host (`remote-dir') and the directory from which you want to
access those files (`local-dir', must be absolute!).

All you have to do then is:

     # mount <remote-host>:<remote-dir> <local-dir>

To make the same mount permanent, put the following line into
`/etc/fstab' (See `mount'(8) for a description of all those options:
`rw,soft,...'):

     <remote-host>:<remote-dir>  <local-dir>  nfs  rw,soft,bg,retry=4  0  0

Here's an example I use on DUSK: How to mount
`/usr/aftp/pub/os/NetBSD/NetBSD-Amiga' from ftp.uni-regensburg.de
(which is only an alias for the rrzs3) on DUSKs
`/usr/ftp/pub/NetBSD-Amiga'. This can be done by issuing `mount
ftp.uni-regensburg.de:/usr/aftp/pub/os/NetBSD/NetBSD-Amiga
/usr/ftp/pub/NetBSD-Amiga' or putting the following line into
`/etc/fstab':

     rrzs3:/usr/aftp/pub/os/NetBSD/NetBSD-Amiga /usr/ftp/pub/NetBSD-Amiga nfs
                                                          rw,soft,bg,retry=4 0 0

(This line is split only to fit on the page. Put this all in one line!)


File: nwf.info,  Node: NFSexport,  Next: rTools,  Prev: NFSmount,  Up: NFS

Exporting filesystems
---------------------

To mount a directory from a remote host, the host has to export that
directory via NFS. To do this, put the directorys name into
`/etc/exports' on the remote host. Then issue `showmount -e 127.0.0.1'
to (re-)read `/etc/exports' and actually export that filesystem. Also,
this command will show you all the directories you currently export.

Here's what FTP.UNI-REGENSBURG.DE's `/etc/exports' looks like to give
DUSK (and everyone else) access to `/usr/aftp/pub/NetBSD-Amiga':

     /usr/aftp/pub -rw=dusk.rz.uni-regensburg.de,root=dusk.rz.uni-regensburg.de

Again, there are a number of options to restrict access. Please refer to
`export'(5) for documentation.


File: nwf.info,  Node: rTools,  Next: rreq,  Prev: NFSexport,  Up: Advanced

Berkeley r-tools
================

The university of Berkeley has developped its own set of networking
applications, of which the most important are:

`rlogin':
     Interactive login into remote host, similar to  `telnet'.

`rsh':
     Execute command on remote host. Stdin is read from the  local
     stdin, stdout and stderr of the remote command  are returnet to
     the local host.

`rcp':
     Copy file from local to remote machine or vice  versa. The
     difference to `ftp' is that `rcp'  is not used interactively but
     via commandline-arguments  similar to the `cp'-command.

There are several prerequirements and security-issues to be paid
attention when using the Berkeley R-Tools.

* Menu:

* rreq::              Prerequirements/Security.


File: nwf.info,  Node: rreq,  Next: X11,  Prev: rTools,  Up: rTools

Prerequirements/Security
------------------------

All the r-tools are based on the concept of trusted hosts and users,
i.e. on one host, you say which user(s) from what host(s) you allow to
access a specific account. There are two places where this information
is kept:

   * `/etc/hosts.equiv':  Systemwide information, should be either
     removed or  zero-length (`cp /dev/null /etc/hosts.equiv') as this
     file is mostly a big security hole.

   * `~/.rhosts':  This file contains information on which users and
     hosts to  allow to login or execute commands (via `rsh').   If
     you're really upset about your system's security, keep your  users
     from having such files.

Both files contain pairs of *host*-*user*-combinations, where *host* is
the host that users are allowed to log in from, and *user* tells
*which* user is actually allowed to log in from that host (to that
specific account, in the case of `~/.rhosts'.

Example! I've got an account "`c9020'" on RRZSG1.RZ.UNI-REGENSBURG.DE.
When I want to login into hubert's account on DUSK without giving a
password, I've got to put the following into hubert's `~/.rhosts':

     rrzsg1.rz.uni-regensburg.de c9020

If you've trouble what to take as hostname (i.e., with or without
domain, or even IP-number), login (probably *with* giving a password),
then start `who'. This will tell you the hostname you've to put into
your `~/.rhosts':

     dusk% who
     hubert   ttyp0   Mar 21 13:59   (rrzsg1.rz.uni-reg)

This shows that I have to use *rrzsg1.rz.uni-regensburg.de* as hostname.


File: nwf.info,  Node: X11,  Next: DNS,  Prev: rreq,  Up: Advanced

X11
===

The most common question concerning networking and X is "How far do I
have to start networking to be able to work with X?".

Well, it should be sufficient to configure the loopback-device
properly. As this is done by default, there should be no
network-problems with X.

Tell me if this is wrong!


File: nwf.info,  Node: DNS,  Next: Mail,  Prev: X11,  Up: Advanced

Domain Name Server (DNS)
========================

See RFCs 1032 and 1033 for guides on operation and domain
administration.

See also [CraigHunt] for a detailed description.


File: nwf.info,  Node: Mail,  Next: RemPrint,  Prev: DNS,  Up: Advanced

Mail
====

In order to set up electronic mail, there are several steps to be
performed:

  1. Set `sendmail_flags' to `-bd -q30m' in `/etc/netstart'.
     This tells sendmail to start as a daemon (`-bd') and scan the
     queues for mail every 30 minutes (`-q30m').

  2. Get a `/etc/sendmail.cf', e.g. from sun-lamp or one of its mirrors.

  3. Ask your DNS-admin for an MX-entry on your host and -- if your
     machine's       not always on the net -- also one on a machine
     which stores your mail       while your machine's down and
     forwards it later.

Most of the time, sending mail is no problem, but receiving is. So, if
you experience any problems, consult your local postmaster!


File: nwf.info,  Node: RemPrint,  Next: FAQs,  Prev: Mail,  Up: Advanced

Remote Printing
===============

This is a topic which I haven't tried out yet, but which I'd really
like to see here. If anyone has detailed information about

  1. using a remote printer

  2. offering print services

please tell me and I'll insert it here!


File: nwf.info,  Node: FAQs,  Next: Abbrevs,  Prev: RemPrint,  Up: Top

FAQs
****

How do I set up networking?
===========================

Read the "NetBSD-Amiga Beginners Guide to Networking and
Networking-FAQ".

I've choosen two IP-numbers, 1.1.1.1 and 2.2.2.2, but nothing works!
====================================================================

These two numbers are in different subnets, so you either have to

   * set up routing propperly for them to work, or

   * choose numbers which are in the same subnet.        *Note TCP/IP
     address format: AddressFormat.

Netstat doesn't output anything
===============================

Please ensure that the running Kernal is the same as `/vmunix'.

I can't get `vmunix.613' to work with my Ethernet-board
=======================================================

Ethernet-support was first introduced in 622, so you've to update your
kernel and some of the networking-programs.

The system hangs when going into multiuser-mode
===============================================

Set `name_server=NO' in `/etc/netstart' or set up your
`/etc/resolv.conf' properly to get access to the DNS.

`timed' and `routed' report some errors. Should I comment them out, too?
========================================================================

You can if you want, although those don't disturb the rest of the
system, they may just fail, but so what. The corresponding flags in
`/etc/netstart' are:

   * routed_flags (set to NO to disable)

   * timed_flags (set to NO to disable)

`xhost' says "must be on local host", but I'm already there!
============================================================

Try setting your `DISPLAY' to "`:0'". There seem to be some problems
when using "`localhost:0'" or "<nodename>`:0'".

`ifconfig' doesn't init my point-to-point-devices (SLIP/PPP) right
==================================================================

Try setting the remote IP-address as the very last argument at the
ifconfig-command. If you want this to run from
`/etc/netstart'/`/etc/hostname.*', please note the options' order given
in `/etc/netstart' and fix your `/etc/netstart', if necessary (*note
`/etc/netstart': e_netstart.).

What's the Major and Minor device numbers for the le0 device?
=============================================================

There's no `/dev/le0', and so you can't figure out any major/minor
number. If you want to check whether you've got an ethernet-driver in
you kernel, do `netstat -i' and watch out for `le0' there.


File: nwf.info,  Node: Abbrevs,  Next: References,  Prev: FAQs,  Up: Top

Abbreviations
*************

CSRG
     Computer Systems Research Group, core developers of BSD

DARPA
     Defense Advanced Research Projects Agency, sponsor for developing
     TCP/IP

DDN
     Data Defense Network

DNS
     Domain Name Service, method to map hostnames to IP-addresses and
     back

FTP
     File Transfer Protocol, program & TCP/IP-based protocol to transfer
     single files between machines.

ISO
     International Standard Organisation, defined networking-protocols
     such as X.25, X.400, X.500, ...

NFS
     Networking File System, gives transparent access to remote files

NIS
     Network Information Service, method to share one database (e. g.
     `passwd'-file) between several machines; former Yellow Pages  (YP)

PPP
     Point to Point Protocol, transports several protocols (TCP/IP,
     DECnet, ... over serial lines

RFC
     Request For Comment, open definition of internet standards

SLIP
     Serial Line IP, transports IP-packets over serial line

TCP/IP
     Transmission Control Protocol/Internet Protocol, most widespread
     networking protocol today

UCB
     University of California at Berkeley; origin of the BSD-Unix and
     NetBSD

X11
     Version 11 of the X-Window-System developped at MIT

YP
     Yellow Pages, see NIS; renamed after conflicts with british
     telecom.


File: nwf.info,  Node: References,  Prev: Abbrevs,  Up: Top

References
**********

[AeleenFrisch]
     Aeleen Frisch: "Essential System Administration", O'Reilly &
     Associates,  Sebastopol, 1991.

[CraigHunt]
     Craig Hunt: "TCP/IP Network Administration", O'Reilly & Associates,
     Sebastopol, 1993.

[Leffer]
     Samuel J. Leffer, Marshall Kirk McKusick, Michael J. Karels, John
     S. Quarterman: "The Design and Implementation of the 4.3BSD UNIX
     Operating System", Addison Wesley, Reading, 1989.

[RFC977]
     B. Kantor, P. Lapsley: "Network News Transfer Protocol", February
     1986, 27 pages.

[RFC1032]
     M. Stahl: "Domain administrators guide", November 1987, 14 pages.

[RFC1033]
     M. Lotter: "Domain administrators operations guide", November 1987,
     22 pages.

[RFC1034]
     P. Mockapetris: "Domain names - concepts and facilities", November
     1987, 55 pages.

[RFC1035]
     P. Mockapetris: "Domain names - implementation and specification",
     November 1987, 55 pages.

[RFC1055]
     J. Romkey: "Nonstandard for transmission of IP datagrams over
     serial  lines: SLIP", June 1988, 6 pages.

[RFC1094]
     Sun Microsystems, Inc.: "NFS: Network File System Protocol
     specification.", March 1989, 27 pages.

[RFC1331]
     W. Simpson: "The Point-to-Point Protocol (PPP) for the
     Transmission of  Multi-protocol Datagrams over Point-to-Point
     Links", May 1992, 66  pages.

[RFC1332]
     G. McGregor: "The PPP Internet Protocol Control Protocol (ICPC)",
     May  1992, 12 pages.


