Creating and Configuring a Small Network

Version 1.0a (Debian Slink)

Introduction:

This is a basic guide to creating, and the initial configuration of, a
small home/office network of systems running Debian GNU/Linux (2.1). It
is designed to help get the network up and running, and so does not cover
configuring a MTA such as exim for such a network nor configuring Internet
access for the systems on the network.

To create the network - which can consist of two or more systems/machines/boxes
- you need to install ethernet cards into each system, and then configure
each system for the new cards (see the Basic Ethernet
Configuration guide for more details). Suitable cards to use
are:

(1) the 3Com 3c509TPO (ISA) or the 3Com 3c900TP0 (PCI). These
are 10Mb/sec and use RJ45 connectors.
(2) the 3Com 3c515TX (ISA) or the 3Com 905C-TX (PCI). These are 10/100
Mb/sec (Fast Etherlink) and use RJ45 connectors

[Note: GNU/Linux Drivers for these particular cards are available under
the GNU copyleft license.]

You also need ethernet cables (straight-through, twisted pair, type
for cards with RJ45), and a suitable network Hub - e.g. the 10 Mb/s 4 port
RJ45 Hub from 3Com (if using the 10 Mb/s cards) or the 100 Mb/s Hub if
using the 100 Mb/s cards.

If you are only connecting two machines, it is possible to link them
directly with a cable - but this cable must be of the cross-over type.

Configuring the Network:

1) Check the IP addresses of the systems (in /etc/hosts), their
full and short names ( in /etc/hosts), and the name you have given to the
network. For example:

System 1

IP address 192.168.1.1

Name: space1.time.sys space1

System 2

IP address 192.168.1.2

Name: space2.time.sys space2

2) Add the details of each system on the network to /etc/hosts
- that is, on system 2, you would add:

192.168.1.1 space1.time.sys space1

and on system 1:

192.168.1.2 space2.time.sys space2

3) You can then telnet from one system to another:

telnet 192.168.1.2

which will give you a prompt and then you can log in using an account
on that system. This will give you a shell (console) which enables you
to work on that system.

4) You can also use ftp to transfer files:

ftp 192.168.1.2

5) You can also telnet and ftp using the name of the system on your
local net:

telnet space1

Adding More Systems

All you need to do to add more systems to your local net is configure their
ethernet cards, add them to the /etc/hosts of the other systems (as
above) and then add the other systems to the /etc/hosts of the new systems.

Mounting Remote File Systems

You can mount the remote file-system(s) on a local machine. For example,
you can mount the /home directory of system space1 on systems space2. To
do this as a user, you must have NFS support compiled into the kernel.
You can check by:

cat /proc/filesystems

If nfs is not listed, then you need to recompile, adding support for
nfs under 'filesystems' (for compiling a new kernel see Debian
Guide 2 ). Once you have this, you can mount remote file-systems.

To mount remote file-systems you need to:

1) Create the mount point on the local system(s) - that is, a directory
where the file-system (fs) will be mounted. For example, /remotefs.

2) Edit the /etc/exports file on the system which is exporting the fs.
For example to export /home to space2, edit the /etc/exports of space1:

/home space2.time.sys(rw)

where rw specifies read and write access. You can also specify ro -
read-only access (see man exports for more details). If you want
to export to all systems on the network, add them on the same line:

/home space2.time.sys(rw) space3.time.sys(rw)
space4.time.sys(ro)

which exports with rw access for systems 2 and 3 and read-only access
to system 4.

You can add other directories to be exported to this file as well.

3) Edit the /etc/fstab on the systems which the fs is to be exported
to.
The line(s) you add must have a special syntax - the host name must
be followed by a colon and then the path of the directory which is exported.
For example:

#fs
mount type
options

space1:/home /remotefs nfs
defaults,user

The type must be nfs. The remote fs can then be accessed any time
provided the remote system is up and running - the /etc/fstab on the local
system(s) will be read at boot time, and the /etc/init.d/nfs-server will
run the NFS daemons on the remote system when it is booted.

4) You can mount the remote fs on the local system by the mount command:

mount space1:/home /remotefs

The remote fs must be unmounted when no longer needed:

umount space1:/home

5) You should be careful with directory and file permissions - you may
need to alter these to allow or restrict access.

Servers and Gateways:

A server is simply a system dedicated to either exporting file-systems
to other systems on the network, and/or a system which acts as a gateway
to other networks, either local via ethernet or remote by some form of
communication device such as a modem. A stand-alone network of any number
of machines does not need a gateway.

To configure a network to use a gateway you must give one system an
IP gateway address and then add this gateway address to the /etc/init.d/network
file of the other systems on the network. This gateway is then the (default)
route to the other network - either another LAN or perhaps an ISP.
That is, this other network is reachable by this gateway.

To make this gateway the default:

route add default
gw <gateway IP address>

Note that such a gateway system can have two IP addresses - a local,
network, address on one network, and another address for the other network
it is connected to (which may be a static IP address provided by an ISP).

Thus - and for example - if the gateway has a static ISP IP address
then each system on the network can specify that the route to this ISP
address is the (local) IP address given to the gateway system.

Copyleft 1999 by Space-Time Systems. This document is free; you can
redistribute it and/or modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either version 2
of the license, or (at your option) any later version.
This document is distributed in the hope that it will be useful, but
without
any warranty; without even the implied warranty of
merchantability
or fitness for a particular purpose. See the GNU General Public
License for more details. Should you be lacking a copy of this, look at:
www.gnu.org/copyleft/gpl.html