home *** CD-ROM | disk | FTP | other *** search
/ Danny Amor's Online Library / Danny Amor's Online Library - Volume 1.iso / html / faqs / faq / linux / howto.networking.part1 < prev    next >
Encoding:
Text File  |  1995-07-25  |  51.7 KB  |  1,519 lines

  1. Subject: Linux NET-2 HOWTO (part 1/3)
  2. Newsgroups: comp.os.linux.announce,comp.os.linux.help,comp.os.linux.admin,news.answers,comp.answers
  3. From: terryd@extro.ucc.su.oz.au (Terry Dawson)
  4. Date: Fri, 18 Nov 1994 17:11:12 GMT
  5.  
  6. Archive-name: linux/howto/networking/part1
  7. Last-modified: 18 Nov 94
  8.  
  9.   Linux NET-2/NET-3 HOWTO
  10.   Terry Dawson, terryd@extro.ucc.su.oz.au
  11.   v2.7, 08 Oct 1994
  12.  
  13.   This document aims to describe how to obtain, install and configure
  14.   the Linux NET-2 and NET-3 networking software. Some answers to some of
  15.   the more frequently asked questions are also included.
  16.  
  17.   1.  Introduction.
  18.  
  19.   This is the Linux NET-2-HOWTO. This document is a complete rewrite of
  20.   the earlier NET-FAQ, and of the subsequent NET-2-HOWTO versions 1.0+,
  21.   for the new NET-2 and NET-3 tcp/ip networking code for Linux kernels
  22.   1.0 and above.
  23.  
  24.  
  25.   1.1.  Changes from the previous release.
  26.  
  27.  
  28.   Additions:
  29.           Added details of the new ARCNet driver - thanks Avery.
  30.           Added tcpdump location details
  31.  
  32.   Corrections:
  33.           Fixed symlink to dip and chmod problem - thanks Lamar.
  34.           Updated Matt Dillon's slip management suite version
  35.  
  36.  
  37.  
  38.  
  39.   1.2.  A brief development history of Linux Networking.
  40.  
  41.   Ross Biro <biro@yggdrasil.com> wrote the original kernel based
  42.   networking code for Linux. He used ethernet drivers written by Donald
  43.   Becker <becker@cesdis1.gsfc.nasa.gov>, a slip driver written by
  44.   Laurence Culhane <loz@holmes.demon.co.uk>, and a D-Link driver by
  45.   Bj0rn Ekwall <bj0rn@blox.se>.
  46.  
  47.   The further development of the Linux networking code was later taken
  48.   up by Fred van Kempen <waltje@hacktic.nl>, who took Ross's code and
  49.   produced the NET-2 release of network code. NET-2 went through a
  50.   number of revisions until release NET-2d, when Alan Cox
  51.   <iialan@iifeak.swan.ac.uk> took Fred's NET-2d code and set about
  52.   debugging the code with the aim of producing a stable and working
  53.   release of code for incorporation into the standard kernel releases.
  54.   This code was called NET-2D(ebugged), and has been incorporated into
  55.   the standard kernel releases since some time before Linux vers 1.0 was
  56.   released.
  57.  
  58.   PPP support was added by Michael Callahan, <callahan@maths.ox.ac.uk>
  59.   and  Al Longyear, <longyear@netcom.com>, originally as patches to the
  60.   kernel, and in later releases as an option.
  61.  
  62.   Fred continued developing his kernel network code, and produced
  63.   NET-2E.  A reference for it if you are interested in looking at Fred's
  64.   new work is listed later on in this document.
  65.  
  66.   With the release of Linux vers 1.0, Linus made a decision to continue
  67.   supporting Alan's code as the `standard' network kernel code.
  68.  
  69.   The latest revision of the code, NET-3, appears in kernel releases
  70.   1.1.5 and later, and is essentially the same code, but with many
  71.   fixes, corrections and enhancements.
  72.  
  73.   Alan has added such features as IPX and AX.25 modules.  Florian La
  74.   Roche, <flla@stud.uni-sb.de> has produced an updated distribution of
  75.   network applications.
  76.  
  77.   Unless otherwise stated, this document will refer to the network code
  78.   included in the standard kernel releases. On the whole this document
  79.   will serve for Fred's code as well, but as the development paths are
  80.   now seperate, it is possible that there will be differences between
  81.   the two.
  82.  
  83.  
  84.   2.  Disclaimer.
  85.  
  86.   The Linux networking code is a brand new implementation of kernel
  87.   based tcp/ip networking. It has been developed from scratch, and is
  88.   not a port of any existing kernel networking code.
  89.  
  90.   Because it is a fresh implementation it may still have a number of
  91.   bugs or problems with it, and there may be a number of fixes and
  92.   patches released.  If you are worried about problems then just stick
  93.   to the version of network code released with the standard kernel
  94.   releases and utility sets. The networking code has a small team of
  95.   dedicated people working on it, with a cast of thousands testing the
  96.   code, and collecting and reporting bugs and problems.  Any problem you
  97.   experience is likely to have already been reported, and be being
  98.   worked on, and will possible be corrected soon, so be patient, or if
  99.   you can help, offer your assistance.
  100.  
  101.   We do not, and cannot, know everything there is to know about the
  102.   Linux network software. Please accept and be warned that this document
  103.   probably does contain errors. Please read any README files that are
  104.   included with any of the various pieces of software described in this
  105.   document for more detailed and accurate information. We will attempt
  106.   to keep this document as error-free and up-to-date as possible.
  107.   Versions of software are current as at time of writing.
  108.  
  109.   NOTE: While its name may appear similar to the Berkeley Software
  110.   Distribution NET-2 release, the Linux network code actually has
  111.   nothing at all to do with it. Please don't confuse them.
  112.  
  113.  
  114.   3.  Questions already ?
  115.  
  116.   `The only stupid question is the unasked one.'
  117.  
  118.   If you have general configuration questions, and you have been unable
  119.   to find the answers after reading the other various HOWTO and FAQ
  120.   files, then you would be best served to post them to
  121.   comp.os.linux.help, or, if you believe your question to be
  122.   specifically related to the Linux Network code, then you could post it
  123.   to the NET mailing list. Please include as much relevant information
  124.   as possible, there is nothing more annoying than to have a bug or
  125.   problem reported without sufficient information to even begin
  126.   searching for it.
  127.  
  128.   Version numbers and revisions of code, a detailed account of the
  129.   problem, and the circumstances that caused it to occur, are essential.
  130.   Trace and debug messages where available should also be considered
  131.   mandatory.
  132.  
  133.   If you have a question relating to the configuration of, or problems
  134.   experienced with, any linux distribution, regardless of who has
  135.   provided it, please contact the prople who created the distribution
  136.   first, before attempting to report the problem to the network code
  137.   developers. The reason for this is that some of the distributions use
  138.   non-standard directory structures, and supply test/non-standard
  139.   versions of code and utilities. The developers of the NET-2 code
  140.   cannot be expected to offer support for the network code as
  141.   distributed in any form, other than as described in this document, or
  142.   as per distributed Alpha/Beta test instructions.
  143.  
  144.   To join the Linux NET channel on the mail list server, send mail to:
  145.  
  146.  
  147.        linux-activists@niksula.hut.fi
  148.  
  149.        with the line:
  150.  
  151.        X-Mn-Admin: join NET
  152.  
  153.        at the top of the message body (not the subject line).
  154.  
  155.  
  156.  
  157.  
  158.   Remember, keep in mind that the NET channel is for development discus-
  159.   sions only.
  160.  
  161.   Note also that a PPP list has been established. To join it, use the
  162.   same procedure as for joining the NET channel, except specify PPP in
  163.   place of NET in the X-Mn-Admin: field.
  164.  
  165.   Note also that a HAMS list has been established. This list has been
  166.   established for the discussion of programs related to Amateur Radio.
  167.   To join it, follow the same procedure as for joining the NET or PPP
  168.   channels, except specify HAMS in place of NET in the X-Mn-Admin:
  169.   field.
  170.  
  171.  
  172.   4.  Related Documentation.
  173.  
  174.   If you are looking for information about tcp/ip networking that this
  175.   HOWTO does not cover, then you might try the following sources, as
  176.   they provide some very useful information.
  177.  
  178.   Olaf Kirch has written a substantial document as part of the Linux
  179.   Documentation Project entitled the Linux Network Administration Guide.
  180.   This is an excellent document. It covers all aspects of setting up and
  181.   using the tcp/ip networking under Linux, including NFS, UUCP, mail,
  182.   News, nameserver etc.
  183.  
  184.   Olaf's book supplements this HOWTO, taking up where this document
  185.   leaves off. This document covers the installation and configuration of
  186.   the NET code, i.e. `How to put your machine on the net'. If you are
  187.   new to unix networking, then I strongly urge you to obtain a copy and
  188.   read it first. It will answer a lot of questions for you that are not
  189.   within the scope of this document.
  190.  
  191.   The current release version is available in:
  192.  
  193.   sunsite.unc.edu
  194.  
  195.  
  196.        /pub/Linux/docs/linux-doc-project/network-guide/*
  197.  
  198.  
  199.  
  200.  
  201.   There are various versions of the document in this directory. The most
  202.   common formats are supported, being plain ascii, Postscript, DVI,
  203.   Latex and groff.
  204.  
  205.   The Linux Network Administrators Guide is Copyright (c) by Olaf Kirch.
  206.  
  207.   You should also read the other HOWTO documents relevant to networking
  208.   with Linux.
  209.  
  210.   They are:
  211.  
  212.   The Ethernet-HOWTO
  213.   (ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO/Ethernet-HOWTO) which you
  214.   should read if you intend using an ethernet card with Linux. It
  215.   includes much more detail on how to select, install and configure an
  216.   ethernet card for Linux.
  217.  
  218.   The Serial-HOWTO (http://sunsite.unc.edu/mdw/HOWTO/Serial-HOWTO.html)
  219.   if you intend using slip or ppp in server mode.
  220.  
  221.   The Mail-HOWTO (http://sunsite.unc.edu/mdw/HOWTO/Mail-HOWTO.html) and
  222.   the News-HOWTO (http://sunsite.unc.edu/mdw/HOWTO/News-HOWTO.html) for
  223.   some specific information on setting up Mail and News on your system.
  224.  
  225.   The UUCP-HOWTO (http://sunsite.unc.edu/mdw/HOWTO/UUCP-HOWTO.html) if
  226.   you will be connecting to the net via UUCP.
  227.  
  228.   For more general information on Unix network configuration another
  229.   good place to look for help on setting up your network is the O'Reilly
  230.   and Associates book TCP/IP Network Administration, (the one with the
  231.   Crab on the cover). Keep in mind that the Linux Network code is now a
  232.   fairly standard implementation of tcp/ip networking, this means that
  233.   the commands to configure and use it will work in much the same way as
  234.   for those for other unix operating systems. Keep in mind though that
  235.   some of the arguments and options might differ slightly from those in
  236.   the book.
  237.  
  238.   If you are after some basic tutorial information on tcp/ip networking
  239.   generally, then you might take a look at the following documents:
  240.  
  241.   athos.rutgers.edu
  242.  
  243.  
  244.        /runet/tcp-ip-admin.doc
  245.        /runet/tcp-ip-admin.ps
  246.        /runet/tcp-ip-intro.doc
  247.        /runet/tcp-ip-intro.ps
  248.  
  249.  
  250.  
  251.  
  252.   If you are after some more detailed information on tcp/ip networking
  253.   then I highly recommend:
  254.  
  255.  
  256.  
  257.        "Internetworking with TCP/IP"
  258.        by Douglas E. Comer
  259.  
  260.        ISBN 0-13-474321-0
  261.        Prentice Hall publications.
  262.  
  263.  
  264.  
  265.  
  266.  
  267.   4.1.  New versions of this document.
  268.  
  269.   The latest released version of this document can be retrieved by
  270.   anonymous ftp from:
  271.  
  272.  
  273.   sunsite.unc.edu
  274.  
  275.  
  276.        /pub/Linux/docs/HOWTO/NET-2-HOWTO
  277.        /pub/Linux/docs/HOWTO/other-formats/NET-2-HOWTO.{tex,ps,dvi}
  278.  
  279.  
  280.  
  281.  
  282.   via the World Wide Web from the Linux Documentation Project Web Server
  283.   (http://sunsite.unc.edu/mdw/linux.html), at page: NET-2-HOWTO
  284.   (http://susnite.unc.edu/mdw/HOWTO/NET-2-HOWTO.html) or directly from
  285.   me, <terryd@extro.ucc.su.oz.au>. It will also be posted to the
  286.   newsgroups: comp.os.linux.announce, comp.os.linux.help, and
  287.   news.answers periodically.
  288.  
  289.   You can find news.answers FAQ postings, including this one, archived
  290.   on rtfm.mit.edu:/pub/usenet.
  291.  
  292.  
  293.   4.2.  Feedback.
  294.  
  295.   Please send any comments, updates, or suggestions to me,
  296.   <terryd@extro.ucc.su.oz.au>. The sooner I get feedback, the sooner I
  297.   can update and correct this document. If you find any problems with
  298.   it, please mail me instead of posting to one of the newsgroups, as I
  299.   may miss it. Thanks.
  300.  
  301.  
  302.   5.  NET-2/NET-3 Supported functionality.
  303.  
  304.   The NET code is a complete kernel based implementation of tcp/ip for
  305.   Linux.  The NET-2 and NET-3 versions of code support:
  306.  
  307.  
  308.      Ethernet Cards
  309.         Most popular ethernet cards are supported.
  310.  
  311.      SLIP (Serial Line IP) and PPP
  312.         for tcp/ip networking over serial lines such as the telephone
  313.         via modem, or a local cable between two machines.
  314.  
  315.      Van Jacobsen Header Compression
  316.         for compressing the tcp/ip headers to improve slip performance
  317.         over low speed lines.
  318.  
  319.      PLIP (Parallel Lines IP)
  320.         to allow local connections between two machines using your
  321.         printer ports.
  322.  
  323.      NFS (Networked File System)
  324.         to allow you to remotely mount another machines filesystems.
  325.  
  326.      AX.25 (A protocol used by Amateur Radio Operators)
  327.         Alan Cox has some experimental code available.
  328.  
  329.      PI Card (An 8530 SCC based card used by Amateur Radio Operators)
  330.         An experimental PI Card driver is available.
  331.  
  332.      IPX/SPX (Novell)
  333.         to allow you to write custom SPX/IPX applications, or to use
  334.         Linux as an IPX router.
  335.  
  336.   The NET-2 and NET-3 network code does not yet currently support:
  337.  
  338.  
  339.      NCP (Novell) support
  340.         to allow Linux to serve and mount Novell network devices. This
  341.         is being worked on.
  342.  
  343.  
  344.      Lan types other than ethernet
  345.         This means token ring, arcnet, FDDI, etc. An experimental Token
  346.         Ring driver is being developed. An experimental ARCNet driver
  347.         has also been developed (details further on).
  348.  
  349.  
  350.      ISDN Support
  351.         this is being developed.
  352.  
  353.  
  354.   5.1.  Supported Ethernet cards.
  355.  
  356.   The standard linux kernel release supports the following type of
  357.   Ethernet cards:
  358.  
  359.  
  360.   o  NE2000/NE1000 and close compatibles.
  361.  
  362.   o  WD80*3 and close compatibles.
  363.  
  364.   o  SMC Ultra
  365.  
  366.   o  3c501 (obselete and very slow)
  367.  
  368.   o  3c503 and close compatibles.
  369.  
  370.   o  3c509/3c579
  371.  
  372.   o  HP PCLAN (however a newer kernel is required for the HP PCLAN+)
  373.  
  374.   o  AT1500 and NE2100 (LANCE and PCnet-ISA) and close compatibles.
  375.  
  376.   o  AT1700 (not clones)
  377.  
  378.   o  DEPCA and close compatibles.
  379.  
  380.   o  D-Link DE600 pocket adaptor and close compatibles.
  381.  
  382.   o  AT-LAN-TEC/RealTek pocket adaptor and close compatibles.
  383.  
  384.   Additional drivers are available in the 1.1.* and later development
  385.   kernels.
  386.  
  387.   The Ethernet-HOWTO contains a lot of very useful information on the
  388.   supported ethernet cards, including information on how to choose an
  389.   ethernet card if you are intending to puchase some specifically for
  390.   Linux.
  391.  
  392.   As mentioned above, Linux supports other means of network connection
  393.   if you don't have access to an ethernet card or connection. Many
  394.   universities and businesses worldwide offer some form of dial-up
  395.   network access. Generally these forms of access will offer an option
  396.   of either SLIP or PPP access, so you will be well catered for. All you
  397.   will need is a telephone modem, the one you already have may well be
  398.   good enough, and to configure your Linux system appropriately. There
  399.   are sections below that describe exactly what you need.
  400.  
  401.  
  402.  
  403.  
  404.  
  405.   6.  Getting the NET-2/NET-3 software.
  406.  
  407.   Before you can configure the networking software you must obtain all
  408.   of the bits and pieces that make it up. These include the current
  409.   version of the kernel code (version 1.0 or later), the correct system
  410.   libraries, the tcp/ip configuration programs and files (e.g.
  411.   /sbin/ifconfig, /etc/hosts etc.), and finally a set of network
  412.   application programs (such as telnet, ftp, rlogin etc.).
  413.  
  414.   If you obtained Linux from a distribution you may already have all
  415.   that you need. Check and make sure that you do. For example, some
  416.   Linux distributions come with all of the network configuration files,
  417.   binaries, libraries, and kernel installed, so there's no reason to get
  418.   the following files.
  419.  
  420.   NOTE: they may be in directories and files different to those
  421.   specified in this HOWTO document
  422.  
  423.   If you DO have the network software, skip to the `Configuring the
  424.   kernel' section. If you DO NOT have the network software follow the
  425.   following directions.
  426.  
  427.  
  428.   6.1.  The kernel source.
  429.  
  430.   Version 1.0 of the Linux kernel is the production version. Any of the
  431.   Linux kernels after that release are enhancements or bug fixes. If you
  432.   feel at all concerned about the possibility of having to patch and
  433.   modify the kernel source, then you should stick to this release, as it
  434.   will do most of what you want it to. In the case of the networking
  435.   code though, I strongly suggest you just take a deep breath and follow
  436.   the newer releases of code, as there have been many changes in the
  437.   newer version kernels that affect networking. I know you hear it from
  438.   everyone and everywhere, but when trying out any new version of kernel
  439.   software you should always ensure that you have sufficient backups of
  440.   your system just in case something goes seriously wrong while you are
  441.   testing.
  442.  
  443.   The current kernel version is found in:
  444.  
  445.   ftp.funet.fi
  446.  
  447.  
  448.        /pub/OS/Linux/PEOPLE/Linus/v1.1/v1.1.45.tar.gz
  449.  
  450.  
  451.  
  452.  
  453.   This is a gzipped file, so you will need gzip to uncompress it.
  454.  
  455.   To install it, try:
  456.  
  457.  
  458.  
  459.        # cd /usr/src
  460.        # mv linux linux.old
  461.        # gzip -dc v.1.1.45.tar.gz | tar xvf -
  462.  
  463.  
  464.  
  465.  
  466.   You may also find some files called patch46.gz ... in the same
  467.   directory. These are patch files. If you have a linux kernel that is
  468.   version 1.1.45 then what this means is that you have linux kernel
  469.   version 1.1.0 with patches 1 to 45 applied, so you won't need to apply
  470.   any of these.  If there are any patch files that are greater than the
  471.   version of kernel you have, you should obtain all of those above, and
  472.   apply them, in sequence, with something like the following commands:
  473.  
  474.  
  475.  
  476.        # cd /usr/src
  477.        # gzip -dc .../patch1.gz | patch -p0
  478.        # gzip -dc .../patch2.gz | patch -p0
  479.        # gzip -dc .../patch3.gz | patch -p0
  480.  
  481.         ...
  482.  
  483.  
  484.  
  485.  
  486.  
  487.   6.2.  The libraries.
  488.  
  489.   You'll want at least version 4.4.2 of libc, as there were problems
  490.   with earlier version that affected subnet masks.
  491.  
  492.   The current libraries (libc-4.5.26) can be found in:
  493.  
  494.   sunsite.unc.edu
  495.  
  496.  
  497.        /pub/Linux/GCC/
  498.  
  499.  
  500.  
  501.  
  502.   You will need at least the following files:
  503.  
  504.  
  505.   o  image-4.5.26.tar.gz
  506.  
  507.   o  inc-4.5.26.tar.gz
  508.  
  509.   o  extra-4.5.26.tar.gz
  510.  
  511.   o  release.libc-4.5.26
  512.  
  513.   You MUST read release.libc-4.5.26 before you install the libraries.
  514.   Please note the single line in the release document regarding deleting
  515.   the older version of /usr/lib/libgcc.* or else your compiles will not
  516.   link properly. Please note that to use release 4.5.26 you will also
  517.   need at least GCC version 2.5.7, and Linux kernel 1.0 or later.
  518.  
  519.  
  520.   6.3.  The network configuration tool suite.
  521.  
  522.   You will need the utility suite that provides tools to configure your
  523.   network support.
  524.  
  525.   The current NET-2 utility suite is available from:
  526.  
  527.   sunacm.swan.ac.uk
  528.  
  529.  
  530.        /pub/misc/Linux/Networking/PROGRAMS/NetTools/net-tools-1.1.38.tar.gz
  531.  
  532.  
  533.  
  534.  
  535.   Because the kernel networking code is still changing some changes to
  536.   the network tools have been necessary as new kernels are released, so
  537.   you will need to choose the version that is appropiate for the kernel
  538.   version you intend to use.
  539.  
  540.   The filenames reflect the earliest version of kernel that the tools
  541.   will work with. Please choose the filename whose version equals, or is
  542.   less than the version of kernel source you intend to use.
  543.  
  544.   To build and install the tools, you should try:
  545.  
  546.  
  547.        # cd /usr/src
  548.        # mkdir net-tools
  549.        # cd net-tools
  550.        # gzip -dc net-tools-1.1.38.tar.gz | tar xvf -
  551.        # make config
  552.        # make
  553.  
  554.        If everything makes ok, then:
  555.  
  556.        # make install
  557.  
  558.  
  559.  
  560.  
  561.   If you use a kernel version 1.1.26 or earlier you should look in:
  562.  
  563.   sunacm.swan.ac.uk
  564.  
  565.  
  566.        /pub/misc/Linux/Networking/PROGRAMS/Other/net032/
  567.  
  568.  
  569.  
  570.  
  571.   In this directory you will find three versions of the network tools.
  572.   The following table lists net-032 package name with the relevant
  573.   kernel versions:
  574.  
  575.  
  576.  
  577.        net-0.32d-net3.tar.gz     1.1.12+
  578.        net-0.32b.tar.gz          1.1.4+
  579.        net-0.32.old.tar.gz       pre 1.1.4 kernels
  580.  
  581.  
  582.  
  583.  
  584.   These packages include the essential network configuration programs
  585.   such as ifconfig, route, netstat etc. These will be discussed later.
  586.  
  587.  
  588.   6.4.  The network applications.
  589.  
  590.   You will want a number of network application programs. These are
  591.   programs like telnet, ftp, finger and their daemons at least. Florian
  592.   La Roche, <flla@stud.uni-sb.de> has put together a fairly complete
  593.   distribution of network applications in both binary and source form.
  594.   The tcp/ip application binaries and some sample config files are found
  595.   in:
  596.  
  597.   ftp.funet.fi
  598.  
  599.  
  600.        /pub/OS/Linux/PEOPLE/Linus/net-source/NetKit/NetKit-A-0.07.bin.tar.gz
  601.        /pub/OS/Linux/PEOPLE/Linus/net-source/NetKit/NetKit-B-0.06.bin.tar.gz
  602.  
  603.   If there are newer versions then use the newer versions. Please read
  604.   the README file first just to make sure that you have the necessary
  605.   prerequisites.
  606.  
  607.   Be sure to make backups of any config files important to you. If this
  608.   is a new installation you probably don't have any. You can unpack each
  609.   of the packages above with the command:
  610.  
  611.  
  612.  
  613.        # cd /
  614.        # gzip -dc filename.tar.z | tar xpvlf -
  615.  
  616.  
  617.  
  618.  
  619.   IMPORTANT NOTE: Florian has built and prepackaged these tar files for
  620.   your convenience. Florian has attempted to make them as complete as
  621.   possible and has included a distribution of the binaries found in the
  622.   net-tools-n.n.nn releases. Unfortunately Florian has chosen not to use
  623.   the same directory structure as Alan did when he prepared the
  624.   installation script for the net-tools. This will mean that you should
  625.   be very careful when installing them. Florian will change this later
  626.   so that this difference is not a problem, but until then, I suggest
  627.   you do the following instead of the above:
  628.  
  629.  
  630.  
  631.        -  Unpack the binaries somewhere safe:
  632.        # cd /usr/src
  633.        # mkdir NetKit
  634.        # cd NetKit
  635.        # gzip -dc NetKit-A-0.07.bin.tar.gz | tar xpvlf -
  636.        # gzip -dc NetKit-B-0.06.bin.tar.gz | tar xpvlf -
  637.  
  638.        -  Remove Florians copies of the network tools previously described:
  639.        # rm ./bin/hostname ./sbin/route ./sbin/ifconfig ./sbin/netstat
  640.        # rm ./usr/sbin/arp ./usr/sbin/rarp ./usr/sbin/slattach
  641.  
  642.        -  Copy Florian's files into their new home:
  643.        # cp -vrpd . /
  644.  
  645.  
  646.  
  647.  
  648.  
  649.   6.5.  Additional drivers or packages.
  650.  
  651.   If you want to add some developmental, or Alpha/Beta test code, such
  652.   as AX.25 support, you will need to obtain the appropriate support
  653.   software for those packages. Please check the relevant sections for
  654.   those packages in this document for more detail.
  655.  
  656.  
  657.   7.  Configuring the kernel.
  658.  
  659.   Before you can use any of the network tools, or configure any network
  660.   devices, you must ensure that your kernel has the necessary network
  661.   support built into it. The best way of doing this is to compile your
  662.   own, selecting which options you want and which you don't.
  663.  
  664.   Assuming you have obtained and untarred the kernel source already, and
  665.   applied any patches that you might need to have applied to get any
  666.   nonstandard or developmental software installed, all you have to do is
  667.   edit /usr/src/linux/drivers/net/CONFIG. This file has many comments to
  668.   guide you in editing it,and in general you will need to edit very
  669.   little, as it has sensible defaults. In my case I don't need to edit
  670.   it at all.  This file is really necesary if your ethernet card is an
  671.   unusual one, or is one that isn't automatically detected by the
  672.   ethernet driver. It allows you to hard code some of the elements of
  673.   your ethernet hardware. For example, if your ethernet card is a close,
  674.   but not exact clone of a WD-8013, then you might have to configure the
  675.   shared memory address to ensure the driver detects and drives the card
  676.   properly. Please check the Ethernet-HOWTO for more definitive
  677.   information on this file and its effect on ethernet cards. This file
  678.   also contains configurable parameters for PLIP, though the defaults
  679.   should again be ok unless you have a particularly slow machine.
  680.  
  681.   When you are happy that the CONFIG file is suitable for your purposes,
  682.   then you can proceed to build the kernel. Your first step will be to
  683.   edit the top level Makefile to ensure the kernel will be built with
  684.   the appropriate VGA settings, and then you must run the kernel
  685.   configuration program:
  686.  
  687.  
  688.  
  689.        # cd /usr/src/linux
  690.        # make config
  691.  
  692.  
  693.  
  694.  
  695.   You will be asked a series of questions. There are four sections
  696.   relevant to the networking code. They are the General setup,
  697.   Networking options, Network device support, and the Filesystems
  698.   sections. The most difficult to configure is the Network device
  699.   support section, as it is where you select what types of physical
  700.   devices you want configured. On the whole you can just use the default
  701.   values for the other sections fairly safely. The following will give
  702.   you an idea of how to proceed:
  703.  
  704.  
  705.  
  706.        *
  707.        * General setup
  708.        *
  709.         ...
  710.         ...
  711.        Networking support (CONFIG_NET) [y] y
  712.         ...
  713.         ...
  714.  
  715.  
  716.  
  717.  
  718.   In the General setup section you simply select whether you want
  719.   network support or not. Naturally you must answer yes.
  720.  
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731.  
  732.  
  733.  
  734.  
  735.   *
  736.   * Networking options
  737.   *
  738.   TCP/IP networking (CONFIG_INET) [y] y
  739.   IP forwarding/gatewaying (CONFIG_IP_FORWARD) [y] y
  740.   *
  741.   * (it is safe to leave these untouched)
  742.   *
  743.   PC/TCP compatibility mode (CONFIG_INET_PCTCP) [n] n
  744.   Reverse ARP (CONFIG_INET_RARP) [n] n
  745.   Assume subnets are local (CONFIG_INET_SNARL) [y] y
  746.   Disable NAGLE algorithm (normally enabled) (CONFIG_TCP_NAGLE_OFF) [n] n
  747.   The IPX protocol (CONFIG_IPX) [n] n
  748.  
  749.  
  750.  
  751.  
  752.   The second half of the Networking options section allows you to enable
  753.   or disable some funky features that you can safely accept the defaults
  754.   on until you have some idea why you want to change them.
  755.  
  756.  
  757.  
  758.        *
  759.        * Network device support
  760.        *
  761.        Network device support? (CONFIG_NETDEVICES) [y]
  762.        Dummy net driver support (CONFIG_DUMMY) [n]
  763.        SLIP (serial line) support (CONFIG_SLIP) [y] y
  764.         CSLIP compressed headers (SL_COMPRESSED) [y] y
  765.        PPP (point-to-point) support (CONFIG_PPP) [y] y
  766.        Load balancing support (experimental) (CONFIG_SLAVE_BALANCING) [n] n
  767.        Do you want to be offered ALPHA test drivers (CONFIG_NET_ALPHA) [n] n
  768.        Western Digital/SMC cards (CONFIG_NET_VENDOR_SMC) [y] y
  769.        WD80*3 support (CONFIG_WD80x3) [y] y
  770.        SMC Ultra support (CONFIG_ULTRA) [n] n
  771.        3COM cards (CONFIG_NET_VENDOR_3COM) [n] n
  772.        Other ISA cards (CONFIG_NET_ISA) [n] n
  773.        PLIP (parallel port) support (CONFIG_PLIP) [n] n
  774.        EISA and on board controllers (CONFIG_NET_EISA) [n] n
  775.        Apricot Xen-II on board ethernet (CONFIG_APRICOT) [n] n
  776.        Pocket and portable adaptors (CONFIG_NET_POCKET) [n] n
  777.        *
  778.  
  779.  
  780.  
  781.  
  782.   This section is the most important, and the most involved. It is where
  783.   you select what hardware devices you want to support. You can see that
  784.   I have selected SLIP support with header compression, PPP, the WD80*3
  785.   driver, and nothing else. Simply answer `y' to whatever you want to
  786.   play with, and `n' to that you don't.
  787.  
  788.  
  789.  
  790.        *
  791.        * Filesystems
  792.        *
  793.         ...
  794.         ...
  795.        /proc filesystem support (CONFIG_PROC_FS) [y]
  796.        NFS filesystem support (CONFIG_NFS_FS) [y]
  797.         ...
  798.         ...
  799.  
  800.  
  801.   If you wish to run an NFS client then you will want to include the NFS
  802.   filesystem type. You will need to include the /proc filesystem because
  803.   a number of the network utilities use it.
  804.  
  805.   After you have completed the configuration, all that remains is to
  806.   actually compile the kernel:
  807.  
  808.  
  809.  
  810.        # make dep
  811.        # make
  812.  
  813.  
  814.  
  815.  
  816.   Don't forget to make zlilo if the new kernel compiles and tests ok.
  817.  
  818.  
  819.   8.  Configuring the Network Devices.
  820.  
  821.   If everything has gone ok so far, then you will have a Linux kernel
  822.   which supports the network devices you intend to use, and you also
  823.   have the network tools with which to configure them. Now comes the fun
  824.   part! You'll need to configure each of the devices you intend to use.
  825.   This configuration generally amounts to telling each device things
  826.   like what its IP address will be, and what network it is connected to.
  827.  
  828.   In past versions of this document I have presented near complete
  829.   versions of the various configuration files and included comments to
  830.   modify or delete lines from them as appropriate. From this version
  831.   onwards I will take a slightly different approach which I hope will
  832.   result in you having a complete set of uncluttered configuration files
  833.   that you have built from scratch so you know exactly what is in them,
  834.   and why. I'll describe each of these files, and their function, as we
  835.   come to them.
  836.  
  837.  
  838.   8.1.  Configuring the special device files in /dev
  839.  
  840.   You do not need to configure any special device files in the /dev
  841.   directory for Linux Networking. Linux does not need or use them as
  842.   other operating systems might. The devices are built dynamically in
  843.   memory by the kernel, and since they are only names there is no need
  844.   for them to have an appearance directly to you. The kernel provides
  845.   all of the programming hooks and interfaces that you need to utilise
  846.   them effectively.
  847.  
  848.  
  849.   8.2.  What information do I need before I begin ?
  850.  
  851.   Before you can configure the networking software, you will need to
  852.   know a number of pieces of information about your network connection.
  853.   Your network provider or administrator will be able to provide you
  854.   with most of them.
  855.  
  856.  
  857.   8.2.1.  IP Address.
  858.  
  859.   This is the unique machine address, in dotted decimal notation, that
  860.   your machine will use. An example is 128.253.153.54. Your network
  861.   administrator will provide you with this information.
  862.  
  863.   If you will be using a slip or plip connection you may not need this
  864.   information, so skip it until we get to the slip device.
  865.  
  866.  
  867.   If you're using the loopback device only, ie no ethernet, slip or plip
  868.   support, then you won't need an ip address as the loopback port always
  869.   uses the address 127.0.0.1.
  870.  
  871.  
  872.   8.2.2.  Network Mask (`netmask').
  873.  
  874.   For performance reasons it is desirable to limit the number of hosts
  875.   on any particular segment of a network. For this reason it is common
  876.   for network administrators to divide their network into a number of
  877.   smaller networks, known as subnets, which each have a portion of the
  878.   network addresses assigned to them. The network mask is a pattern of
  879.   bits, which when overlayed onto an address on your network, will tell
  880.   you which subnetwork it belongs to. This is very important for
  881.   routing, and if you find for example, that you can happily talk to
  882.   people outside your network, but not to some people on your own
  883.   network, then it is quite likely that you have specified an incorrect
  884.   subnet mask.
  885.  
  886.   Your network adminstrators will have chosen the netmask when the
  887.   network was designed, and therefore they should be able to supply you
  888.   with the correct mask to use. Most networks are class-C subnetworks
  889.   which use 255.255.255.0 as their netmask. Other larger networks use
  890.   class-B netmasks (255.255.0.0). The NET-2/NET-3 code will
  891.   automatically select a default mask when you assign an address to a
  892.   device. The default assumes that your network has not been subnetted.
  893.  
  894.   The NET-2/NET-3 code will choose the following masks by default:
  895.  
  896.  
  897.  
  898.        For addresses with the first byte:
  899.        1-127         255.0.0.0         (Class A)
  900.        128-191       255.255.0.0       (Class B)
  901.        192+          255.255.255.0     (Class C)
  902.  
  903.  
  904.  
  905.  
  906.   if one of these doesn't work for you, try another. If this doesn't
  907.   work ask your network administrator or local network guru (dime a
  908.   dozen) for help.
  909.  
  910.   You don't need to worry about a netmask for the loopback port, or if
  911.   you are running slip/plip.
  912.  
  913.  
  914.   8.2.3.  Network Address.
  915.  
  916.   This is your IP address masked (bitwise AND) with your netmask.  For
  917.   example:
  918.  
  919.  
  920.        If your netmask is:           255.255.255.0
  921.        and your IP address is:       128.253.154.32    &&
  922.                                      ---------------
  923.        your Network address is:      128.253.154.0     =
  924.  
  925.  
  926.  
  927.  
  928.  
  929.   8.2.4.  Broadcast Address.
  930.  
  931.   `A shout is a whisper that everyone hears whether they need to or not'
  932.  
  933.   This is normally your network address logically ORed with your netmask
  934.   inverted. This is simpler than it sounds. For a Class-C network, with
  935.   network mask 255.255.255.0, your Broadcast Address will be your
  936.   network address (calculated above), logically ORed with 0.0.0.255, the
  937.   network mask inverted.
  938.  
  939.   A worked example might look like:
  940.  
  941.  
  942.        If your netmask is:          255.255.255.0      !
  943.        the netmask inverted is:       0.  0.  0.255    =
  944.        If your Network address is:  128.253.154.0      ||
  945.                                     ----------------
  946.        Your broadcast address is:   128.253.154.255    =
  947.  
  948.  
  949.  
  950.  
  951.   Note that for historical reasons some networks use the network address
  952.   as the broadcast address. If you have any doubts contact your network
  953.   administrator.
  954.  
  955.   If you have access to a sniffer, or some other device capable of
  956.   providing you with a trace of your network traffic, then you might be
  957.   able to determine both the network and broadcast addresses by watching
  958.   other traffic on the lan. Keep an eye open for, (or filter everything
  959.   except), ethernet frames destined for the ethernet broadcast address:
  960.   ff:ff:ff:ff:ff:ff.  If any of them has an IP source address of your
  961.   local router, and the protocol ID is not ARP, then check the
  962.   destination IP address, because this datagram may well be a RIP
  963.   routing broadcast from your router, in which case the destination IP
  964.   address will be your broadcast address.
  965.  
  966.   Once again, if you're not sure, check with your network administrator,
  967.   they'd rather help you, than have you connect your machine
  968.   misconfigured.
  969.  
  970.  
  971.   8.2.5.  Router (`Gateway') Address.
  972.  
  973.   `There must be some way out of here.'
  974.  
  975.   This is the address of the machine that connects your network to the
  976.   rest of the Internet. It is your `gateway' to the outside world. A
  977.   couple of conventions exist for allocating addresses to routers which
  978.   your network might follow, they are: The router is the lowest numbered
  979.   address on the network, the router is the highest numbered host on the
  980.   network.  Probably the most common is the first, where the router will
  981.   have an address that is mostly the same as your own, except with a .1
  982.   as the last byte. eg. if your address is 128.253.154.32, then your
  983.   router might be 128.253.154.1. The router can in fact have any address
  984.   valid on your network and function properly, the address doesn't
  985.   matter at all. There may in fact even be more than one router on your
  986.   network. You will probably need to talk to your network adminstrator
  987.   to properly identify your router address.
  988.  
  989.   If you're using only loopback then you don't need a router address. If
  990.   you're using PPP then you also don't need your router address, because
  991.   PPP will automatically determine the correct address for you. If
  992.   you're using SLIP, then your router address will be your SLIP server
  993.   address.
  994.  
  995.  
  996.  
  997.  
  998.  
  999.   8.2.6.  Nameserver Address.
  1000.  
  1001.   Most machines on the net have access to a name server which translates
  1002.   human tolerable hostnames into machine tolerable addresses, and vice
  1003.   versa. Your network administrators will again tell you the address of
  1004.   your nearest nameserver. You can in fact run a nameserver on your own
  1005.   machine by running named, in which case your nameserver address will
  1006.   be 127.0.0.1, the loopback port address.  However it is not required
  1007.   that you run named at all; see section `named' for more information.
  1008.  
  1009.   If you're only using loopback then you don't need to know the
  1010.   nameserver address since you're only going to be talking to your own
  1011.   machine.
  1012.  
  1013.  
  1014.   8.2.7.  NOTE for SLIP/PLIP/PPP users.
  1015.  
  1016.   You may or may not in fact need to know any of the above information.
  1017.   Whether you do or not will depend on exactly how your network
  1018.   connection is achieved, and the capabilities of the machine at the
  1019.   other end of the link. You'll find more detail in the section relevant
  1020.   to configuration of the SLIP/PLIP and PPP devices.
  1021.  
  1022.  
  1023.   8.3.  /etc/rc.d/rc.inet1,2 or /etc/rc.net
  1024.  
  1025.   While the commands to configure your network devices can be typed
  1026.   manually each time, you will probably want to record them somewhere so
  1027.   that your network is configured automatically when you boot your
  1028.   machine.
  1029.  
  1030.   The `rc' files are specifically designed for this purpose. For the
  1031.   non-unix-wizard: `rc' file are run at bootup time by the init program
  1032.   and start up all of the basic system programs such as syslog, update,
  1033.   and cron. They are analagous to the MS-DOS autoexec.bat file, and rc
  1034.   might stand for `runtime commands'. By convention these files are kept
  1035.   under the /etc directory. The Linux Filesystem Standard doesn't go so
  1036.   far as to describe exactly where your rc files should go, stating that
  1037.   it is ok for them to follow either the BSD (/etc/rc.*) or System-V
  1038.   (/etc/rc.d/rc*) conventions.  Alan, Fred and I all use the System-V
  1039.   convention, so that is what you will see described here. This means
  1040.   that these files are found in /etc/rc.d and are called rc.inet1 and
  1041.   rc.inet2. The first rc file that gets called at bootup time is
  1042.   /etc/rc, and it in turn calls others, such as rc.inet1, which in turn
  1043.   might called rc.inet2.  It doesn't really matter where they are kept,
  1044.   or what they are called, so long as init can find them.
  1045.  
  1046.   In some distributions the rc file for the network is called rc.net and
  1047.   is in the /etc subdirectory. The rc.net file on these systems is
  1048.   simply the rc.inet1 and the rc.inet2 files combined into one file that
  1049.   gets executed. It doesn't matter where the commands appear, so long as
  1050.   you configure the interfaces before starting the network daemons and
  1051.   applications.
  1052.  
  1053.   I will refer to these files as rc.inet1 and rc.inet2, and I keep them
  1054.   in the /etc/rc.d, so if you are using one of the distributions that
  1055.   uses rc.net, or you want to keep the files somewhere else, then you
  1056.   will have to make appropriate adjustments as you go.
  1057.  
  1058.   We will be building these files from scratch as we go.
  1059.  
  1060.  
  1061.   8.3.1.  rc.inet1
  1062.  
  1063.   The rc.inet1 file configures the basic tcp/ip interaces for your
  1064.   machine using two programs: /sbin/ifconfig, and /sbin/route.
  1065.   8.3.1.1.  ifconfig
  1066.  
  1067.   /sbin/ifconfig is used for configuring your interfaces with the
  1068.   parameters that they require to function, such as their IP address,
  1069.   network mask, broadcast addresses and similar. You can use the
  1070.   ifconfig command with no parameters to display the configuration of
  1071.   all network devices. Please check the ifconfig man page for more
  1072.   detail on its use.
  1073.  
  1074.  
  1075.   8.3.1.2.  route
  1076.  
  1077.   /sbin/route is used to create, modify, and delete entries in a table
  1078.   (the routing table) that the networking code will look at when it has
  1079.   a datagram that it needs to transmit. The routing table lists
  1080.   destination address, and the interface that that address is reachable
  1081.   via. You can use the route command with no parameters to display the
  1082.   contents of the routing table. Please check the route man page for
  1083.   more detail on its use.
  1084.  
  1085.  
  1086.  
  1087.   8.3.2.  rc.inet2
  1088.  
  1089.   The rc.inet2 file starts any network daemons such as inetd, portmapper
  1090.   and so on. This will be covered in more detail in section `rc.inet2',
  1091.   so for the moment we will concentrate on rc.inet1. I have mentioned
  1092.   this file here so that if you have some other configuration, such as a
  1093.   single rc.net file you will understand what the second half of it
  1094.   represents. it is important to remember that you must start your
  1095.   network applications and daemons after you have configured your
  1096.   network devices.
  1097.  
  1098.  
  1099.   8.4.  Configuring the Loopback device (mandatory).
  1100.  
  1101.   The loopback device isn't really a hardware device. It is a software
  1102.   construct that looks like a physical interface. Its function is to
  1103.   happily allow you to connect to yourself, and to test network software
  1104.   without actually having to be connected to a network of any kind. This
  1105.   is great if you are developing network software and you have a slip
  1106.   connection.  You can write and test the code locally, and then when
  1107.   you are ready to test it on a live network, eatablish your slip
  1108.   connection and test it out. You won't hurt others users if your
  1109.   program misbehaves.
  1110.  
  1111.   By convention, the loopback device always has an IP address of
  1112.   127.0.0.1 and so you will use this address when configuring it.
  1113.  
  1114.   The loopback device for Linux is called `lo'. You will now make the
  1115.   first entry into your rc.inet1 file. The following code fragment will
  1116.   work for you:
  1117.  
  1118.  
  1119.  
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126.  
  1127.  
  1128.  
  1129.  
  1130.  
  1131.   #!/bin/sh
  1132.   #
  1133.   # rc.inet1   --  configures network devices.
  1134.   #
  1135.   # Attach the loopback device.
  1136.   /sbin/ifconfig lo 127.0.0.1
  1137.   #
  1138.   # Add a route to point to the loopback device.
  1139.   /sbin/route add 127.0.0.1
  1140.   # End loopback
  1141.   #
  1142.  
  1143.  
  1144.  
  1145.  
  1146.   You have used the ifconfig program to give the loopback interface its
  1147.   IP address, and route program to create an entry in the routing table
  1148.   that will ensure that all datagrams destined for 127.0.0.1 will be
  1149.   sent to the loopback port.
  1150.  
  1151.   There are two important points to note here.
  1152.  
  1153.   Firstly, the netmask and broadcast addresses have been allowed to take
  1154.   the default values for the loopback device described earlier in
  1155.   section `Network Mask'. To see what they are, try the ifconfig program
  1156.   without any arguments.
  1157.  
  1158.  
  1159.  
  1160.        # ifconfig
  1161.        lo        Link encap Local Loopback
  1162.                  inet addr 127.0.0.1  Bcast 127.255.255.255  Mask 255.0.0.0
  1163.                  UP BROADCAST LOOPBACK RUNNING  MTU 2000  Metric 1
  1164.                  RX packets 0 errors 0 dropped 0 overrun 0
  1165.                  TX packets 30 errors 0 dropped 0 overrun 0
  1166.        #
  1167.  
  1168.  
  1169.  
  1170.  
  1171.   Secondly, its not obvious how the route command chose the loopback
  1172.   device as the device for the route to 127.0.0.1.  The route program is
  1173.   smart enough to know that 127.0.0.1 belongs to the network supported
  1174.   by the loopback device. It works this out by checking the IP address
  1175.   and the netmask. You can use the route command with no arguments to
  1176.   display the contents of the routing table:
  1177.  
  1178.  
  1179.  
  1180.        # route
  1181.        Kernel routing table
  1182.        Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
  1183.        127.0.0.0       *               255.0.0.0       U     0      0       30 lo
  1184.        #
  1185.  
  1186.  
  1187.  
  1188.  
  1189.   Note: You might want to use the -n argument if your name resolver is
  1190.   not yet configured properly. The -n argument tells route to just
  1191.   display the numeric addresses, and to not bother looking up the name.
  1192.  
  1193.  
  1194.  
  1195.  
  1196.  
  1197.   8.5.  Configuring an ethernet device. (optional)
  1198.  
  1199.   You'll only be interested in this section  if you wish to configure an
  1200.   ethernet card, if not then skip on ahead to the next section.
  1201.  
  1202.   To configure an ethernet card is only slightly more complicated than
  1203.   configuring the loopback device. This time you should probably specify
  1204.   explicitly the network mask and the broadcast address, unless you are
  1205.   sure that the defaults will work ok, and they probably will.
  1206.  
  1207.   For this you will need the IP address that you have been assigned, the
  1208.   network mask in use on your network, and the broadcast address in use.
  1209.  
  1210.   The first ethernet device for a Linux system is called `eth0', the
  1211.   second `eth1' and so forth. You will now add a section to your
  1212.   rc.inet1 file. The following code fragment will work for you if you
  1213.   change the addresses specified for real ones:
  1214.  
  1215.  
  1216.  
  1217.        #
  1218.        # Attach an ethernet device
  1219.        #
  1220.        #  configure the IP address, netmask and broadcast address.
  1221.        /sbin/ifconfig eth0 IPA.IPA.IPA.IPA
  1222.        /sbin/ifconfig eth0 netmask NMK.NMK.NMK.NMK
  1223.        /sbin/ifconfig eth0 broadcast BCA.BCA.BCA.BCA
  1224.        #
  1225.        # add a network route to point to it:
  1226.        /sbin/route add -net NWA.NWA.NWA.NWA device eth0
  1227.        #
  1228.        # End ethernet
  1229.        #
  1230.  
  1231.  
  1232.  
  1233.  
  1234.   Where:
  1235.  
  1236.      IPA.IPA.IPA.IPA
  1237.         represents your IP Address.
  1238.  
  1239.      NMK.NMK.NMK.NMK
  1240.         represents your netmask.
  1241.  
  1242.      BCA.BCA.BCA.BCA
  1243.         represents your Broadcast address.
  1244.  
  1245.      NWA.NWA.NWA.NWA
  1246.         represents your Network Address.
  1247.  
  1248.   Note the use of the -net argument to the route command.  This tells
  1249.   route that the route to be added is a route to a network, and not to a
  1250.   host. There is an alternative method of achieving this, you can leave
  1251.   off the -net if you have the network address listed in the
  1252.   /etc/networks file. This is covered later in section `/etc/networks'.
  1253.  
  1254.  
  1255.   8.6.  Configuring a SLIP device (optional)
  1256.  
  1257.   SLIP (Serial Line Internet Protocol) allows you to use tcp/ip over a
  1258.   serial line, be that a phone line with a dialup modem, or a leased
  1259.   line of some sort.  Of course to use slip you need access to a slip-
  1260.   server in your area. Many universities and businesses provide slip
  1261.   access all over the world.
  1262.  
  1263.   Slip uses the serial ports on your machine to carry IP datagrams. To
  1264.   do this it must take control of the serial device. Slip device names
  1265.   are named sl0, sl1 etc. How do these correspond to your serial devices
  1266.   ? The networking code uses what is called an ioctl (i/o control) call
  1267.   to change the serial devices into slip devices. There are two programs
  1268.   supplied that can do this, they are called dip and slattach
  1269.  
  1270.  
  1271.   8.6.1.  dip
  1272.  
  1273.   dip (Dialup IP) is a smart program that is able to set the speed of
  1274.   the serial device, command your modem to dial the remote end of the
  1275.   link, automatically log you into the remote server, search for
  1276.   messages sent to you by the server, and extract information for them
  1277.   such as your IP address, and perform the ioctl necessary to switch
  1278.   your serial port into slip mode. dip has a powerful scripting ability,
  1279.   and it is this that you can exploit to automate your logon procedure.
  1280.  
  1281.   dip comes supplied in the net-032/net-tools package.  There have been
  1282.   a number of other versions of dip produced which offer a variety of
  1283.   new features. You will find them at:
  1284.  
  1285.   sunsite.unc.edu
  1286.  
  1287.  
  1288.        /pub/Linux/system/Network/serial/dip*
  1289.  
  1290.  
  1291.  
  1292.  
  1293.   The dip-uri version seems to be the more popular, but I suggest you
  1294.   take a close look at each to determine which offers enhancements that
  1295.   you find useful.
  1296.  
  1297.  
  1298.   8.6.2.  slattach
  1299.  
  1300.   slattach on the other hand is a very simple program, that is very easy
  1301.   to use, but does not have the sophistication of dip.  slattach is
  1302.   ideal to use where you have a permanent connection to your server,
  1303.   such as a physical cable, or a leased line.
  1304.  
  1305.  
  1306.   8.6.3.  When do I use which ?
  1307.  
  1308.   You would use dip when your link to the machine that is your slip
  1309.   server is a dialup modem, or some other termporary link. You would use
  1310.   slattach when you have a leased line, perhaps a cable, between your
  1311.   machine and the server, and there is no special action needed to get
  1312.   the link working. See section `Permanent Slip connection' for more
  1313.   information.
  1314.  
  1315.   Configuring slip is much like configuring an Ethernet interface (read
  1316.   section `Configuring an ethernet device' above). However there are a
  1317.   few key differences.
  1318.  
  1319.   First of all, slip links are unlink ethernet networks in that there is
  1320.   only ever two hosts on the network, one at each end of the link.
  1321.   Unlike an ethernet that is available for use as soon are you are
  1322.   cabled, with slip, depending on the type of link you have, you may
  1323.   have to initialise your network connection in some special way.
  1324.  
  1325.   If you are using dip then this would not normally be done at boot
  1326.   time, but at some time later, when you were ready to use the link.  It
  1327.   is possible to automate this procedure. If you are using slattach then
  1328.   you will probably want to add a section to your rc.inet1 file.  This
  1329.   will be described soon.
  1330.  
  1331.   There are two major types of slip servers: Dynamic IP address servers
  1332.   and static IP address servers. Almost every slip server will prompt
  1333.   you to login using a username and password when dialing in. dip can
  1334.   handle logging you in automatically.
  1335.  
  1336.  
  1337.   8.6.4.  Static slip server with a dialup line and DIP.
  1338.  
  1339.   A static slip server in one in which you have been supplied an IP
  1340.   address that is exclusively yours. Each time you connect to the
  1341.   server, you will configure your slip port with that address. The
  1342.   static slip server will answer your modem call, possibly prompt you
  1343.   for a username and password, and then route any datagrams destined for
  1344.   your address to you via that connection. If you have a static server,
  1345.   then you may want to put entries for your hostname and IP address
  1346.   (since you know what it will be) into your /etc/hosts. You should also
  1347.   configure some other files such as: rc.inet2, host.conf, resolv.conf,
  1348.   /etc/HOSTNAME, and rc.local. Remember that when configuring rc.inet1,
  1349.   you don't need to add any special commands for your slip connection
  1350.   since it is dip that does all of the hard work for you in configuring
  1351.   your interface. You will need to give dip the appropriate information,
  1352.   and it will configure the interface for you after commanding the modem
  1353.   to establish the call, and logging you into your slip server.
  1354.  
  1355.   If this is how your slip server works then you can move to section
  1356.   `Using Dip' to learn how to configure dip appropriately.
  1357.  
  1358.  
  1359.   8.6.5.  Dynamic slip server with a dialup line and DIP.
  1360.  
  1361.   A dynamic slip server is one which allocates you an IP address
  1362.   randomly, from a pool of addresses, each time you logon. This means
  1363.   that there is no guarantee that you will have any particular address
  1364.   each time, and that address may well be used by someone else after you
  1365.   have logged off.  The netework administrator who configured the slip
  1366.   server will have assigned a pool of address for the slip server to
  1367.   use, when the server receives a new incoming call, it finds the first
  1368.   unused address, guides the caller through the login process, and then
  1369.   prints a welcome message that contains the IP address it has
  1370.   allocated, and will proceed to use that IP address for the duration of
  1371.   that call.
  1372.  
  1373.   Configuring for this type of server is similar to configuring for a
  1374.   static server, except that you must add a step where you obtain the IP
  1375.   address that the server has allocated for you and configure your slip
  1376.   device with that.
  1377.  
  1378.   Again, dip does the hard work, and new versions are smart enough to
  1379.   not only log you in, but to also be able to automatically read the IP
  1380.   address printed in the welcome message, and store it so that you can
  1381.   have it configure your slip device with it.
  1382.  
  1383.   If this is how your slip server works then you can move to section
  1384.   `Using Dip' to learn how to configure dip appropriately.
  1385.  
  1386.  
  1387.   8.6.6.  Using DIP.
  1388.  
  1389.   As explained earlier, dip is a powerful program that can simplify and
  1390.   automate the process of dialling into the slip server, logging you in,
  1391.   starting the connection, and configuring your slip devices with the
  1392.   appropriate ifconfig and route commands.
  1393.  
  1394.  
  1395.   Essentially to use dip you'll write a `chat script', which is
  1396.   basically a list of commands that dip understands that tell dip how to
  1397.   perform each of the actions you want it to perform. See sample.dip in
  1398.   the net-032 package for an explanation.  dip is quite a powerful
  1399.   program, with many options. Instead of going into all of them here you
  1400.   should looks at the man page, README and sample files from tsx-11, and
  1401.   the net-032 distribution.
  1402.  
  1403.   You may notice that the sample.dip script assumes that you're using a
  1404.   static slip server, so you know what your IP address is beforehand.
  1405.   For dynamic slip servers, the newer versions of dip include a command
  1406.   you can use to automatically read and configure your slip device with
  1407.   the IP address that the dynamic server allocates for you. The
  1408.   following sample was supplied by Paul Mossip, and is probably a good
  1409.   starting point for you. You might like to save it as /etc/dipscript:
  1410.  
  1411.  
  1412.  
  1413.  
  1414.  
  1415.  
  1416.  
  1417.  
  1418.  
  1419.  
  1420.  
  1421.  
  1422.  
  1423.  
  1424.  
  1425.  
  1426.  
  1427.  
  1428.  
  1429.  
  1430.  
  1431.  
  1432.  
  1433.  
  1434.  
  1435.  
  1436.  
  1437.  
  1438.  
  1439.  
  1440.  
  1441.  
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.  
  1457.  
  1458.  
  1459.  
  1460.  
  1461.   #
  1462.   # Connection script for SLIP to knoware.nl.mugnet.org
  1463.   #
  1464.  
  1465.     # Fetch the IP address of our target host.
  1466.   main:
  1467.  
  1468.     # Set the desired serial port and speed.
  1469.     port /dev/cua0
  1470.     speed 38400
  1471.  
  1472.     # Reset the modem and terminal line.
  1473.     reset
  1474.  
  1475.     # Prepare for dialing.
  1476.     send ATZ1\r
  1477.     wait OK 4
  1478.     if $errlvl != 0 goto error
  1479.     dial 666-0999                    ## Change to your server's number!
  1480.     if $errlvl != 0 goto error
  1481.     wait CONNECT 60
  1482.     if $errlvl != 0 goto error
  1483.  
  1484.     # We are connected.  Login to the system.
  1485.   login:
  1486.     sleep 3
  1487.     send \r\n\r\n
  1488.     wait gracelands> 20              ## Change to your server's prompt
  1489.     if $errlvl != 0 goto error
  1490.     send login\n
  1491.     wait name: 10                    ## Wait username: prompt
  1492.     if $errlvl != 0 goto erro
  1493.     send elvisp\n                    ## Change to your own!
  1494.     wait ord: 10                     ## Wait password prompt
  1495.     if $errlvl != 0 goto error
  1496.     send alive\n                     ## Change to your own!
  1497.     wait gracelands> 10
  1498.     if $errlvl != 0 goto error
  1499.     send slip\n                      ## Change to suit your server
  1500.     wait SLIP 30                     ## Wait for SLIP prompt
  1501.     if $errlvl != 0 goto error
  1502.     get $local remote 10             ## Assumes the server sends your IP..
  1503.     if $errlvl != 0 goto error       ## address as soon as you enter slip.
  1504.     get $remote gracelands           ## slip server address from /etc/hosts
  1505.   done:
  1506.     print CONNECTED to $remote with address $rmtip we are $local
  1507.     default
  1508.     mode SLIP
  1509.     goto exit
  1510.   error:
  1511.     print SLIP to $host failed.
  1512.   exit:
  1513.   #
  1514.   # End dip script
  1515.  
  1516. ---End of part 1/3---
  1517.  
  1518.  
  1519.