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: Top,  Next: Preface,  Prev: (dir),  Up: (dir)

nwf
***

This info-file contains the NetBSD-Amiga Beginner's Guide to TCP/IP
Networking and Networking-FAQ. This guide has been devided into several
parts with each one having a somewhat different goal in mind.

* Menu:

* Preface::          Miscellaneous about this text.

* Theory::           Theoretical introduction to most basic concepts.
* Practice::         Applying the theory to NetBSD-Amiga
* Advanced::         Some advanced features and how to set them up.

* FAQs::             The *real* Networking-FAQ :-)

Appendices:
* Abbrevs::          A List of all the abbreviations used in the text.
* References::       Some useful texts & books.


File: nwf.info,  Node: Preface,  Next: WarmWords,  Prev: Top,  Up: Top

Preface
*******

This guide was written to describe how TCP/IP networking is set up on an
Amiga running NetBSD, a flavour of Unix. Therefore, whenever I mention
Unix or NetBSD, NetBSD-Amiga is meant, if not otherwise stated.

* Menu:

* WarmWords::        Some warm words about the intention of the author and
                     the prerequirements the reader needs.
* Disclaimer::       Legal mumbo-jumbo.
* AboutAuthor::      How to reach the author.


File: nwf.info,  Node: WarmWords,  Next: Disclaimer,  Prev: Preface,  Up: Preface

Some warm words
===============

This summary is intended to help people with little knowledge about
networks to participate in that game. The reader is assumed to know
about basic system administration tasks: how to become root, edit
files, change permissions, stop processes, etc. See [AeleenFrisch] for
further information on this topic.

Besides that, you should know how to handle the utilities we're going to
set up here, i. e. you should know how to use telnet, FTP, ... I will
not explain the basic features of those utilities, please refer to the
appropriate man-pages or to the references listed instead.

This guide is devided into four chapters In the first one I'll try to
introduce all the basic concepts which will be needed throughout the
whole guide.  The second chapter shows the most basic steps to set up
networking in practice, while chapter three explains how to set up some
common network services.  The last chapter lists some frequently asked
questions (FAQs) and answers to them.

I write this guide with the intention in mind to give the unweary some
basic knowledge. If you really want to know what's it all about, read
[CraigHunt]. This book does not only cover the basics, but goes on and
explains all the concepts, services and how to set them up in detail.
It's great, I love it! :-)


File: nwf.info,  Node: Disclaimer,  Next: AboutAuthor,  Prev: WarmWords,  Up: Preface

Disclaimer
==========

I hereby refuse to take any responsibility for any mistakes and wrong
information that is contained within this document.

Any reprint is allowed, as long as the origin of the information and the
author's name (mine :-) is stated. I'd like to get one issue then.

Further distribution of this text is allowed as long as it remains
unchanged.

I'd also like to be informed if this is to be included on any PD-disks
or CD-ROM-distributions.

Furthermore, I'd be glad to hear any comments (good & bad) about this
guide. Please (e)mail me!


File: nwf.info,  Node: AboutAuthor,  Next: Theory,  Prev: Disclaimer,  Up: Preface

About the author
================

SMail:
     Hubert Feyrer
     Bachstr. 40
     84066 Mallersdorf
Phone:
     +49 (0)941 / 943-2415 (Work, best chances on weekdays)
     +49 (0)941 / 701788 (Home on weekday's, rarely)
     +49 (0)8772 / 6084 (Weekends)
EMail:
     `hubert.feyrer@rz.uni-regensburg.de'


File: nwf.info,  Node: Theory,  Next: Protocols,  Prev: AboutAuthor,  Up: Top

Theory
******

In this first section, I'd like to give you some technical background
and explain all the concepts, before actually starting to set up
anything.

* Menu:

* Protocols::        The protocols supported by NetBSD.
* AddressFormat::    TCP/IP address format.
* SubnetRouting::    Subnetting and Routing.
* t_NSConcepts::     Name service concepts.


File: nwf.info,  Node: Protocols,  Next: IPoverSer,  Prev: Theory,  Up: Theory

Protocols supported by NetBSD
=============================

There are several protocol suites supported by NetBSD. The first one
implemented was DARPA's Transmission Control Protocoll/Internet
Protocoll (TCP/IP). Shortly afterwards, the Xerox Network System (XNS)
was added.  The last protocol suites -- parts of them still being
implemented -- are the ISO protocol suite, CCITT X.25 and ARGO TP.

Today, TCP/IP is the most widespread of the above. It's implemented on
almost any hardware and operating system and it is also the most-used
protocol in heterogenous environments. So, if you just want to connect
your Amiga running NetBSD to some other machine at home, or you want to
integrate it into your company's or university's network, TCP/IP is
most probably the right choice.

The Xerox Network System was only implemented at UCB to connect isolated
machines to the net, and the ISO-protocols are by far not as widespread
as TCP/IP, also their popularity grows.

However, there are no such things as DECnet and Novell's NetWare for
NetBSD-Amiga, though! These two protocols differ from the protocols
mentioned above in that they are proprietary, in contrast to the
others, which are well-defined in several RFCs and other open standards.

* Menu:

* IPoverSer::        Little issue on IP over serial lines.


File: nwf.info,  Node: IPoverSer,  Next: AddressFormat,  Prev: Protocols,  Up: Protocols

IP over serial lines
--------------------

TCP/IP can be used on a wide range of media, NetBSD-Amiga supports
Ethernet and serial lines. There are three reasons for using a serial
line protocol in preference to ethernet:

   * It's almost impossible to get a A2065 or Ameristar board for an
     Amiga.

   * Your remote host is only reachable via telephone, so you have to
     use your modem to access it.

   * Every Amiga has a serial port (which you don't have to pay for)
     and the cable you need is also cheaper than the one you need for
     Ethernet.

The disadvantage of a serial connection is, that you can connect only to
one host, as no multi-serial boards (e.g. A2232) are supported (yet).
Besides that, NetBSD can use at most 57,6kBd making it a lot slower
than Ethernet's 10MBd.

There are two possible protocols to connect a host running NetBSD-Amiga
to another host using a serial line (possibly over a phone-line):

   * Serial Line IP (SLIP)

   * Point to Point Protocol (PPP)

The choice here is mainly influenced by the host you want to connect to.

If you want to connect to another Amiga, possibly running under
AmigaOS, use SLIP, as this is supported by AS225, AmiTCP and NetBSD.
Also, if you want to connect to a Linux box or (using your modem) to a
terminal server or another unix box which offers SLIP, the choice is
clear.

Otherwise, if you want to connect to a host which only offers PPP, you
can use that one.

From my personal experiences, if I had the choice I'd prefer SLIP
instead of PPP, as it's more difficult to get a connection with the
latter one. With PPP, both sides do an initial handshake which is *very*
easy to timeout if you do the startup by hand; with SLIP, there's no
such initial handshake, i.e.  you start up one side, and when the
othersite has its first packet, it will send it over the line.

RFCs 1331 and 1332 describe PPP and TCP/IP over PPP. SLIP is defined in
RFC 1055.


File: nwf.info,  Node: AddressFormat,  Next: SubnetRouting,  Prev: IPoverSer,  Up: Theory

TCP/IP address format
=====================

TCP/IP uses 4-byte (32-bit) addresses, also called IP-numbers
(Internet-Protocol numbers).

Those IP-numbers are worldwide unique. To assure this, they are
administrated by one central organisation, the DDN Network Information
Center. They give certain ranges of addresses (network-addresses)
directly to sites which want to participate in the internet or to
internet-providers, which give the addresses to their customers.

If your university or company is connected to the Internet, it has (at
least) one such network-address for it's own use.

If you just want to run your private network at home, see below on how
to "build" your own IP-numbers. However, if you want to connect your
machine to the (real :-) internet, you should get an IP-number from
your local network-administrator or -provider.

When writing down IP-numbers, this is done in "dotted quad"-notation
most of the time, i. e. the four bytes are written down in decimal (MSB
first), separated by dots. For example, 132.199.15.99 would be a valid
address.  Another way to write down IP-addresses would be as one 32-bit
hex-word, e.g. 0x84c70f63. This is not as convenient as the
dotted-quad, but quite useful at times, too. (See below!)

Being assigned a network means nothing else but setting some of the
above-mentioned 32 address-bits to certain values. These bits that are
used for identifying the network are called network-bits. The remaining
bits can be used to address hosts on that network, therefore they are
called host-bits.

In the above example, the network is 132.199.0.0 (host-bits are set to
0 in network-addresses), the host's address is 15.99 on that network.

How do you know that the host's address is 16 bit wide? Well, there are
four classes of networks. Each one starts with a certain bit-pattern
identifying it. Here are the four classes:

   * Class A starts with "0" as most significant bit. The next seven
     bits  of a class A address identify the network, the remaining 24
     bit can  be used to address hosts. So, within one class A network
     there can be  2^24 hosts.  It's not very likely that you (or your
     university, or  company, or whatever) will get a whole class A
     address.

   * Class B starts with "10" as most significant bits. The next 14 bits
     are used for the networks address, the remaining 16 bits can be
     used  to address more than 65000 hosts. Class B addresses are
     usually given  to universities.

     Returning to our above example, you can see that 132.199.15.99 (or
     0x84c70f63, which is more appropriate here!) is on a class B
     network,  as 0x84... = *10*00... (base 2).

     Therefore, the address 132.199.15.99 can be split into an
     network-address of 132.199.0.0 and an host-address of 15.99.

   * Class C is identified by the MSBs being "110", allowing only 256
     (actually: only 254, see below) hosts on each of the 2^21 possible
     class C networks. Class C addresses are usually found at (small)
     companies.

   * There are also other addresses, starting with "111". Those are used
     for special purposes (e. g. multicast-addresses) and are not of
     interrest here.

Please note that the bits which are used for identifying the
network-class are part of the network-address.

When seperating host-addresses from network-addresses, the "netmask"
comes in handy. In this mask, all the network-bits are set to "1", the
host-bits are "0". Thus, putting together IP-address and netmask with a
locical AND-function, the network-address remains.

To continue our example, 255.255.0.0 is a possible netmask for
132.199.15.99.  When applying this mask, the network-address
132.199.0.0 remains.

By default, every network-class has a fixed netmask assigned:

Class A:
     default-netmask: 255.0.0.0, first byte of address: 1-127

Class B:
     default-netmask: 255.255.0.0, first byte of address: 128-191

Class C:
     default-netmask: 255.255.255.0, first byte of address: 192-223

Another thing that should be mentioned here is the "broadcast-address".
When sending to this address, *all* hosts on the corresponding network
will receive the message sent. The broadcast address is characterized by
having all host-bits set to "1".

Taking 132.199.15.99 with its netmask 255.255.0.0 again, the
broadcast-address would result in 132.199.255.255.

You'll ask now: But what if I want a hosts address to be all bits "0"
or "1"?  Well, this doesn't work, as network- and broadcast-address
must be present!  Because of this, a class B network can contain at
most 2^16-2 hosts, a class C network can hold no more than 254 hosts.

Besides all those categories of addresses, there's the special
IP-address 127.0.0.1 which always refers to the "local" host, i. e. if
you talk to 127.0.0.1 you'll talk to yourself without starting any
network-activity.  This is sometimes useful to use services installed
on your own machine or to play around if you don't have other hosts to
put on your network.

Let's put together the things we've introduced in this section:

   * IP-address: 	32 bit-address, with network- and host-bits.

   * Network-address: 	IP-address with all host bits set to "0".

   * Netmask: 	32-bit mask with "1" for network- and "0" for
     host-bits.

   * Broadcast: 	IP-address with all host bits set "1".

   * The local host's IP-number is always 127.0.0.1.


File: nwf.info,  Node: SubnetRouting,  Next: t_NSConcepts,  Prev: AddressFormat,  Up: Theory

Subnetting and Routing
======================

After talking so much about netmasks, network-, host- and other
addresses, I have to admit that this is not the whole truth!

Imagine the situation at your university, which usually has a class B
address, allowing it to have up to 65534 hosts on that net. Maybe it
would be a nice thing to have all those hosts on one single network,
but it's simply not possible due to limitations in the transport media
commonly used today!

For example, when using thin wire ethernet, the maximum length of the
cable is 185 meters. Even with repeaters in between, which refresh the
signals, this is not enough to cover all the locations where machines
are located.  Besides that, there is a maximum number of 1024 hosts on
one ethernet wire, and you'll loose quite a bit of performance if you
go to this limit.

So, are you hosed now? Having an address which allows more than 60000
hosts, but being bound to media which allows far less than that limit?

Well, of course not! :-)

The idea is to devide the "big" class B net into several smaller
networks, commonly called sub-networks or simply subnets. Those subnets
are only allowed to have, say, 254 hosts on them (i.e. you devide one
big class B network into several class C networks!).

To do this, you adjust your netmask to have more network- and less
host-bits on it. This is usually done on a byte-boundary, but you're
not forced to do it there! (I don't really know if NetBSDs networking
software understands subnets on non-byte-boundaries; Linux' is said to
have problems there) So, commonly your netmask will not be 255.255.0.0
as supposed by a class B network, but it will be set to 255.255.255.0.

This gives you one additional network-byte to assign to each (physical!)
network. All the 254 hosts on that subnet can now talk directly to each
other, and you can build 256 such class C nets. This should fit your
needs.

To explain this better, let's continue our above example. Let's have
our host 132.199.15.99 (I'll call him DUSK from now; we'll talk about
assigning hostnames later) have a netmask of 255.255.255.0 and thus
being on the subnet 132.199.15.0. Let's furthermore introduce some more
hosts so we have something to play around with:

                                     ftp               cisco
                                132.199.1.202       132.199.1.8
      Subnet 132.199.1.0     \        |                  |
      Broadcast 132.199.1.255 >-------+--+---------------+------------
      Netmask 255.255.255.0  /           |
                                    132.199.1.33
                                        rzi
                                    132.199.15.1
                                         |          / Subnet 132.199.15.0
          ----+------------------+-------+---------<  Broadcast 132.199.15.255
              |                  |                  \ Netmask 255.255.255.0
        132.199.15.100      132.199.15.99
             dawn               dusk
                            132.199.15.98
                                 |
                                 |S
                                 |L
                                 |I
                                 |P
                                 |
                            132.199.15.97
                                noon

(Picture 1: This demo-network shows a part of the University of
Regensburg's campus-wide network as of March 1st 1994. All hosts except
noon are really there.)

In the above network, DUSK can talk directly to DAWN, as they are both
on the same subnet. (There are other hosts attached to the
132.199.15.0-subnet, I'm just too lazy to list them all ;-)

But what, if DUSK wants to talk to a host on another subnet?

Well, the traffic will then go through one or more gateways (routers),
which are attached to two subnets. Because of this, a router always has
two different addresses, one for each of the subnets. The router is
functionally transparent, i. e. you don't have to address it to reach
hosts on the "other" side.  Instead, you address that host directly and
the packets will be routed to it correctly.

Example. Let's say DUSK wants to get some files from the local
ftp-server.  As DUSK can't reach FTP directly (because it's on a
different subnet), all its packets will be forwarded to it's
"defaultrouter" RZI (132.199.15.1), which knows where to forward the
packets to.

DUSK knows the address of it's defaultrouter in its network (RZI,
132.199.15.1), and it will forward any packets to it which are not on
the same subnet, i.e. it will forward all IP-packets in which the third
address-byte isn't 15.

The (default)router then gives the packets to the appropriate host, as
it's also on the FTP-server's network.

In this example, *all* packets are forwarded to the 132.199.1.0-network,
simply because it's the network's backbone, the most important part of
the network, which carries all the traffic that passes between several
subnets.  Almost all other networks besides 132.199.15.0 are attached
to the backbone in a similar manner.

But what, if we had hooked up another subnet to 132.199.15.0 instead of
132.199.1.0? Maybe something like this:

     132.199.1.0 ----------------------+--------------------
     (Backbone)                        |
                                 132.199.1.33
                                      rzi
                                 132.199.15.1
                                       |
     132.199.15.0 -----------+---------+-----------+--------
                             |                     |
                       132.199.15.2          132.199.15.99
                          route2                  dusk
                       132.199.16.1
                             |
     132.199.16.0 -----------+------------------------------

(Picture 2: Attaching one subnet to another one.)

When you now want to reach a host which is located in the
132.199.16.0-subnet from DUSK, it won't work routing it to RZI, but
you'll have to send it directly to ROUTE2 (132.199.15.2). DUSK will
have to know to forward those packets to ROUTE2 and send all the others
to RZI.

When configuring DUSK, you tell it to forward all packets for the
132.199.16.0-subnet to ROUTE2, and all others to RZI. Instead of
specifying this default as 132.199.1.0, 132.199.2.0, etc., 0.0.0.0 can
be used to set the default-route.

Returning to ***picture 1, there's a similar problem when DAWN wants to
send to NOON, which is connected to DUSK via a serial line running.
When looking at the IP-addresses, NOON seems to be attached to the
132.199.15.0-network, but it isn't really. Instead, DUSK is used as
gateway, and DAWN will have to send its packets to DUSK, which will
forward them to NOON then.

The same goes when hosts from other subnets want to send to NOON. They
have to send their packets to DUSK (possibly routed via RZI),


File: nwf.info,  Node: t_NSConcepts,  Next: t_hosts,  Prev: SubnetRouting,  Up: Theory

Name service concepts
=====================

In the previous sections, when I talked about hosts, I referred to them
by their IP-addresses. This was necessary to introduce the different
kinds of addresses. When talking about hosts in general, it's more
convenient to give them "names", as I did when talking about routing.

Most applications don't care whether you give them an IP-number or an
hostname.  However, they'll use IP-numbers internally, and there are
several methods for them to map hostnames to IP-numbers, each one with
its own way of configuration. In this section I'll introduce the idea
behind each method, in the next chapter, I'll talk about the
configuration-part.

The mapping from hostnames (and domainnames) to IP-addresses is done by
a piece of software called the "resolver". This is not an extra
service, but some library routines which are linked to every
application using networking-calls.  The resolver will then try to
resolve (hence the name ;-) the hostnames you give into IP-numbers. See
RFCs 1034 and 1035 for details on the resolver.

Hostnames are usually up to 10 characters long, and contain letters,
numbers, dashes ("-") and underscores ("_"); case is ignorred.

Just as with networks and subnets, it's possible (and desirable) to
group hosts into domains and subdomains. When getting your
network-address, you also obtain a domainname by your provider. As with
subnets, it's up to you to introduce subdomains. Other as with
IP-addresses, (sub)domains are not directly related to (sub)nets; for
example, one domain can contain several subnets.

***Picture 1 shows this: Both subnets 132.199.1.0 and 132.199.15.0 (and
others) are part of the subdomain "RZ.UNI-REGENSBURG.DE". The domain
the University of Regensburg got from it's IP-provider is
"UNI-REGENSBURG.DE" (".DE" is for Deutschland, Germany), the subdomain
"RZ" is for Rechenzentrum, computing center.

Hostnames, subdomain- and domainnames are separated by dots ("."). It's
also possible to use more than one stage of subdomains, although this
is not very common. An example would be FOX_IN.SOCS.UTS.EDU.AU.

A hostname which includes the (sub)domain is also called a fully
qualified domain name (FQDN). For example, the IP-address 132.199.15.99
belongs to the host with the FQDN DUSK.RZ.UNI-REGENSBURG.DE.

Further above I told you that the IP-address 127.0.0.1 always belongs
to the local host, regardless what's the "real" IP-address of the host.
Therefore, 127.0.0.1 is always mapped to the name "LOCALHOST".

The three different ways to translate hostnames into IP-numbers are:

* Menu:

* t_hosts::          /etc/hosts
* t_DNS::            Domain Name Service (DNS)
* t_YP::             Yellow Pages (YP)


File: nwf.info,  Node: t_hosts,  Next: t_DNS,  Prev: t_NSConcepts,  Up: t_NSConcepts

`/etc/hosts'
------------

The first and most simplest way to translate hostnames into
IP-addresses is by using a table telling which IP-number belongs to
which hostname(s). This table is stored in `/etc/hosts' and has the
following format:

     <IP-address>    <hostname> [<nickname> [...]]

Lines starting with a hash mark ("#") are treated as comments. The
other lines contain one IP-address and the corresponding hostname(s).

It's not possible for a hostname to belong to several IP-numbers, even
if I made you think so when talking about routing. RZI for example has
really two distinct names for each of its two addresses: RZI and RZIA
(but please don't ask me which name belongs to which address!).

Giving a host several nicknames can be convenient if you want to
specify your favourite host providing a special service with that name,
as is commonly done with FTP-servers. The first (leftmost) name is
usually the real (canonical) name of the host.

Besides giving nicknames, it's also convenient to give a host's full
name (including domain) as its canonical name, and using only its
hostname (without domain) as a nickname.

*Important:* There *must* be an entry mapping localhost into 127.0.0.1!


File: nwf.info,  Node: t_DNS,  Next: t_YP,  Prev: t_hosts,  Up: t_NSConcepts

The Domain Name Service (DNS)
-----------------------------

`/etc/hosts' bears an inherent problem, especially in big networks:
when one host is added or one hosts's address changes, all the
`/etc/hosts'' on all machines have to be changed! This is not only
time-consuming, it's also very likely that there will be some errors and
inconsistencies, leading to problems.

Another appoach is to hold only one hostnames-table (-database) for a
network, and make all the clients query that "name-server". Updates
will be made only on the name-server.

This is the basic idea behind the Domain Name Service (DNS).

Usually, there's one name-server for each domain (hence DNS), and every
host (client) in that domain knows which domain it is in and which DNS
to query for its domain.

When the DNS gets a query about an host which is not in its domain, it
will forward the query to a DNS which is either the DNS of the domain
in question or knows which DNS to ask for the specified domain. If the
DNS forwarded the query doesn't know how to handle it, it will forward
that query again to a DNS one step higher. This is not ad infinitum,
there are several "root"-servers, which know about any domain.


File: nwf.info,  Node: t_YP,  Next: Practice,  Prev: t_DNS,  Up: t_NSConcepts

Network Information Service (NIS) / Yellow Pages (YP)
-----------------------------------------------------

Yellow Pages (YP) was invited by Sun Microsystems. The name has been
changed into Network Information Service (NIS) because YP was already a
trademark of the british telecom. So, when I'll talk about NIS you'll
know what I'm talking about. ;-)

There are quite some configuration files on a unix-system, and often
it's desired to maintain only one set of those files for a couple of
hosts. Those hosts are grouped together in a NIS-domain (which has
*nothing* to do with the domains built by using DNS!) und are usually
contained in one workstation cluster.

Examples for the config-files shared among those hosts are
`/etc/passwd', `/etc/group' and -- last but not least -- `/etc/hosts'.

So, you can "abuse" NIS for getting a unique name-to-address-translation
on all hosts throughout one (NIS-)domain.

There's only one drawback, which prevents NIS from actually being used
for that translation: In contrast to the DNS, NIS provides no way to
resolve hostnames which are not in the hosts-table. There's no hosts
"one level up" which the NIS-server can query, and so the translation
will fail! (Suns NIS+ seems to take measures against that problem, but
as NIS+ is only available on Solaris-systems, this is of little use for
us now.)

Don't get me wrong: NIS is a fine thing for managing e.g.
user-information (`/etc/passwd', ...) in workstation-clusters, it's
simply not useful for resolving hostnames!


File: nwf.info,  Node: Practice,  Next: Requirements,  Prev: t_YP,  Up: Top

Practice - Essential setup
**************************

In the previous chapter I've introduced all the basic concepts necessary
for setting up networking even in non-trivial environments. Here, I will
show you how to bring your machine up to use networking-applications
such as finger, FTP and telnet.

Throughout this chapter, I'll use DUSK (see ***Picture 1) as an example
for a host hooked up to an ethernet based network, and the connection
between DUSK and NOON will show how to set up PPP and SLIP.

The following steps are described in this chapter:

* Menu:

* Requirements::     What you need before actually starting.
* IfConfig::         Configuring the interface.
* Routing::          How to set up routing.
* p_NSConcepts::     Translating hostnames to IP-numbers.
* UseOnEtc::         How to use the above on `/etc/*'


File: nwf.info,  Node: Requirements,  Next: Hardware,  Prev: Practice,  Up: Practice

Requirements
============

There are several things which are needed to do networking. Most
significant is -- of course -- the hardware you'll use. This has impact
on all the other things, mainly the packages you've to compile into your
kernel and the informations you need to get everything running.

* Menu:

* Hardware::         Hardware requirements.
* Kernel::           Options to compile into /vmunix.
* Addresses::        All kind of addresses you need.


File: nwf.info,  Node: Hardware,  Next: Ethernet,  Prev: Requirements,  Up: Requirements

Hardware
--------

There are two possible types of networking hardware:

* Menu:

* Ethernet::         Ethernet.
* SerLine::          Serial Line.


File: nwf.info,  Node: Ethernet,  Next: SerLine,  Prev: Hardware,  Up: Hardware

Ethernet
........

There are drivers available for NetBSD-Amiga for the following
Ethernet-cards:

   * Commodore A2065

   * Ameristar Board (sorry, don't know exact type)

The significant thing with ethernet is, that it uses a
broadcast-medium, i.e.  there can be several hosts attached to one
cable.


File: nwf.info,  Node: SerLine,  Next: Kernel,  Prev: Ethernet,  Up: Hardware

Serial line
...........

In order to use TCP/IP over a serial line, you only need a null modem.
Here's how the pins are connected on the cable I use:

      2 <--->   3
      3 <--->   2
      4 <--->   5
      5 <--->   4
      6 <--->  20
      7 <--->   7
      8 <--->  20
     20 <---> 6+8

This cable has proved to work with SLIP and PPP, as well as for using
the other side as simple dumb terminal.


File: nwf.info,  Node: Kernel,  Next: Addresses,  Prev: SerLine,  Up: Requirements

Kernel-requirements
-------------------

Here are the necessary changes for `.../conf/MACHINE' in order to
incorporate the various networking-facilities into your kernel:

   * Enable TCP/IP networking in general:

          option         INET            # Basic networking support - mandatory
          pseudo-device  LOOP            # Loopback network - mandatory

   * Put this entry in if you want to run SLIP:

          pseudo-device  sl      1       # Serial Line IP (SLIP)

   * This one is needed to do PPP:

          pseudo-device  ppp     1       # Point-to-Point-Protocol (PPP)

   * If you're proud owner of a Ameristar or Commodore A2065
     Ethernet-card, add the following two items:

          pseudo-device  ether           # Ethernet support
          device le0     at manufacturer ?       product ?

   * Enable the following two options, if you want to run your system as
     NFS-client or -server:

          option         NFSSERVER       # NFS server side code
          option         NFSCLIENT       # NFS client side code

All those options are already included in the GENERIC kernel. They are
listed here rather as an hint for those who want to known what to
*exclude* from a kernel. Leaving out all the networking stuff should
save you about 300-500k of memory, but please note that e.g. X needs
TCP/IP networking facilities.


File: nwf.info,  Node: Addresses,  Next: IfConfig,  Prev: Kernel,  Up: Requirements

Addresses: IP, Broadcast, Netmask, ...
--------------------------------------

If you're about to hook your machine up to your company's, school's or
university's network (i.e. most probably the real Internet :), go to
your local network-administrator and get the following informations:

   * your IP-Number

   * your host's name, including domain.

   * Netmask

   * Broadcast-address

   * Defaultrouter (IP-number)

   * Nameserver (primary and secondary)

If you're about to use SLIP or PPP, possibly via a telephone line,
you'll probably need the following informations:

   * Phone-number of your terminal-server

   * Account, password etc. to get access to your terminal-server

   * IP-number(s) of the terminal-server's dial-ins

If you just want to run your own little LAN at home, you can choose your
own values for most of the things above:

IP-number:
     Choose an IP-number from either class B or C. As you're isolated
     from the  internet, it doesn't really matter what address(es) you
     choose, as long as  they are valid addresses (*note TCP/IP address
     format: AddressFormat.).

     If you choose a couple of addresses, please pay attention that
     they are  all in the same (sub)net! (*note Subnetting and Routing:
     SubnetRouting.)

Hostname:
     Any valid hostname you like, see *Note Name service concepts
     (Theory): t_NSConcepts.

     You'd better not choose a domainname because you'll only have to
     type  longer hostnames (and believe me, you'll have to type those
     hostnames  quite some times during tuning your network! :-).

Netmask:
     Determine this one according to the rules from *Note TCP/IP
     address format: AddressFormat. As you surely don't want to invent
     subnets, the netmask goes hand in hand with the IP-number(s) you
     choose.

Broadcast-address:
     If there's no 4.2BSD-system on your network, determine your
     broadcast-address after the rules stated in *Note TCP/IP address
     format: AddressFormat, i.e. set all host-bits to "1".

     If you've got one or more 4.2BSD-systems on your network, you've
     to pay  attention to set the right broadcast-address, as 4.2BSD
     has a bug in its  networking code, concerning the broadcast
     address.  This bug forces you to  set all host-bits in the
     broadcast-address to "0"!!!

Defaultrouter:
     Most probably not needed at home.

Nameserver:
     You don't need this for the first steps, and most probably you
     won't set  up DNS at home. *Note Domain Name Service (Theory):
     t_DNS, for some details.

To illustrate this, I'll give you the addresses for DUSK and for
connecting DUSK and noon.

Example 1: DUSK
   - IP-number: 132.199.15.99

   - Netmask: 255.255.255.0

   - Broadcast: 132.199.15.255

   - Name: DUSK.RZ.UNI-REGENSBURG.DE

   - Defaultrouter: 132.199.15.1 (RZI.RZ.UNI-REGENSBURG.DE)

   - Nameserver(1): 132.199.1.2

   - Nameserver(2): 132.199.1.1

I got all these values from the local network admin. As the system is
connected to the internet, I use the University of Regensburg's class C
network (132.199.0.0) and their domainname (UNI-REGENSBURG.DE).

Example 2: DUSK & noon
   * DUSK:
        - IP-number: 132.199.15.98

        - Broadcast: 132.199.15.255

        - Name: DUSK

   * noon:
        - IP-number: 132.199.15.97

        - Broadcast: 132.199.15.255

        - Name: noon

I used the second setup at home, with no connection to the internet.
Therefore, I have chosen neither domainname nor defaultrouter or
nameserver. (I choose those IP-numbers for the case that I'm going to
hook up noon to the net, just for fun :-).


File: nwf.info,  Node: IfConfig,  Next: ConfEth,  Prev: Addresses,  Up: Practice

Configuring the interface
=========================

I'll tell you here what's to do to get up your network connection. I'll
tell you how you can set this up permanently in `/etc/rc' etc. later,
see *Note How to use on `/etc/*': UseOnEtc.

Before configuring any network-device, let's first configure the
loopback device:

     # ifconfig lo0 inet 127.0.0.1

By now, you should be able to ping 127.0.0.1.

Next, we'll configure the hardware we have:

* Menu:

* ConfEth::          Ethernet-board.
* ConfSer::          Serial line.


File: nwf.info,  Node: ConfEth,  Next: ConfSer,  Prev: IfConfig,  Up: IfConfig

Configuring your ethernet-board
-------------------------------

Enter the following:

     # ifconfig le0 inet <ip-number> netmask <netmask> broadcast <broadcast>

For example, I can use the following commands to configure DUSK:

     # ifconfig le0 inet 132.199.15.99 netmask 255.255.255.0 \
                    broadcast 132.199.15.255

If you've got a defaultrouter on your network, route all unknown
packets to it:
     # route add default <defaultrouter-ip>

E.g.
     # route add default 132.199.15.1

After that, you can try to reach several hosts on the local and other
networks with the ping-command. Here's what I did on DUSK to check if
everything's fine (please refer to ***Picture 1):

     # ping 132.199.15.99            # dusk.rz.uni-regensburg.de
     # ping 132.199.15.100           # dawn.rz.uni-regensburg.de
     # ping 132.199.15.1             # rzi.rz.uni-regensburg.de
     # ping 132.199.1.202            # ftp.uni-regensburg.de
     # ping 128.252.135.4            # wuarchive.wustl.edu


File: nwf.info,  Node: ConfSer,  Next: PPP,  Prev: ConfEth,  Up: IfConfig

Setting up serial protocols
---------------------------

Here, I'll tell you how to set up NetBSD for dial-out, either on
directly connected machines or via modem.

Any hints for how to setup dial-in welcome (`sliplogin', ...)!

Before you start setting up anything, be sure to kill your getty first:
  1. comment out the line starting with `/dev/tty00' in  `/etc/ttys'

  2. Get the kernel to read the new `/etc/ttys': `kill -HUP 1'

  3. Kill any still-running gettys: `kill -9 `ps -aux | grep  gett[y] |
     awk '{ print $2; }'`'

Available protocols over serial lines are:

* Menu:

* PPP::              Point-to-Point-Protocol (PPP).
* SLIP::             Serial Line Internet Protocol (SLIP).
* term::             term.


File: nwf.info,  Node: PPP,  Next: SLIP,  Prev: ConfSer,  Up: ConfSer

Point to Point Protocol (PPP)
.............................

Here's what Markus Landgraf
(`landgraf@crunch.ikp.physik.th-darmstadt.de') does:

  1. ifconfig ppp0
          # ifconfig ppp0 inet <local-ip> -arp -trailer <remote-ip>

  2. Connect to remote machine via kermit:
          kermit> set line /dev/tty00
          kermit> set speed 9600           # or whatever
          kermit> set flow rts/cts
          kermit> connect

     If your're using a modem, you'll have to dial before connecting:

          kermit> dial <your terminal-server's phone number>

     Log into your remote machine and start `dplogin', `pppd' or
     whatever's used to start PPP on the remote site.

     After that (when you get weird chars on your display) terminate
     kermit  (CTRL-\ q) and perform the next step *fast* to avoid a
     timeout.

  3. run pppd
          # pppd /dev/tty00 9600

  4. ppp0 up
          # ifconfig ppp0 up

  5. Turn on routing:
          # route add 0.0.0.0 <remote-ip>

  6. ping some remote site, see *Note Configuring your ethernet-board:
     ConfEth.  Those pings should  succeed.


File: nwf.info,  Node: SLIP,  Next: term,  Prev: PPP,  Up: ConfSer

Serial Line IP (SLIP)
.....................

The steps for SLIP are basically the same:

  1. Configure sl0:
          # ifconfig sl0 inet <local-ip> -arp -trailers <remote-ip>

  2. Connect to remote machine via kermit:
          kermit> set line /dev/tty00
          kermit> set speed 9600           # or whatever
          kermit> set flow rts/cts
          kermit> connect

     If your're using a modem, you'll have to dial before connecting:

          kermit> dial <your terminal-server's phone number>

     Log into your remote machine's SLIP-account or start SLIP  by hand
     (using `slattach' or such; please consult your  network-admin!).

     After that (when you get weird chars on your display) terminate
     kermit.

  3. Start up the local SLIP service:
          # slattach -s 9600 /dev/tty00

  4. Enable the network connection
          # ifconfig sl0 inet up

  5. Turn on routing:
          # route add 0.0.0.0 <remote-ip>

  6. ping some remote site, see *Note Configuring your ethernet-board:
     ConfEth. Those pings should  succeed.

You can use higher baud-rates than 9600 on both, PPP and SLIP. NetBSD
supports baud-rates up to 38400Bd.


File: nwf.info,  Node: term,  Next: Routing,  Prev: SLIP,  Up: ConfSer

term
....

As I don't own a modem, I haven't made any experiences with term, sorry.

From what I know, term is not really a method to do TCP/IP, but rather
to tunnel TCP/IP-packets over a serial line using its own protocol and
some own servers on both sides. Markus Wild's comment on term: "A
Linux-beast".

Anybody who likes to put some wise words here, please contact me
(first)!


File: nwf.info,  Node: Routing,  Next: p_NSConcepts,  Prev: term,  Up: Practice

Routing
=======

Let's talk one more word about routing. When running SLIP or PPP, it's
sufficient to have a `route add default <remote-ip>' somewhere.
However, if you want to hook up your machine to a more complex network,
it's wise to use `routed' instead of static routes. Therefore, set
`routed_flags' to `"-q"' in `/etc/netstart' then, and it will listen
for routing-updates.

If you are a gateway yourself (e.g. SLIP/PPP-Ethernet), set
`routed_flags' to `""' instead to advertise that route.  Also, if there
are several gateways on your network, put information about them into
`/etc/gateways'.

For example, when DUSK is the SLIP-gateway for NOON (see ***Picture 1),
I set `routed_flags' to `""' and put the following into DUSKs
`/etc/gateways':

     host    132.199.15.97   gateway 132.199.15.98   metric 1 active

This example establishes a route to NOON (132.199.15.97) via DUSKs
SLIP-interface (132.199.15.98). "`metric 1'" says that NOON is one hop
away from DUSK, i.e. that it's directly connected.


File: nwf.info,  Node: p_NSConcepts,  Next: p_hosts,  Prev: Routing,  Up: Practice

Translating names to IP-numbers
===============================

At this point, you should be able to use all TCP/IP-applications such
as ftp, telnet, etc. But up to now, you have to specify all hosts by
their IP-number, which is not very convenient. So, here are the
different ways to set up IP-to-name-resolving.

* Menu:

* p_hosts::          /etc/hosts
* p_DNS::            Domain Name Service (DNS)
* p_YP::             Yellow Pages (YP)


File: nwf.info,  Node: p_hosts,  Next: p_DNS,  Prev: p_NSConcepts,  Up: p_NSConcepts

`/etc/hosts'
------------

As explained previously (*note `/etc/hosts': t_hosts.), `/etc/hosts'
contains a table telling which hostname to map to which IP-number.

If you plan to use DNS, you will nevertheless have at least entries for
localhost (127.0.0.1), your hostname (with it's own IP-number) and maybe
the defaultrouter in `/etc/hosts'.

For example, here's a minimal `/etc/hosts' for DUSK:

     # /etc/hosts
     127.0.0.1       localhost
     132.199.15.99   dusk

Besides these two entries, it's convenient to put any hosts into it
which your system relies on, e.g. NFS-servers. This way, you can reach
those hosts even during boot-time or if DNS is down.

But, if you're just running your private network at home, it's
sufficient to put all your hostnames in `/etc/hosts', there's no need
to set up DNS at home!


File: nwf.info,  Node: p_DNS,  Next: p_YP,  Prev: p_hosts,  Up: p_NSConcepts

Domain Name Service (DNS)
-------------------------

The Domain Name Service is the usual way to resolve IP-numbers from
hostnames in larger networks. All you have to know to set it up is your
domainname and the nameserver's (and maybe it's secondaries, if any)
IP-numbers. Put all these informations into `/etc/resolv.conf':

     # Example /etc/resolv.conf
     domain your.domain.here
     nameserver <primary-IP>
     nameserver <secondary-ip>

As an example, here's DUSKs `/etc/resolv.conf':

     # dusk's /etc/resolv.conf
     domain rz.uni-regensburg.de
     nameserver 132.199.1.2
     nameserver 132.199.1.1

This file is all that's necessary to use DNS.


File: nwf.info,  Node: p_YP,  Next: UseOnEtc,  Prev: p_DNS,  Up: p_NSConcepts

Network Information Service (Yellow Pages)
------------------------------------------

Sorry, I haven't tried NetBSD's NIS yet. If anyone did, please tell me!

Besides that, there's no server-code for NetBSD, so you need another
machine, which is able to run a NIS-server.

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

How to use the above on `/etc/*'?
=================================

Now, as you know how to set up everything by hand, I'll tell you how to
use that knowledge to change the config-files to get all
networking-services started at boot-time.

I want to go through the following files from `/etc' and show you what
you need and what it's good for:

* Menu:

* e_netstart::       `/etc/netstart'.
* e_rc::             `/etc/rc'.
* e_rclocal::        `/etc/rc.local'.

