home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 1 / ARM_CLUB_CD.iso / contents / apps / comms / a / freenet / !FreeNet_Docs_Setup < prev    next >
Encoding:
Text File  |  1995-04-22  |  9.0 KB  |  206 lines

  1.                   Configuring the FreeNet TCP/IP Stack
  2.  
  3.                           (C) Tom Hughes 1995
  4.  
  5. 0. Copyright
  6.  
  7.   The FreeNet module and application and the tools and documentation
  8.   that go with them are all copyright. They are however released as
  9.   freeware subject to certain terms and conditions. These are described
  10.   in the file named 'Licence' which should have accompanied this
  11.   document.
  12.  
  13. 1. Overview
  14.  
  15.   Configuring FreeNet is a relatively simple process which requires the
  16.   editing of two scripts; one which starts up FreeNet and one which
  17.   shuts it down again.
  18.  
  19.   The first of these two scripts, !FreeUser.Startup, begins by loading
  20.   the necessary modules and then configures the interfaces and routing
  21.   ready for use. The second kills off all the modules, and returns the
  22.   system to its normal state.
  23.  
  24.   The remainder of this document details the various commands used in
  25.   the startup file to configure parts of the system. This, together with
  26.   the example provided with FreeNet should be sufficient to configure
  27.   FreeNet without any problems. Hopefully a future release of FreeNet
  28.   will include a desktop application to do this configuration.
  29.  
  30. 2. Installing additional hardware drivers
  31.  
  32.   If you wish to use a hardware driver other than those supplied with
  33.   FreeNet, you will to place the appropriate module in !FreeUser.Drivers
  34.   and then add a line to the startup script to load this driver.
  35.  
  36.   You can of course store the module somewhere else if you wish. The
  37.   named directory is simply provided as a convenient place where you may
  38.   wish to place it. Note that this is not the same as !FreeNet.Drivers
  39.   which is the directory used to hold the supplied drivers.
  40.  
  41.   The startup script will also need to be modified to load this driver
  42.   by adding an appropriate 'RMRun' command. If the driver has been
  43.   installed in !FreeUser.Drivers, you can use the FreeNet: path to
  44.   locate the driver, as in this example:
  45.  
  46.       RMRun FreeNet:Drivers.SLIPdriver
  47.  
  48.   This command would load a driver named SLIPdriver which was in either
  49.   !FreeUser.Drivers (for user installed drivers) or !FreeNet.Drivers
  50.   (for FreeNet supplied drivers).
  51.  
  52. 3. Configuring interfaces
  53.  
  54.   The first thing you will need to do after loading FreeNet and your
  55.   chosen hardware driver is to configure the interfaces that you wish to
  56.   use. You should note that some drivers (including the supplied SLIP
  57.   driver) will need some configuration before this can be done, and you
  58.   should consult the documentation supplied with the driver for the
  59.   relevant information.
  60.  
  61.   Once this has been done, the ifconfig command can be used to inform
  62.   FreeNet that the interface exists, and to set various relevant
  63.   options. The syntax of this command is as follows:
  64.  
  65.       ifconfig <interface> [inet <local-address> [<remote-address>]]
  66.                [netmask <mask>] [broadcast <address>] [arp] [up|down]
  67.  
  68.   Here, you should give the address that you wish to assign to the
  69.   interface as <local-address> and for point-to-point links like SLIP or
  70.   PPP connections, the address of the other end of the link should be
  71.   given for <remote-address>.
  72.  
  73.   If the interface is on a network that has been subnetted, you will
  74.   need to specify an appropriate value for the netmask. If you don't
  75.   know what this should be, your sysadmin should be able to tell you.
  76.  
  77.   For broadcast networks such as ethernet, you can specify the address
  78.   to be used for broadcast packets on that network. This will default to
  79.   the standard 255.255.255.255 unless otehrwise specified. You will also
  80.   need to include the arp flag when configuring an interface on a
  81.   broadcast network, to specify that the ARP protocol should be used to
  82.   resolve addresses on the local network.
  83.  
  84.   Finally, the interface is marked up or down by including the keyword
  85.   up or down in the ifconfig command line. An interface that is marked
  86.   down will not be used to transmit packets, so this can be used to
  87.   temporarily disable an interface.
  88.  
  89.   To summarise all this, consider the following examples of ifconfig
  90.   commands. The first example configures a SLIP interface with a local
  91.   address of 158.152.40.58 which talks to 158.152.1.222 at the other end
  92.   of the link:
  93.  
  94.       ifconfig sl0 inet 158.152.40.58 158.152.1.222 up
  95.  
  96.   A typical ethernet interface would be configured as follows, where the
  97.   host 163.162.5.45 is on subnet 163.162.5.0 of a class B network whose
  98.   number is 163.162.0.0, giving a netmask of 0xffffff00.
  99.  
  100.       ifconfig eb0 inet 163.162.5.45 netmask 0xffffff00 arp up
  101.  
  102.   This interface could be temporarily removed from operation using the
  103.   command:
  104.  
  105.       ifconfig eb0 down
  106.  
  107.   It would then be returned to use using the following:
  108.  
  109.       ifconfig eb0 up
  110.  
  111.   Once you have configured your interfaces, you should be able to obtain
  112.   a list of available interfaces using the command 'netstat -i'.
  113.  
  114. 4. Configuring the routing tables
  115.  
  116.   Having a system with properly configured interfaces is not much help
  117.   unless TCP/IP is told which packets to route through which interfaces,
  118.   and what address those packets should be addressed through. When an
  119.   interface is configured, a single route will be added to the routing
  120.   tables for that interface, which will be sufficient to reach some
  121.   local hosts.
  122.  
  123.   In the case of point-to-point links like SLIP, a route will have been
  124.   added for the remote address at the other end of the link. This will
  125.   allow you to talk to that machine but to nothing else. For interfaces
  126.   on broadcast networks such as ethernet, things are slightly better as
  127.   there will be a route to all hosts on the local (sub)net. You should
  128.   be able to use 'netstat -r' to see what routes are currently in the
  129.   routing tables.
  130.  
  131.   Adding and removing routes is done using the route command. The add
  132.   form of the command has the following syntax:
  133.  
  134.       route add <destination>[/<bits>] <gateway> <metric>
  135.  
  136.   Where <destination> is the address of a host or network that can be
  137.   reached via the host identified by <gateway>. The <metric> parameter
  138.   is an indication of the efficiency of that route compared to others to
  139.   the same destination.
  140.  
  141.   Normally, the destination address will be examined to see whether the
  142.   host part of the address is zero. If it is, the route will be treated
  143.   as a route to a network, otherwise it will be treated as a route to a
  144.   specific host. This can be overridden by specifying the number of bits
  145.   of the destination address which should be treated as significant.
  146.  
  147.   Where the destination is on a directly attached network, you should
  148.   specify your own address as the gateway, and give a metric of zero. In
  149.   other cases, the gateway should be the address of a machine on a
  150.   directly connected network that knows how to reach the specified
  151.   destination, and the metric should be non-zero.
  152.  
  153.   As an example, consider the following, which tells the machine from
  154.   our previous example (163.162.5.45) how to reach machines on the
  155.   subnet 163.162.12.0 of the local network:
  156.  
  157.       route add 163.162.12.0 163.162.5.1 1
  158.  
  159.   This says that addresses on subnet 163.162.12.0 can be reached by
  160.   sending packets to 163.162.5.1 which is on the directly connected
  161.   subnet (163.162.5.0) and knows how to reach the other subnet. By
  162.   comparison, the following tells the same machine how to reach the
  163.   local subnet (this would normally be done automatically by ifconfig of
  164.   course):
  165.  
  166.       route add 163.162.5.0 163.162.5.45 0
  167.  
  168.   One final, and vital point about adding routes is the setting of the
  169.   default route. This is done by specifing 'default' as the destination,
  170.   and this route will be used for any destination which does not have an
  171.   explicit route in the routing tables.
  172.  
  173.   Deleteing routes is accomplished by using the following, alternative
  174.   syntax of the route command:
  175.  
  176.       route delete <destination>[/<bits>] <gateway>
  177.  
  178.   Where the <destination> and <gateway> parameters are those given to
  179.   the original 'route add', and which can be displayed by using the
  180.   command 'netstat -r' to examine the routing tables.
  181.  
  182. 5. Checking your configuration
  183.  
  184.   Once you have configured your interfaces and routing tables, and
  185.   verified them using 'netstat -i' and 'netstat -r', you should be ready
  186.   to go.
  187.  
  188.   At this point, you will probably want to use the ping utility to
  189.   ensure that your machine can see other machines. In its simplest form,
  190.   you can simply type 'ping <address>' to test whether your machine can
  191.   see a particular remote machine. Full documentation for the ping tool
  192.   can be found in the appropriate file.
  193.  
  194.   Another useful utility is traceroute which will attempt to work out
  195.   what route a packet would follow to reach a given address. This is
  196.   useful in attempting to solve routing problems, and can be used by
  197.   entering 'traceroute <address>'. Full documentation of other options
  198.   for this tool are documented seperately.
  199.  
  200.   Other forms of the netstat command which you may also find useful
  201.   include 'netstat' which lists all sockets which are currently in
  202.   existence, 'netstat -s' which gives a large number of statistics about
  203.   the number and type of packets which have passed throught the TCP/IP
  204.   stack, and 'netstat -m' which reports how many memory buffers ar
  205.   currently free for use.
  206.