home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 3 / CD ACTUAL 3.iso / linux / docs / faqs / net-2-fa < prev    next >
Encoding:
Text File  |  1995-09-10  |  197.9 KB  |  5,778 lines

  1.   Linux NET-2/NET-3 HOWTO
  2.   Terry Dawson, terryd@extro.ucc.su.oz.au
  3.   v3.3, 13 August 1995
  4.  
  5.   This document aims to describe how to obtain, install and configure
  6.   the Linux NET-2 and NET-3 networking software. Some answers to some of
  7.   the more frequently asked questions are included in the appendix. This
  8.   document is not designed to teach you about tcp/ip networking, though
  9.   some information of this kind is included where possible. Pointers to
  10.   other documentation which does teach tcp/ip networking principles are
  11.   listed.
  12.  
  13.   1.  Introduction.
  14.  
  15.   This is the Linux NET-2-HOWTO. This document is a complete rewrite of
  16.   the earlier NET-FAQ and of the subsequent NET-2-HOWTO versions 1.0+.
  17.   This document is for the new NET-2 and NET-3 tcp/ip networking code
  18.   for Linux kernels 1.0 and above.
  19.  
  20.  
  21.   1.1.  Changes from the previous release.
  22.  
  23.  
  24.   Additions:
  25.           Appletalk - thank you Cees de Groot.
  26.           IP_MASQUERADE - Thank you Ken Eves.
  27.           ipalias - thanks Patrick Ashmore, pda@prism.procyon.com
  28.           More ISDN information
  29.  
  30.   Corrections/Updates:
  31.           Updated V.35 information, thank you Matti Aarnio.
  32.  
  33.  
  34.  
  35.  
  36.  
  37.   1.2.  A brief development history of Linux Networking.
  38.  
  39.   Ross Biro <biro@yggdrasil.com> wrote the original kernel based
  40.   networking code for Linux. He used ethernet drivers written by Donald
  41.   Becker <becker@cesdis1.gsfc.nasa.gov>, a slip driver written by
  42.   Laurence Culhane <loz@holmes.demon.co.uk>, and a D-Link driver by
  43.   Bj0rn Ekwall <bj0rn@blox.se>.
  44.  
  45.   The further development of the Linux networking code was later taken
  46.   up by Fred van Kempen <waltje@hacktic.nl>, who took Ross's code and
  47.   produced the NET-2 release of network code. NET-2 went through a
  48.   number of revisions until release NET-2d, when Alan Cox
  49.   <iialan@iifeak.swan.ac.uk> set about debugging the Fred's code with
  50.   the aim of producing a stable and working release of code for
  51.   incorporation into the standard kernel releases. This code was called
  52.   originally called NET-2D(ebugged), and was incorporated into the
  53.   standard kernel releases some time before Linux vers 1.0 was released.
  54.  
  55.   PPP support was added by Michael Callahan, <callahan@maths.ox.ac.uk>
  56.   and Al Longyear, <longyear@netcom.com>, originally as patches to the
  57.   kernel, and in later releases as part of the standard kernel
  58.   distribution.
  59.  
  60.   With the release of Linux vers 1.0, Linus made a decision to continue
  61.   supporting Alan's code as the standard network kernel code.
  62.  
  63.   The latest version of the code, NET-3, appears in kernel releases
  64.   1.1.5 and later, and is essentially the same code, but with many
  65.   fixes, corrections and enhancements.
  66.  
  67.   Alan has added such features as IPX and AX.25 modules.  Florian La
  68.   Roche, <flla@stud.uni-sb.de> has produced an updated distribution of
  69.   network applications.
  70.  
  71.   NIIBE Yutaka has enhanced the PLIP driver.
  72.  
  73.   Jonathan Naylor has taken up development work on the AX.25 code and
  74.   has added many features including NetRom support.
  75.  
  76.   Many other people have made contributions by way of bug fixes, ports
  77.   of applications and by writing device drivers.
  78.  
  79.  
  80.   2.  Disclaimer.
  81.  
  82.   The Linux networking code is a brand new implementation of kernel
  83.   based tcp/ip networking. It has been developed from scratch, and is
  84.   not a port of any existing kernel networking code.
  85.  
  86.   Because it is a fresh implementation it may still have a number of
  87.   bugs or problems with it, and there may be a number of fixes and
  88.   patches released.  If you are worried about problems then just stick
  89.   to the version of network code released with the standard kernel
  90.   releases and utility sets. These standard kernel releases are denoted
  91.   by an even number in the second digit, 1.2.7 for example is a
  92.   production release. The kernel versions with an odd number as the
  93.   second digit are alpha versions and you should expect to find problems
  94.   or bugs with these version as they are test releases.  The networking
  95.   code has a small team of dedicated people working on it, with a cast
  96.   of thousands testing the code, collecting and reporting bugs and
  97.   problems, providing fixes for problems. Any problem you experience is
  98.   likely to have already been reported, and be being worked on, and will
  99.   possibly be corrected soon, so be patient, or if you can help, offer
  100.   your assistance.
  101.  
  102.   We do not, and cannot, know everything there is to know about the
  103.   Linux network software. Please accept and be warned that this document
  104.   probably does contain errors. Please read any README files that are
  105.   included with any of the various pieces of software described in this
  106.   document for more detailed and accurate information. We will attempt
  107.   to keep this document as error-free and up-to-date as possible.
  108.   Versions of software are current as at time of writing.
  109.  
  110.   NOTE: While its name may appear similar to the Berkeley Software
  111.   Distribution NET-2 release, the Linux network code actually has
  112.   nothing at all to do with it. Please don't confuse them.
  113.  
  114.  
  115.   3.  Questions already ?
  116.  
  117.   `The only stupid question is the unasked one.'
  118.  
  119.   If you have general configuration questions, and you have been unable
  120.   to find the answers after reading the other various HOWTO and FAQ
  121.   files, then you would be best served to post them to
  122.   comp.os.linux.networking, or, if you believe your question to be
  123.   specifically related to the Linux Network code, then you could post it
  124.   to the NET mailing list. Please include as much relevant information
  125.   as possible, there is nothing more annoying than to have a bug or
  126.   problem reported without sufficient information to even begin
  127.   searching for it.
  128.  
  129.   Version numbers and revisions of code, a detailed account of the
  130.   problem, and the circumstances that caused it to occur, are essential.
  131.   Trace and debug messages where available should also be considered
  132.   mandatory.
  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 people 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 test instructions.
  143.  
  144.   To join the Linux linux-net channel on the mail list server, send mail
  145.   to:
  146.  
  147.  
  148.        Majordomo@vger.rutgers.edu
  149.  
  150.        with the line:
  151.  
  152.        subscribe linux-net
  153.  
  154.        as the message body and you will be subscribed. The subject line is ignored.
  155.  
  156.  
  157.  
  158.  
  159.   Remember, keep in mind that the linux-net channel is for development
  160.   discussions only.
  161.  
  162.   A PPP list has been established. To join it, use the same procedure as
  163.   for joining the linux-net channel, except specify linux-ppp in place
  164.   of linux-net in the message body.
  165.  
  166.   Note also that a linux-hams list has been established. This list has
  167.   been established for the discussion of programs related to Amateur
  168.   Radio. To join it, follow the same procedure as for joining the liux-
  169.   net or linux-ppp channels, except specify linux-hams in linux-net in
  170.   the message body.
  171.  
  172.  
  173.   4.  Related Documentation. (Where to learn about tcp/ip)
  174.  
  175.   If you are looking for information about tcp/ip networking that this
  176.   HOWTO does not cover, then you might try the following sources, as
  177.   they provide some very useful information.
  178.  
  179.   Olaf Kirch has written a substantial document as part of the Linux
  180.   Documentation Project entitled the Linux Network Administration Guide.
  181.   This is an excellent document. It covers all aspects of setting up and
  182.   using the tcp/ip networking under Linux, including NFS, UUCP, mail,
  183.   News, nameserver etc.
  184.  
  185.   Olaf's book supplements this HOWTO, taking up where this document
  186.   leaves off. This document covers the installation and configuration of
  187.   the NET code, i.e. `How to put your machine on the net'. If you are
  188.   new to unix networking, then I strongly urge you to obtain a copy and
  189.   read it first. It will answer a lot of questions for you that are not
  190.   within the scope of this document.
  191.  
  192.   The current release version is available in:
  193.  
  194.   sunsite.unc.edu
  195.  
  196.  
  197.        /pub/Linux/docs/linux-doc-project/network-guide/*
  198.  
  199.   There are various versions of the document in this directory. The most
  200.   common formats are supported, being plain ascii, Postscript, DVI,
  201.   Latex and groff.
  202.  
  203.   The Linux Network Administrators Guide is Copyright (c) by Olaf Kirch.
  204.  
  205.   There are now quite a variety of companies publishing Linux
  206.   documentation so if you want to avoid having to retrieve and print the
  207.   document yourself you should have little trouble finding Olaf's book
  208.   in a bound form over the counter at any good bookshop.
  209.  
  210.   You should also read the other HOWTO documents relevant to networking
  211.   with Linux.
  212.  
  213.   They are:
  214.  
  215.   The Ethernet-HOWTO <http://sunsite.unc.edu/mdw/HOWTO/Ethernet-
  216.   HOWTO.html>, which you should read if you intend using an ethernet
  217.   card with Linux. It includes a lot of detail on how to select, install
  218.   and configure an ethernet card for Linux and on how to diagnose
  219.   problems related to the ethernet driver.
  220.  
  221.   The PPP-HOWTO <http://sunsite.unc.edu/mdw/HOWTO/PPP-HOWTO.html> if you
  222.   intend using ppp.
  223.  
  224.   The Serial-HOWTO <http://sunsite.unc.edu/mdw/HOWTO/Serial-HOWTO.html>
  225.   if you intend using slip or ppp in server mode.
  226.  
  227.   The NIS-HOWTO <http://sunsite.unc.edu/mdw/HOWTO/NIS-HOWTO.html> if you
  228.   are interested in running a version of Sun's Network Information
  229.   Service.
  230.  
  231.   The HAM-HOWTO <http://sunsite.unc.edu/mdw/HOWTO/HAM-HOWTO.html> if you
  232.   are interested in configuring and running amateur radio software.
  233.  
  234.   The Mail-HOWTO <http://sunsite.unc.edu/mdw/HOWTO/Mail-HOWTO.html> and
  235.   the News-HOWTO <http://sunsite.unc.edu/mdw/HOWTO/News-HOWTO.html> for
  236.   some specific information on setting up Mail and News on your system.
  237.  
  238.   The UUCP-HOWTO <http://sunsite.unc.edu/mdw/HOWTO/UUCP-HOWTO.html> if
  239.   you will be connecting to the net via UUCP.
  240.  
  241.   The Firewall-HOWTO <http://sunsite.unc.edu/mdw/HOWTO/Firewall-
  242.   HOWTO.html> if you want to build a Linux based Firewall gateway for
  243.   your network.
  244.  
  245.   If you are after some basic tutorial information on tcp/ip networking
  246.   generally, then I recommend you take a look at the following
  247.   documents:
  248.  
  249.  
  250.      tcp/ip introduction
  251.         text version <ftp://athos.rutgers.edu/runet/tcp-ip-intro.doc>,
  252.         postscript version <ftp://athos.rutgers.edu/runet/tcp-ip-
  253.         intro.ps>.
  254.  
  255.      tcp/ip administration
  256.         text version <ftp://athos.rutgers.edu/runet/tcp-ip-admin.doc>,
  257.         postscript version <ftp://athos.rutgers.edu/runet/tcp-ip-
  258.         admin.ps>.
  259.  
  260.   If you are after some more detailed information on tcp/ip networking
  261.   then I highly recommend:
  262.  
  263.  
  264.  
  265.   "Internetworking with TCP/IP"
  266.   by Douglas E. Comer
  267.  
  268.   ISBN 0-13-474321-0
  269.   Prentice Hall publications.
  270.  
  271.  
  272.  
  273.  
  274.   If you are wanting to learn about how to write network applications in
  275.   a Unix compatible environment then I also highly recommend:
  276.  
  277.  
  278.  
  279.        "Unix Network Programming"
  280.        by W. Richard Stevens
  281.  
  282.        ISBN 0-13-949876-1
  283.        Prentice Hall publications.
  284.  
  285.  
  286.  
  287.  
  288.  
  289.   4.1.  New versions of this document.
  290.  
  291.   If your copy of this document is more than two months old then I
  292.   strongly recommend you obtain a newer version. The networking support
  293.   for Linux is changing very rapidly with new enhancements and features,
  294.   so this document also changes fairly frequently. The latest released
  295.   version of this document can always be retrieved by anonymous ftp
  296.   from:
  297.  
  298.   sunsite.unc.edu
  299.  
  300.  
  301.        /pub/Linux/docs/HOWTO/NET-2-HOWTO
  302.  
  303.        or:
  304.  
  305.        /pub/Linux/docs/HOWTO/other-formats/NET-2-HOWTO{-html.tar,ps,dvi}.gz
  306.  
  307.  
  308.  
  309.  
  310.   or via the World Wide Web from the Linux Documentation Project Web
  311.   Server <http://sunsite.unc.edu/mdw/linux.html>, at page: NET-2-HOWTO
  312.   <http://sunsite.unc.edu/mdw/HOWTO/NET-2-HOWTO.html> or directly from
  313.   me, <terryd@extro.ucc.su.oz.au>. It will also be posted to the
  314.   newsgroups: comp.os.linux.networking, comp.os.linux.answers, and
  315.   news.answers from time to time.
  316.  
  317.   You can find news.answers FAQ postings, including this one, archived
  318.   on rtfm.mit.edu:/pub/usenet.
  319.  
  320.  
  321.   4.2.  Feedback.
  322.  
  323.   Please send any comments, updates, or suggestions to me,
  324.   <terryd@extro.ucc.su.oz.au>. The sooner I get feedback, the sooner I
  325.   can update and correct this document. If you find any problems with
  326.   it, please mail me instead of posting to one of the newsgroups, as I
  327.   may miss it.
  328.  
  329.  
  330.  
  331.   5.  Some terms used in this document.
  332.  
  333.   You will often see the terms client and server used in this document.
  334.   They are normally fairly specific terms but in this document I have
  335.   generalised their definitions a little so that they mean the
  336.   following:
  337.  
  338.      client
  339.         The machine or program that initiates an action or a connection
  340.         for the purpose of gaining use of some service or data.
  341.  
  342.      server
  343.         The machine or program that accepts incoming connections from
  344.         multiple remote machines and provides a service or data to
  345.         those.
  346.  
  347.   These definitions are not very reliable either, but they provide a
  348.   means of distinguishing the ends of peer to peer systems such as slip
  349.   or ppp which truly do not actually have clients and servers.
  350.  
  351.   Other terms you will see are:
  352.  
  353.  
  354.      IP address
  355.         This is a number that uniquely identifies a TCP/IP host on the
  356.         network. The address is 4 bytes long and is usually represented
  357.         in what is called the "dotted decimal notation", where each byte
  358.         is represented in decimal from with dots `.' between them.
  359.  
  360.      Hardware address
  361.         This is a number that uniquely identifies a host in a physical
  362.         network at the datalink layer. Examples of this are Ethernet
  363.         Addresses or AX.25 Addresses.
  364.  
  365.      datagram
  366.         A datagram is a discrete package of data and headers which
  367.         contain addresses, which is the basic unit of transmission
  368.         across an IP network. You might also hear this called a
  369.         `packet'.
  370.  
  371.      MTU
  372.         The Maximum Transmission Unit (MTU) is a parameter that
  373.         determines the largest datagram than can be transmitted by an IP
  374.         interface without it needing to be broken down into smaller
  375.         units. The MTU should be larger than the largest datagram you
  376.         wish to transmit unfragmented. Note, this only prevents
  377.         fragmentation locally, some other link in the path may have a
  378.         smaller MTU and the datagram will be fragmented there. Typical
  379.         values are 1500 bytes for an ethernet interface, or 576 bytes
  380.         for a SLIP interface.
  381.  
  382.      MSS
  383.         The Maximum Segment Size (MSS) is the largest quantity of data
  384.         that can be transmitted at one time. If you want to prevent
  385.         local fragmentation MSS would equal MTU-IP header.
  386.  
  387.      window
  388.         The window is the largest amount of data that the receiving end
  389.         can accept at a given point in time.
  390.  
  391.      route
  392.         The route is the path that your datagrams take through the
  393.         network to reach their destination.
  394.  
  395.      ARP
  396.         This is an acronym for the  Address Resolution Protocol and this
  397.         is how a network machine associates an IP Address with a
  398.         hardware address.
  399.  
  400.  
  401.   6.  NET-2/NET-3 Supported functionality.
  402.  
  403.   The NET code is a complete kernel based implementation of tcp/ip for
  404.   Linux.
  405.  
  406.  
  407.   6.1.  General Support
  408.  
  409.   The recent NET-2 and NET-3 versions of code support:
  410.  
  411.      Ethernet Cards
  412.         most popular ethernet cards are supported. Including some
  413.         portable, pocket adaptors and PCI.
  414.  
  415.      SLIP (Serial Line IP) and PPP (Point to Point Protocol)
  416.         for tcp/ip networking over serial lines such as the telephone
  417.         via modem, or a local cable between two machines.
  418.  
  419.      Van Jacobsen Header Compression
  420.         for compressing the tcp/ip headers to improve slip/ppp
  421.         performance over low speed lines.
  422.  
  423.      PLIP (Parallel Lines IP)
  424.         to allow local connections between two machines using your
  425.         printer ports.
  426.  
  427.      EQL Load balancing
  428.         allows you to use two (or more) links to connect your machine to
  429.         another machine or the Internet (provided your ISP supports it)
  430.         to effectively double your bandwidth. New release kernels
  431.         support this.
  432.  
  433.      NFS (Networked File System)
  434.         to allow you to remotely mount another machines filesystems
  435.         across a network connection.
  436.  
  437.      IPX (Novell)
  438.         to allow you to write custom IPX applications, or to use Linux
  439.         as an IPX router.
  440.  
  441.      Sun's Network Information System - NIS
  442.         An NIS implementation has been ported to Linux should you wish
  443.         to use it.
  444.  
  445.      Amateur Radio Support
  446.         A number of features for Amateur Radio Operators are now
  447.         supported.
  448.  
  449.      ARCNet
  450.         An ARCNet driver has been written and is included in recent
  451.         kernels. It might not be as fast as ethernet but the cards are
  452.         much cheaper.
  453.  
  454.      IBM's Token Ring
  455.         to allow linux to be installed on a Token Ring lan. An
  456.         experimental Token Ring driver has been written is included in
  457.         recent kernels.
  458.  
  459.      Appletalk
  460.         Or is this EtherTalk ? Either way, I think this will let you
  461.         shares files and printers with your Macintosh. See `Experimental
  462.         and Developmental modules.'  below.
  463.      WaveLan Wireless Lan Card support
  464.         to allow you to operate your linux machine in a mobile fashion
  465.         or at some distance from your network. Support for the WaveLan
  466.         Wireless lan card is now included in recent kernels.
  467.  
  468.      ISDN
  469.         There is some experimental support for some proprietry ISDN
  470.         cards available. See `Experimental and Developmental modules.'
  471.         below.
  472.  
  473.      ATM
  474.         There is a team of programmers working to provide ATM support
  475.         for Linux.
  476.  
  477.      IP firewalling
  478.         to assist in configuring your Linux machine as a secure firewall
  479.         gateway.
  480.  
  481.      IP Accounting
  482.         to allow you to keep track of who is using how much of your
  483.         network.
  484.  
  485.   The NET-2 and NET-3 network code does not yet currently support:
  486.  
  487.  
  488.      SPX/NCP (Novell Netware) support
  489.         to allow Linux to serve and mount Novell network filesystems or
  490.         use Novell prinetd. This is being worked on but due to the
  491.         proprietry nature of the product it may take some time to do.
  492.  
  493.      FDDI
  494.         There is currently no support that I know of for FDDI cards for
  495.         Linux.
  496.  
  497.      System-V streams
  498.         there is a team of people working on System-V streams for Linux,
  499.         details are presented later.
  500.  
  501.  
  502.   6.2.  Supported Ethernet cards.
  503.  
  504.   The 1.2.0 linux kernel release supports the following types of
  505.   Ethernet cards:
  506.  
  507.  
  508.   o  WD80*3 and close compatibles.
  509.  
  510.   o  SMC Ultra.
  511.  
  512.   o  AMD LANCE and PCnet (AT1500 and NE2100) and close compatibles.
  513.  
  514.   o  3Com 3c501 (obselete and very slow).
  515.  
  516.   o  3Com 3c503.
  517.  
  518.   o  3Com 3c505.
  519.  
  520.   o  3Com 3c507.
  521.  
  522.   o  3Com 3c509/3c579.
  523.  
  524.   o  Cabletron E21xx.
  525.  
  526.   o  DEPCA and close compatibles.
  527.  
  528.  
  529.   o  EtherWorks 3.
  530.  
  531.   o  ARCNet.
  532.  
  533.   o  AT1700 (not clones).
  534.  
  535.   o  EtherExpress.
  536.  
  537.   o  NI5210 and close compatibles.
  538.  
  539.   o  NI6510.
  540.  
  541.   o  WaveLAN.
  542.  
  543.   o  HP PCLAN+ (27247B and 27252A).
  544.  
  545.   o  HP PCLAN (27245 and other 27xxx series).
  546.  
  547.   o  NE2000/NE1000 and close compatibles.
  548.  
  549.   o  SK_G16.
  550.  
  551.   o  Ansel Communications EISA 3200.
  552.  
  553.   o  Apricot Xen-II on board ethernet.
  554.  
  555.   o  DE425, DE434, DE435.
  556.  
  557.   o  Zenith Z-Note.
  558.  
  559.   o  AT-LAN-TEC/RealTek pocket adaptor.
  560.  
  561.   o  D-Link DE600 pocket adaptor and close compatibles.
  562.  
  563.   o  D-Link DE620 pocket adaptor and close compatibles.
  564.  
  565.   Later versions of the Kernel software may support a wider variety of
  566.   cards.
  567.  
  568.   If you intend using and ethernet card with Linux you should read the
  569.   Ethernet-HOWTO <ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO/Ethernet-
  570.   HOWTO> as it contains a lot of very useful information on the
  571.   supported ethernet cards, including information on how to choose an
  572.   ethernet card if you are intending to puchase some specifically for
  573.   Linux.
  574.  
  575.   As mentioned above, Linux supports other means of network connection
  576.   if you don't have access to an ethernet card or connection. Many
  577.   universities and businesses worldwide offer some form of dial-up
  578.   network access. Generally these forms of access will offer an option
  579.   of either SLIP or PPP access, so you will be well catered for. All you
  580.   will need is a telephone modem, the one you already have may well be
  581.   good enough, and to configure your Linux system appropriately. There
  582.   are sections below that describe exactly what you need.
  583.  
  584.  
  585.   6.3.  Support for Amateur Radio
  586.  
  587.   Linux now supports a number of features specifically for Amateur
  588.   Radio. The latest alpha kernels are now distributed with standard
  589.   support for:
  590.  
  591.  
  592.      AX.25 Support
  593.         Alan Cox and Jonathan Naylor have kernel based AX.25 socket
  594.         support working.
  595.      Netrom Support
  596.         Jonathan Naylor is developing kernel based NetRom support. It is
  597.         still experimental but is progressing well and is available for
  598.         testing.
  599.  
  600.      Ottawa PI Card
  601.         A mature driver for the Ottawa PI card has been developed by
  602.         Dave Perry of the Ottawa Packet Radio Group.
  603.  
  604.      Generic SCC card driver
  605.         A generic driver for SCC cards is now included in alpha kernels
  606.         developed by Joerg Reuter.
  607.  
  608.   Further detail on the Amateur Radio support can be found in the HAM-
  609.   HOWTO <http://sunsite.unc.edu/mdw/HOWTO/HAM-HOWTO.html>.
  610.  
  611.  
  612.  
  613.   7.  Getting the NET-2/NET-3 software.
  614.  
  615.   Before you can configure the networking software you must obtain all
  616.   of the bits and pieces that make it up. These include the current
  617.   version of the kernel code (version 1.0 or later), the correct system
  618.   libraries, the tcp/ip configuration programs and files (e.g.
  619.   /sbin/ifconfig, /etc/hosts etc.), and finally a set of network
  620.   application programs (such as telnet, ftp, rlogin etc.).
  621.  
  622.   If you obtained Linux from a distribution you may already have all
  623.   that you need. Check and make sure that you do. For example, some
  624.   Linux distributions come with all of the network configuration files,
  625.   binaries, libraries, and kernel installed, so there's no reason to get
  626.   the following files.
  627.  
  628.   NOTE: they may be in directories and files different to those
  629.   specified in this HOWTO document
  630.  
  631.   If you DO have the network software, skip to the `Configuring the
  632.   kernel' section. If you DO NOT have the network software follow the
  633.   following directions.
  634.  
  635.  
  636.   7.1.  The kernel source.
  637.  
  638.   Version 1.2.0 of the Linux kernel is the production version. Any of
  639.   the Linux kernels after that release are enhancements or bug fixes. If
  640.   you feel at all concerned about the possibility of having to patch and
  641.   modify the kernel source, then you should stick to this release, as it
  642.   will do most of what you want it to. In the case of the networking
  643.   code though, I strongly suggest you just take a deep breath and follow
  644.   the newer releases of code, as there have been many changes in the
  645.   newer version kernels that affect networking. I know you hear it from
  646.   everyone and everywhere, but when trying out any new version of kernel
  647.   software you should always ensure that you have sufficient backups of
  648.   your system just in case something goes seriously wrong while you are
  649.   testing.
  650.  
  651.   The current kernel version is found in:
  652.  
  653.   ftp.funet.fi
  654.  
  655.  
  656.        /pub/OS/Linux/PEOPLE/Linus/v1.2/linux-1.2.0.tar.gz
  657.  
  658.  
  659.  
  660.  
  661.   This is a gzipped file, so you will need gzip to uncompress it.
  662.  
  663.   To install it, try:
  664.  
  665.  
  666.  
  667.        # cd /usr/src
  668.        # mv linux linux.old
  669.        # gzip -dc linux-1.2.0.tar.gz | tar xvf -
  670.  
  671.  
  672.  
  673.  
  674.   You may also find some files called  patch-1.2.1.gz ... in the same
  675.   directory. These are patch files. If you have a linux kernel that is
  676.   version 1.2.1 then what this means is that you have linux kernel
  677.   version 1.2.0 with patch 1 applied. So you don't need to patch 1. If
  678.   there are any patch files that are greater than the version of kernel
  679.   you have, you should obtain all of those above, and apply them in
  680.   sequence with something like the following commands:
  681.  
  682.  
  683.  
  684.        # cd /usr/src
  685.        # for patchfile in .../patch*
  686.        > do
  687.        > gzip -dc $patchfile | patch -p0 2>>patch.errs
  688.        > done
  689.  
  690.         ...
  691.  
  692.  
  693.  
  694.  
  695.   Check the output file (patch.errs) and search for the string fail.  If
  696.   you can't find it then all of the patch files were applied ok. If it
  697.   is there, then at least one of the patch files didn't apply correctly.
  698.   If this happens what you should do is start again from a clean kernel
  699.   archive and apply the patches one by one until you find the patch file
  700.   that failed. If you can't work out why it didn't work then report it
  701.   as a problem.
  702.  
  703.  
  704.   7.2.  The libraries.
  705.  
  706.   You'll want at least version 4.4.2 of libc, as there were problems
  707.   with earlier version that affected subnet masks.
  708.  
  709.   The current libraries (libc-4.6.27) can be found in:
  710.  
  711.   sunsite.unc.edu
  712.  
  713.  
  714.        /pub/Linux/GCC/
  715.  
  716.  
  717.  
  718.  
  719.   You will need at least the following files:
  720.  
  721.  
  722.   o  image-4.6.27.tar.gz
  723.  
  724.   o  inc-4.6.27.tar.gz
  725.  
  726.  
  727.   o  extra-4.6.27.tar.gz
  728.  
  729.   o  release.libc-4.6.27
  730.  
  731.   When installing libc.4.6.27 you MUST read release.libc-4.6.27 before
  732.   you install the libraries. Please note that to use release 4.5.26 or
  733.   later you will also need at least GCC version 2.6.2, and Linux kernel
  734.   1.1.52 or later.
  735.  
  736.  
  737.   7.3.  The network configuration tool suite.
  738.  
  739.   You will need the utility suite that provides tools to configure your
  740.   network support.
  741.  
  742.   The current NET-2 utility suite is available from:
  743.  
  744.   sunacm.swan.ac.uk
  745.  
  746.  
  747.        /pub/misc/Linux/Networking/PROGRAMS/NetTools/net-tools-1.1.95.tar.gz
  748.  
  749.  
  750.  
  751.  
  752.   Because the kernel networking code is still changing some changes to
  753.   the network tools have been necessary as new kernels are released, so
  754.   you will need to choose the version that is appropiate for the kernel
  755.   version you intend to use.
  756.  
  757.   The filenames reflect the earliest version of kernel that the tools
  758.   will work with. Please choose the filename whose version equals, or is
  759.   less than the version of kernel source you intend to use.
  760.  
  761.   To build and install the tools, you should try:
  762.  
  763.  
  764.        # cd /usr/src
  765.        # mkdir net-tools
  766.        # cd net-tools
  767.        # gzip -dc net-tools-1.1.95.tar.gz | tar xvf -
  768.        # make
  769.  
  770.  
  771.  
  772.  
  773.   This will automatically run the Configure.sh script. If everything
  774.   makes ok, then:
  775.  
  776.  
  777.  
  778.        # make install
  779.  
  780.  
  781.  
  782.  
  783.   If you use a kernel version 1.1.26 or earlier you should look in:
  784.  
  785.   sunacm.swan.ac.uk
  786.  
  787.  
  788.        /pub/misc/Linux/Networking/PROGRAMS/Other/net032/
  789.  
  790.  
  791.  
  792.  
  793.   In this directory you will find three versions of the network tools.
  794.   The following table lists net-032 package name with the relevant
  795.   kernel versions:
  796.  
  797.  
  798.  
  799.        net-0.32d-net3.tar.gz     1.1.12+
  800.        net-0.32b.tar.gz          1.1.4+
  801.        net-0.32.old.tar.gz       pre 1.1.4 kernels
  802.  
  803.  
  804.  
  805.  
  806.   These packages include the essential network configuration programs
  807.   such as ifconfig, route, netstat etc. These will be discussed later.
  808.  
  809.  
  810.   7.4.  The network applications.
  811.  
  812.   You will want a number of network application programs. These are
  813.   programs like telnet, ftp, finger and their daemons at least. Florian
  814.   La Roche, <flla@stud.uni-sb.de> has put together a fairly complete
  815.   distribution of network applications in both binary and source form.
  816.   The tcp/ip application binaries and some sample config files are found
  817.   in:
  818.  
  819.   ftp.funet.fi
  820.  
  821.  
  822.        /pub/OS/Linux/PEOPLE/Linus/net-source/base/NetKit-A-0.08.bin.tar.gz
  823.        /pub/OS/Linux/PEOPLE/Linus/net-source/base/NetKit-B-0.06.tar.gz
  824.  
  825.  
  826.  
  827.  
  828.   If there are newer versions then use the newer versions. Please read
  829.   the README file first just to make sure that you have the necessary
  830.   prerequisites.
  831.  
  832.   Florian used to have a binary distribution of the networking
  833.   applications (the B file) available but it is no longer there, so you
  834.   will have to build the files yourself. You can use the following
  835.   procedure:
  836.  
  837.  
  838.  
  839.        # cd /usr/src
  840.        # gzip -dc NetKit-B-0.06.tar.gz | tar xpvlf -
  841.        # cd NetKit-B-0.06
  842.  
  843.  
  844.  
  845.  
  846.   Then, read the README file. You will need to edit the Makefile and set
  847.   the HAVE_SHADOW_PASSWORDS define appropriately. I don't use shadow
  848.   passwords, so I commented it out by placing a # at the start of the
  849.   line. The rest should not need modifying, so then all you should have
  850.   to do is:
  851.  
  852.  
  853.  
  854.        # make
  855.        # make install
  856.  
  857.  
  858.  
  859.   IMPORTANT NOTE: Florian has built and prepackaged these tar files for
  860.   your convenience. Florian has attempted to make them as complete as
  861.   possible and has included a distribution of the binaries found in the
  862.   net-tools-n.n.nn releases. Unfortunately Florian has chosen not to use
  863.   the same directory structure as Alan did when he prepared the
  864.   installation script for the net-tools. This will mean that you should
  865.   be very careful when installing them. Florian will change this later
  866.   so that this difference is not a problem, but until then, I suggest
  867.   you do the following instead of the above:
  868.  
  869.  
  870.  
  871.        -  Unpack the binaries somewhere safe:
  872.        # cd /usr/src
  873.        # mkdir NetKit
  874.        # cd NetKit
  875.        # gzip -dc NetKit-A-0.07.bin.tar.gz | tar xpvlf -
  876.        # gzip -dc NetKit-B-0.06.bin.tar.gz | tar xpvlf -
  877.  
  878.        -  Remove Florians copies of the network tools previously described:
  879.        # rm ./bin/hostname ./sbin/route ./sbin/ifconfig ./sbin/netstat
  880.        # rm ./usr/sbin/arp ./usr/sbin/rarp ./usr/sbin/slattach
  881.  
  882.        -  Copy Florian's files into their new home:
  883.        # cp -vrpd . /
  884.  
  885.  
  886.  
  887.  
  888.  
  889.   7.5.  Additional drivers or packages.
  890.  
  891.   If you want to add some developmental, or Alpha/Beta test code, such
  892.   as AX.25 support, you will need to obtain the appropriate support
  893.   software for those packages. Please check the relevant sections for
  894.   those packages in this document for more detail.
  895.  
  896.  
  897.   8.  Configuring the kernel.
  898.  
  899.   Before you can use any of the network tools, or configure any network
  900.   devices, you must ensure that your kernel has the necessary network
  901.   support built into it. The best way of doing this is to compile your
  902.   own, selecting which options you want and which you don't.
  903.  
  904.   Assuming you have obtained and untarred the kernel source already, and
  905.   applied any patches that you might need to have applied to get any
  906.   nonstandard or developmental software installed, all you have to do is
  907.   edit /usr/src/linux/drivers/net/CONFIG. This file has many comments to
  908.   guide you in editing it, and in general you will need to edit very
  909.   little, as it has sensible defaults. In my case I don't need to edit
  910.   it at all.  This file is really necesary if your ethernet card is an
  911.   unusual one, or is one that isn't automatically detected by the
  912.   ethernet driver. It allows you to hard code some of the elements of
  913.   your ethernet hardware. For example, if your ethernet card is a close,
  914.   but not exact clone of a WD-8013, then you might have to configure the
  915.   shared memory address to ensure the driver detects and drives the card
  916.   properly. Please check the The Ethernet-HOWTO
  917.   <ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO/Ethernet-HOWTO> for more
  918.   definitive information on this file and its effect on ethernet cards.
  919.   This file also contains configurable parameters for PLIP, though the
  920.   defaults should again be ok unless you have a particularly slow
  921.   machine.
  922.  
  923.   When you are happy that the CONFIG file is suitable for your purposes,
  924.   then you can proceed to build the kernel. Your first step will be to
  925.   edit the top level Makefile to ensure the kernel will be built with
  926.   the appropriate VGA settings, and then you must run the kernel
  927.   configuration program:
  928.  
  929.  
  930.  
  931.        # cd /usr/src/linux
  932.        # make config
  933.  
  934.  
  935.  
  936.  
  937.   You will be asked a series of questions. There are four sections
  938.   relevant to the networking code. They are the General setup,
  939.   Networking options, Network device support, and the Filesystems
  940.   sections. The most difficult to configure is the Network device
  941.   support section, as it is where you select what types of physical
  942.   devices you want configured. On the whole you can just use the default
  943.   values for the other sections fairly safely. The following will give
  944.   you an idea of how to proceed:
  945.  
  946.  
  947.  
  948.        *
  949.        * General setup
  950.        *
  951.         ...
  952.         ...
  953.        Networking support (CONFIG_NET) [y] y
  954.         ...
  955.         ...
  956.  
  957.  
  958.  
  959.  
  960.   In the General setup section you simply select whether you want
  961.   network support or not. Naturally you must answer yes.
  962.  
  963.  
  964.  
  965.        *
  966.        * Networking options
  967.        *
  968.        TCP/IP networking (CONFIG_INET) [y]
  969.        IP forwarding/gatewaying (CONFIG_IP_FORWARD) [n]
  970.        IP multicasting (CONFIG_IP_MULTICAST) [n]
  971.        IP firewalling (CONFIG_IP_FIREWALL) [n]
  972.        IP accounting (CONFIG_IP_ACCT) [n]
  973.        *
  974.        * (it is safe to leave these untouched)
  975.        *
  976.        PC/TCP compatibility mode (CONFIG_INET_PCTCP) [n]
  977.        Reverse ARP (CONFIG_INET_RARP) [n]
  978.        Assume subnets are local (CONFIG_INET_SNARL) [y]
  979.        Disable NAGLE algorithm (normally enabled) (CONFIG_TCP_NAGLE_OFF) [n]
  980.        The IPX protocol (CONFIG_IPX) [n]
  981.        *
  982.  
  983.  
  984.  
  985.  
  986.   The second half of the Networking options section allows you to enable
  987.   or disable some funky features that you can safely accept the defaults
  988.   on until you have some idea why you want to change them. They are
  989.   described briefly later if you are interested.
  990.  
  991.        *
  992.        *
  993.        * Network device support
  994.        *
  995.        Network device support? (CONFIG_NETDEVICES) [y]
  996.        Dummy net driver support (CONFIG_DUMMY) [n]
  997.        SLIP (serial line) support (CONFIG_SLIP) [y]
  998.         CSLIP compressed headers (CONFIG_SLIP_COMPRESSED) [y]
  999.         16 channels instead of 4 (SL_SLIP_LOTS) [n]
  1000.        PPP (point-to-point) support (CONFIG_PPP) [y]
  1001.        PLIP (parallel port) support (CONFIG_PLIP) [n]
  1002.        Do you want to be offered ALPHA test drivers (CONFIG_NET_ALPHA) [n]
  1003.        Western Digital/SMC cards (CONFIG_NET_VENDOR_SMC) [y]
  1004.        WD80*3 support (CONFIG_WD80x3) [y]
  1005.        SMC Ultra support (CONFIG_ULTRA) [n]
  1006.        AMD LANCE and PCnet (AT1500 and NE2100) support (CONFIG_LANCE) [n]
  1007.        3COM cards (CONFIG_NET_VENDOR_3COM) [n]
  1008.        Other ISA cards (CONFIG_NET_ISA) [n]
  1009.        EISA, VLB, PCI and on board controllers (CONFIG_NET_EISA) [n]
  1010.        Pocket and portable adaptors (CONFIG_NET_POCKET) [n]
  1011.        *
  1012.  
  1013.  
  1014.  
  1015.  
  1016.   This section is the most important, and the most involved. It is where
  1017.   you select what hardware devices you want to support. You can see that
  1018.   I have selected SLIP support with header compression, PPP, the WD80*3
  1019.   driver, and nothing else. Other options will appear depending on what
  1020.   you select. If you answered `n' to the `SLIP..' option you not be
  1021.   presented with the compressed slip or 16 channel options. Simply
  1022.   answer `y' to whatever you want to play with, and `n' to those that
  1023.   you don't.
  1024.  
  1025.  
  1026.  
  1027.        *
  1028.        * Filesystems
  1029.        *
  1030.         ...
  1031.         ...
  1032.        /proc filesystem support (CONFIG_PROC_FS) [y]
  1033.        NFS filesystem support (CONFIG_NFS_FS) [y]
  1034.         ...
  1035.         ...
  1036.  
  1037.  
  1038.  
  1039.  
  1040.   If you wish to run an NFS client then you will want to include the NFS
  1041.   filesystem type. You will need to include the /proc filesystem because
  1042.   a number of the network utilities use it.
  1043.  
  1044.   After you have completed the configuration, all that remains is to
  1045.   actually compile the kernel:
  1046.  
  1047.  
  1048.  
  1049.        # make dep
  1050.        # make
  1051.  
  1052.  
  1053.  
  1054.  
  1055.   Don't forget to make zlilo if the new kernel compiles and tests ok.
  1056.  
  1057.   8.1.  What do all those funky Networking options actually do?
  1058.  
  1059.   Newer kernels have a number of options that you are asked about when
  1060.   you do a make config. Generally you will not need to change these, but
  1061.   some of the options might be useful to you in certain circumstances.
  1062.  
  1063.  
  1064.      TCP/IP networking
  1065.         This one is obvious, it selects whether you configure the tcp/ip
  1066.         suite of protocols into your kernel. Chances are if you are
  1067.         reading this then you will want to answer `y' to this one.
  1068.  
  1069.      Dummy networking device
  1070.         This was added to allow slip and PPP users to configure an
  1071.         address on their linux machine that would not be dependent on
  1072.         their serial link being established. It is an easy way to give
  1073.         your linux machine two addresses.
  1074.  
  1075.      IP forwarding/gatewaying
  1076.         This determines what your kernel will do when it receives a
  1077.         datagram that has a destination address that is not one of its
  1078.         own devices. You must have this option selected if you want your
  1079.         kernel to act as an IP router. Most SLIP and PPP servers will
  1080.         want this option selected.
  1081.  
  1082.      IP multicasting
  1083.         This is alpha test code support for IP multicasting, examples of
  1084.         which include services such as `Internet Talk Radio' and live
  1085.         video. You will need additional programs to make use of this
  1086.         facility, this is just the kernel support.
  1087.  
  1088.      IP firewalling
  1089.         This option allows you to provide flexible security options for
  1090.         your linux machine. You can selectively enable/disable access to
  1091.         tcp/ip ports from any address ranges you choose. This also needs
  1092.         additional programs to support it.
  1093.  
  1094.      IP accounting
  1095.         This option is for those people that want to use their Linux
  1096.         machine to provide internet connectivity to others on a
  1097.         commercial basis. It allows you to count and record incoming and
  1098.         outgoing bytes on a per port and address basis. With the
  1099.         addition of suitable software this would allow you to produce
  1100.         seperate usage charges for each person using your systems
  1101.         networking capabilities.
  1102.  
  1103.      PC/TCP compatibility mode
  1104.         This option provides a work-around for a bug that causes
  1105.         problems when using the PC/TCP networking programs to talk to
  1106.         your linux machine. There is a PC/TCP bug which provokes a
  1107.         difficult to remedy Linux bug, and this option prevents the two
  1108.         clashing. Normally you would leave this disabled, but if you
  1109.         have users on your network who use PC/TCP then you may have to
  1110.         enable this option to prevent problems.
  1111.  
  1112.      Reverse ARP
  1113.         This option allows you to configure the RARP protocol into your
  1114.         kernel. This option was added to allow the booting of Sun 3
  1115.         systems. This is not generally very useful otherwise.
  1116.  
  1117.      Assume subnets are local
  1118.         This option selects whether you assume that your whole subnet is
  1119.         directly connected to your linux machine, or whether it might be
  1120.         bridged or otherwise subdivided at a lower layer. In practise it
  1121.         will make little difference if you leave it set at the default.
  1122.  
  1123.      Disable NAGLE algorithm
  1124.         This is a timing option that determines when a datagram should
  1125.         be transmitted. The default setting provides for the best
  1126.         throughput in most situations and you should leave this set as
  1127.         it is, as disabling it will degrade your throughput. This option
  1128.         can be selectively changed from within a program with a socket
  1129.         option, and you would normally be much better off leaving it set
  1130.         at the default and specifically writing your programs to disable
  1131.         the NAGLE algorithm if they require extremely fast
  1132.         interactivity.
  1133.  
  1134.      The IPX protocol
  1135.         This option selects whether you compile the IPX protocol support
  1136.         into your kernel. The IPX protocol is an internetworking
  1137.         protocol similar in function to the IP protocol. This protocol
  1138.         is one of those used by the Novell suite.
  1139.  
  1140.      Amateur Radio AX.25 Level 2
  1141.         This option selects whether you compile in the Amateur Radio
  1142.         AX.25 protocol suite. If you select this option then a new class
  1143.         of network sockets are available for programming. The AX.25
  1144.         protocol is used primarily by Amateur Radio Operators for packet
  1145.         radio use.
  1146.  
  1147.  
  1148.   9.  Configuring the Network Devices.
  1149.  
  1150.   If everything has gone ok so far, then you will have a Linux kernel
  1151.   which supports the network devices you intend to use, and you also
  1152.   have the network tools with which to configure them. Now comes the fun
  1153.   part! You'll need to configure each of the devices you intend to use.
  1154.   This configuration generally amounts to telling each device things
  1155.   like what its IP address will be, and what network it is connected to.
  1156.  
  1157.   In past versions of this document I have presented near complete
  1158.   versions of the various configuration files and included comments to
  1159.   modify or delete lines from them as appropriate. From this version
  1160.   onwards I will take a slightly different approach which I hope will
  1161.   result in you having a complete set of uncluttered configuration files
  1162.   that you have built from scratch so you know exactly what is in them,
  1163.   and why. I'll describe each of these files, and their function, as we
  1164.   come to them.
  1165.  
  1166.  
  1167.   9.1.  Configuring the special device files in /dev
  1168.  
  1169.   You do not need to configure any special device files in the /dev
  1170.   directory for Linux Networking. Linux does not need or use them as
  1171.   other operating systems might. The devices are built dynamically in
  1172.   memory by the kernel, and since they are only names there is no need
  1173.   for them to have an appearance directly to you. The kernel provides
  1174.   all of the programming hooks and interfaces that you need to utilise
  1175.   them effectively.
  1176.  
  1177.  
  1178.   9.2.  What information do I need before I begin ?
  1179.  
  1180.   Before you can configure the networking software, you will need to
  1181.   know a number of pieces of information about your network connection.
  1182.   Your network provider or administrator will be able to provide you
  1183.   with most of them.
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.   9.2.1.  IP Address.
  1190.  
  1191.   This is the unique machine address, in dotted decimal notation, that
  1192.   your machine will use. An example is 128.253.153.54. Your network
  1193.   administrator will provide you with this information.
  1194.  
  1195.   If you will be using a slip or plip connection you may not need this
  1196.   information, so skip it until we get to the slip device.
  1197.  
  1198.   If you're using the loopback device only, ie no ethernet, slip or plip
  1199.   support, then you won't need an ip address as the loopback port always
  1200.   uses the address 127.0.0.1.
  1201.  
  1202.  
  1203.   9.2.2.  Network Mask (`netmask').
  1204.  
  1205.   For performance reasons it is desirable to limit the number of hosts
  1206.   on any particular segment of a network. For this reason it is common
  1207.   for network administrators to divide their network into a number of
  1208.   smaller networks, known as subnets, which each have a portion of the
  1209.   network addresses assigned to them. The network mask is a pattern of
  1210.   bits, which when overlayed onto an address on your network, will tell
  1211.   you which subnetwork it belongs to. This is very important for
  1212.   routing, and if you find for example, that you can happily talk to
  1213.   people outside your network, but not to some people on your own
  1214.   network, then it is quite likely that you have specified an incorrect
  1215.   subnet mask.
  1216.  
  1217.   Your network adminstrators will have chosen the netmask when the
  1218.   network was designed, and therefore they should be able to supply you
  1219.   with the correct mask to use. Most networks are class-C subnetworks
  1220.   which use 255.255.255.0 as their netmask. Other larger networks use
  1221.   class-B netmasks (255.255.0.0). The NET-2/NET-3 code will
  1222.   automatically select a default mask when you assign an address to a
  1223.   device. The default assumes that your network has not been subnetted.
  1224.  
  1225.   The NET-2/NET-3 code will choose the following masks by default:
  1226.  
  1227.  
  1228.  
  1229.        For addresses with the first byte:
  1230.        1-127         255.0.0.0         (Class A)
  1231.        128-191       255.255.0.0       (Class B)
  1232.        192+          255.255.255.0     (Class C)
  1233.  
  1234.  
  1235.  
  1236.  
  1237.   if one of these doesn't work for you, try another. If this doesn't
  1238.   work ask your network administrator or local network guru (dime a
  1239.   dozen) for help.
  1240.  
  1241.   You don't need to worry about a netmask for the loopback port, or if
  1242.   you are running slip/plip.
  1243.  
  1244.  
  1245.   9.2.3.  Network Address.
  1246.  
  1247.   This is your IP address masked (bitwise AND) with your netmask.  For
  1248.   example:
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.   If your netmask is:           255.255.255.0
  1256.   and your IP address is:       128.253.154.32    &&
  1257.                                             ---------------
  1258.   your Network address is:      128.253.154.0     =
  1259.  
  1260.  
  1261.  
  1262.  
  1263.  
  1264.   9.2.4.  Broadcast Address.
  1265.  
  1266.   `A shout is a whisper that everyone hears whether they need to or not'
  1267.  
  1268.   This is normally your network address logically ORed with your netmask
  1269.   inverted. This is simpler than it sounds. For a Class-C network, with
  1270.   network mask 255.255.255.0, your Broadcast Address will be your
  1271.   network address (calculated above), logically ORed with 0.0.0.255, the
  1272.   network mask inverted.
  1273.  
  1274.   A worked example might look like:
  1275.  
  1276.  
  1277.        If your netmask is:          255.255.255.0      !
  1278.        the netmask inverted is:       0.  0.  0.255    =
  1279.        If your Network address is:  128.253.154.0      ||
  1280.                                      ----------------
  1281.        Your broadcast address is:   128.253.154.255    =
  1282.  
  1283.  
  1284.  
  1285.  
  1286.   Note that for historical reasons some networks use the network address
  1287.   as the broadcast address. If you have any doubts contact your network
  1288.   administrator.
  1289.  
  1290.   If you have access to a sniffer, or some other device capable of
  1291.   providing you with a trace of your network traffic, then you might be
  1292.   able to determine both the network and broadcast addresses by watching
  1293.   other traffic on the lan. Keep an eye open for, (or filter everything
  1294.   except), ethernet frames destined for the ethernet broadcast address:
  1295.   ff:ff:ff:ff:ff:ff.  If any of them has an IP source address of your
  1296.   local router, and the protocol ID is not ARP, then check the
  1297.   destination IP address, because this datagram may well be a RIP
  1298.   routing broadcast from your router, in which case the destination IP
  1299.   address will be your broadcast address.
  1300.  
  1301.   Once again, if you're not sure, check with your network administrator,
  1302.   they'd rather help you, than have you connect your machine in a
  1303.   misconfigured way.
  1304.  
  1305.  
  1306.   9.2.5.  Router (`Gateway') Address.
  1307.  
  1308.   `There must be some way out of here.'
  1309.  
  1310.   This is the address of the machine that connects your network to the
  1311.   rest of the Internet. It is your `gateway' to the outside world. A
  1312.   couple of conventions exist for allocating addresses to routers which
  1313.   your network might follow, they are: The router is the lowest numbered
  1314.   address on the network, the router is the highest numbered host on the
  1315.   network.  Probably the most common is the first, where the router will
  1316.   have an address that is mostly the same as your own, except with a .1
  1317.   as the last byte. eg. if your address is 128.253.154.32, then your
  1318.   router might be 128.253.154.1. The router can in fact have any address
  1319.   valid on your network and function properly, the address doesn't
  1320.   matter at all. There may in fact even be more than one router on your
  1321.   network. You will probably need to talk to your network adminstrator
  1322.   to properly identify your router address.
  1323.  
  1324.   If you're using only loopback then you don't need a router address. If
  1325.   you're using PPP then you also don't need your router address, because
  1326.   PPP will automatically determine the correct address for you. If
  1327.   you're using SLIP, then your router address will be your SLIP server
  1328.   address.
  1329.  
  1330.  
  1331.   9.2.6.  Nameserver Address.
  1332.  
  1333.   Most machines on the net have access to a name server which translates
  1334.   human tolerable hostnames into machine tolerable addresses, and vice
  1335.   versa. Your network administrators will again tell you the address of
  1336.   your nearest nameserver. You can in fact run a nameserver on your own
  1337.   machine by running named, in which case your nameserver address will
  1338.   be 127.0.0.1, the loopback port address.  However it is not required
  1339.   that you run named at all; see section `named' for more information.
  1340.  
  1341.   If you're only using loopback then you don't need to know the
  1342.   nameserver address since you're only going to be talking to your own
  1343.   machine.
  1344.  
  1345.  
  1346.   9.2.7.  NOTE for SLIP/PLIP/PPP users.
  1347.  
  1348.   You may or may not in fact need to know any of the above information.
  1349.   Whether you do or not will depend on exactly how your network
  1350.   connection is achieved, and the capabilities of the machine at the
  1351.   other end of the link. You'll find more detail in the section relevant
  1352.   to configuration of the SLIP/PLIP and PPP devices.
  1353.  
  1354.  
  1355.   9.3.  /etc/rc.d/rc.inet1,2 or /etc/rc.net
  1356.  
  1357.   While the commands to configure your network devices can be typed
  1358.   manually each time, you will probably want to record them somewhere so
  1359.   that your network is configured automatically when you boot your
  1360.   machine.
  1361.  
  1362.   The `rc' files are specifically designed for this purpose. For the
  1363.   non-unix-wizard: `rc' file are run at bootup time by the init program
  1364.   and start up all of the basic system programs such as syslog, update,
  1365.   and cron. They are analagous to the MS-DOS autoexec.bat file, and rc
  1366.   might stand for `runtime commands'. By convention these files are kept
  1367.   under the /etc directory. The Linux Filesystem Standard doesn't go so
  1368.   far as to describe exactly where your rc files should go, stating that
  1369.   it is ok for them to follow either the BSD (/etc/rc.*) or System-V
  1370.   (/etc/rc.d/rc*) conventions.  Alan, Fred and I all use the System-V
  1371.   convention, so that is what you will see described here. This means
  1372.   that these files are found in /etc/rc.d and are called rc.inet1 and
  1373.   rc.inet2. The first rc file that gets called at bootup time is
  1374.   /etc/rc, and it in turn calls others, such as rc.inet1, which in turn
  1375.   might called rc.inet2.  It doesn't really matter where they are kept,
  1376.   or what they are called, so long as init can find them.
  1377.  
  1378.   In some distributions the rc file for the network is called rc.net and
  1379.   is in the /etc subdirectory. The rc.net file on these systems is
  1380.   simply the rc.inet1 and the rc.inet2 files combined into one file that
  1381.   gets executed. It doesn't matter where the commands appear, so long as
  1382.   you configure the interfaces before starting the network daemons and
  1383.   applications.
  1384.  
  1385.   I will refer to these files as rc.inet1 and rc.inet2, and I keep them
  1386.   in the /etc/rc.d, so if you are using one of the distributions that
  1387.   uses rc.net, or you want to keep the files somewhere else, then you
  1388.   will have to make appropriate adjustments as you go.
  1389.  
  1390.   We will be building these files from scratch as we go.
  1391.  
  1392.  
  1393.   9.3.1.  rc.inet1
  1394.  
  1395.   The rc.inet1 file configures the basic tcp/ip interaces for your
  1396.   machine using two programs: /sbin/ifconfig, and /sbin/route.
  1397.  
  1398.  
  1399.   9.3.1.1.  ifconfig
  1400.  
  1401.   /sbin/ifconfig is used for configuring your interfaces with the
  1402.   parameters that they require to function, such as their IP address,
  1403.   network mask, broadcast addresses and similar. You can use the
  1404.   ifconfig command with no parameters to display the configuration of
  1405.   all network devices. Please check the ifconfig man page for more
  1406.   detail on its use.
  1407.  
  1408.  
  1409.   9.3.1.2.  route
  1410.  
  1411.   /sbin/route is used to create, modify, and delete entries in a table
  1412.   (the routing table) that the networking code will look at when it has
  1413.   a datagram that it needs to transmit. The routing table lists
  1414.   destination address, and the interface that that address is reachable
  1415.   via. You can use the route command with no parameters to display the
  1416.   contents of the routing table. Please check the route man page for
  1417.   more detail on its use.
  1418.  
  1419.  
  1420.  
  1421.   9.3.2.  rc.inet2
  1422.  
  1423.   The rc.inet2 file starts any network daemons such as inetd, portmapper
  1424.   and so on. This will be covered in more detail in section `rc.inet2',
  1425.   so for the moment we will concentrate on rc.inet1. I have mentioned
  1426.   this file here so that if you have some other configuration, such as a
  1427.   single rc.net file you will understand what the second half of it
  1428.   represents. it is important to remember that you must start your
  1429.   network applications and daemons after you have configured your
  1430.   network devices.
  1431.  
  1432.  
  1433.   9.4.  Configuring the Loopback device (mandatory).
  1434.  
  1435.   The loopback device isn't really a hardware device. It is a software
  1436.   construct that looks like a physical interface. Its function is to
  1437.   happily allow you to connect to yourself, and to test network software
  1438.   without actually having to be connected to a network of any kind. This
  1439.   is great if you are developing network software and you have a slip
  1440.   connection.  You can write and test the code locally, and then when
  1441.   you are ready to test it on a live network, eatablish your slip
  1442.   connection and test it out. You won't hurt others users if your
  1443.   program misbehaves.
  1444.  
  1445.   By convention, the loopback device always has an IP address of
  1446.   127.0.0.1 and so you will use this address when configuring it.
  1447.  
  1448.   The loopback device for Linux is called `lo'. You will now make the
  1449.   first entry into your rc.inet1 file. The following code fragment will
  1450.   work for you:
  1451.  
  1452.  
  1453.        #!/bin/sh
  1454.        #
  1455.        # rc.inet1   --  configures network devices.
  1456.        #
  1457.        # Attach the loopback device.
  1458.        /sbin/ifconfig lo 127.0.0.1
  1459.        #
  1460.        # Add a route to point to the loopback device.
  1461.        /sbin/route add 127.0.0.1
  1462.        # End loopback
  1463.        #
  1464.  
  1465.  
  1466.  
  1467.  
  1468.   You have used the ifconfig program to give the loopback interface its
  1469.   IP address, and route program to create an entry in the routing table
  1470.   that will ensure that all datagrams destined for 127.0.0.1 will be
  1471.   sent to the loopback port.
  1472.  
  1473.   There are two important points to note here.
  1474.  
  1475.   Firstly, the netmask and broadcast addresses have been allowed to take
  1476.   the default values for the loopback device described earlier in
  1477.   section `Network Mask'. To see what they are, try the ifconfig program
  1478.   without any arguments.
  1479.  
  1480.  
  1481.  
  1482.        # ifconfig
  1483.        lo        Link encap Local Loopback
  1484.                  inet addr 127.0.0.1  Bcast 127.255.255.255  Mask 255.0.0.0
  1485.                  UP BROADCAST LOOPBACK RUNNING  MTU 2000  Metric 1
  1486.                  RX packets 0 errors 0 dropped 0 overrun 0
  1487.                  TX packets 30 errors 0 dropped 0 overrun 0
  1488.        #
  1489.  
  1490.  
  1491.  
  1492.  
  1493.   Secondly, its not obvious how the route command chose the loopback
  1494.   device as the device for the route to 127.0.0.1.  The route program is
  1495.   smart enough to know that 127.0.0.1 belongs to the network supported
  1496.   by the loopback device. It works this out by checking the IP address
  1497.   and the netmask. You can use the route command with no arguments to
  1498.   display the contents of the routing table:
  1499.  
  1500.  
  1501.  
  1502.        # route
  1503.        Kernel routing table
  1504.        Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
  1505.        127.0.0.0       *               255.0.0.0       U     0      0       30 lo
  1506.        #
  1507.  
  1508.  
  1509.  
  1510.  
  1511.   Note: You might want to use the -n argument if your name resolver is
  1512.   not yet configured properly. The -n argument tells route to just
  1513.   display the numeric addresses, and to not bother looking up the name.
  1514.  
  1515.  
  1516.  
  1517.  
  1518.  
  1519.   9.5.  Configuring an ethernet device. (optional)
  1520.  
  1521.   You'll only be interested in this section  if you wish to configure an
  1522.   ethernet card, if not then skip on ahead to the next section.
  1523.  
  1524.   To configure an ethernet card is only slightly more complicated than
  1525.   configuring the loopback device. This time you should probably specify
  1526.   explicitly the network mask and the broadcast address, unless you are
  1527.   sure that the defaults will work ok, and they probably will.
  1528.  
  1529.   For this you will need the IP address that you have been assigned, the
  1530.   network mask in use on your network, and the broadcast address in use.
  1531.  
  1532.   The first ethernet device for a Linux system is called `eth0', the
  1533.   second `eth1' and so forth. You will now add a section to your
  1534.   rc.inet1 file. The following code fragment will work for you if you
  1535.   change the addresses specified for real ones:
  1536.  
  1537.  
  1538.  
  1539.        #
  1540.        # Attach an ethernet device
  1541.        #
  1542.        #  configure the IP address, netmask and broadcast address.
  1543.        /sbin/ifconfig eth0 IPA.IPA.IPA.IPA
  1544.        /sbin/ifconfig eth0 netmask NMK.NMK.NMK.NMK
  1545.        /sbin/ifconfig eth0 broadcast BCA.BCA.BCA.BCA
  1546.        #
  1547.        # add a network route to point to it:
  1548.        /sbin/route add -net NWA.NWA.NWA.NWA device eth0
  1549.        #
  1550.        # End ethernet
  1551.        #
  1552.  
  1553.  
  1554.  
  1555.  
  1556.   Where:
  1557.  
  1558.      IPA.IPA.IPA.IPA
  1559.         represents your IP Address.
  1560.  
  1561.      NMK.NMK.NMK.NMK
  1562.         represents your netmask.
  1563.  
  1564.      BCA.BCA.BCA.BCA
  1565.         represents your Broadcast address.
  1566.  
  1567.      NWA.NWA.NWA.NWA
  1568.         represents your Network Address.
  1569.  
  1570.   Note the use of the -net argument to the route command.  This tells
  1571.   route that the route to be added is a route to a network, and not to a
  1572.   host. There is an alternative method of achieving this, you can leave
  1573.   off the -net if you have the network address listed in the
  1574.   /etc/networks file. This is covered later in section `/etc/networks'.
  1575.  
  1576.  
  1577.   9.6.  Configuring a SLIP device (optional)
  1578.  
  1579.   SLIP (Serial Line Internet Protocol) allows you to use tcp/ip over a
  1580.   serial line, be that a phone line with a dialup modem, or a leased
  1581.   line of some sort.  Of course to use slip you need access to a slip-
  1582.   server in your area. Many universities and businesses provide slip
  1583.   access all over the world.
  1584.  
  1585.   Slip uses the serial ports on your machine to carry IP datagrams. To
  1586.   do this it must take control of the serial device. Slip device names
  1587.   are named sl0, sl1 etc. How do these correspond to your serial devices
  1588.   ? The networking code uses what is called an ioctl (i/o control) call
  1589.   to change the serial devices into slip devices. There are two programs
  1590.   supplied that can do this, they are called dip and slattach
  1591.  
  1592.  
  1593.   9.6.1.  dip
  1594.  
  1595.   dip (Dialup IP) is a smart program that is able to set the speed of
  1596.   the serial device, command your modem to dial the remote end of the
  1597.   link, automatically log you into the remote server, search for
  1598.   messages sent to you by the server, and extract information for them
  1599.   such as your IP address, and perform the ioctl necessary to switch
  1600.   your serial port into slip mode. dip has a powerful scripting ability,
  1601.   and it is this that you can exploit to automate your logon procedure.
  1602.  
  1603.   dip used to be supplied with the net-tools, but since development of
  1604.   dip is now seperate, you have to source it seperately.  There have
  1605.   been a number of other versions of dip produced which offer a variety
  1606.   of new features. The dip-uri version seems to be the more popular, but
  1607.   I suggest you take a close look at each to determine which offers
  1608.   enhancements that you find useful. Since dip-uri is is so popular, the
  1609.   examples described in this document are based on current versions of
  1610.   it.
  1611.  
  1612.   You can find it at:
  1613.  
  1614.   sunsite.unc.edu
  1615.  
  1616.  
  1617.        /pub/Linux/system/Network/serial/dip337j-uri.tgz
  1618.  
  1619.  
  1620.  
  1621.  
  1622.   To install it, try the following:
  1623.  
  1624.  
  1625.        #
  1626.        # cd /usr/src
  1627.        # gzip -dc dip337j-uri.tgz | tar xvf -
  1628.        # cd dip.3.3.7j
  1629.  
  1630.        <edit Makefile>
  1631.  
  1632.        # make install
  1633.        #
  1634.  
  1635.  
  1636.  
  1637.  
  1638.  
  1639.   The Makefile assumes the existence of a group called uucp, but you
  1640.   might like to change this to either dip or slip depending on your
  1641.   configuration.
  1642.  
  1643.  
  1644.   9.6.2.  slattach
  1645.  
  1646.   slattach as contrasted with dip is a very simple program, that is very
  1647.   easy to use, but does not have the sophistication of dip.  It does not
  1648.   have the scripting ability, all it does is configure your serial
  1649.   device as a slip device. It assumes you have all the information you
  1650.   need and the serial line is established before you invoke it. slattach
  1651.   is ideal to use where you have a permanent connection to your server,
  1652.   such as a physical cable, or a leased line.
  1653.  
  1654.  
  1655.   9.6.3.  When do I use which ?
  1656.  
  1657.   You would use dip when your link to the machine that is your slip
  1658.   server is a dialup modem, or some other termporary link. You would use
  1659.   slattach when you have a leased line, perhaps a cable, between your
  1660.   machine and the server, and there is no special action needed to get
  1661.   the link working. See section `Permanent Slip connection' for more
  1662.   information.
  1663.  
  1664.   Configuring slip is much like configuring an Ethernet interface (read
  1665.   section `Configuring an ethernet device' above). However there are a
  1666.   few key differences.
  1667.  
  1668.   First of all, slip links are unlike ethernet networks in that there is
  1669.   only ever two hosts on the network, one at each end of the link.
  1670.   Unlike an ethernet that is available for use as soon are you are
  1671.   cabled, with slip, depending on the type of link you have, you may
  1672.   have to initialise your network connection in some special way.
  1673.  
  1674.   If you are using dip then this would not normally be done at boot
  1675.   time, but at some time later, when you were ready to use the link.  It
  1676.   is possible to automate this procedure. If you are using slattach then
  1677.   you will probably want to add a section to your rc.inet1 file.  This
  1678.   will be described soon.
  1679.  
  1680.   There are two major types of slip servers: Dynamic IP address servers
  1681.   and static IP address servers. Almost every slip server will prompt
  1682.   you to login using a username and password when dialing in. dip can
  1683.   handle logging you in automatically.
  1684.  
  1685.  
  1686.   9.6.4.  Static slip server with a dialup line and DIP.
  1687.  
  1688.   A static slip server in one in which you have been supplied an IP
  1689.   address that is exclusively yours. Each time you connect to the
  1690.   server, you will configure your slip port with that address. The
  1691.   static slip server will answer your modem call, possibly prompt you
  1692.   for a username and password, and then route any datagrams destined for
  1693.   your address to you via that connection. If you have a static server,
  1694.   then you may want to put entries for your hostname and IP address
  1695.   (since you know what it will be) into your /etc/hosts. You should also
  1696.   configure some other files such as: rc.inet2, host.conf, resolv.conf,
  1697.   /etc/HOSTNAME, and rc.local. Remember that when configuring rc.inet1,
  1698.   you don't need to add any special commands for your slip connection
  1699.   since it is dip that does all of the hard work for you in configuring
  1700.   your interface. You will need to give dip the appropriate information,
  1701.   and it will configure the interface for you after commanding the modem
  1702.   to establish the call, and logging you into your slip server.
  1703.  
  1704.   If this is how your slip server works then you can move to section
  1705.   `Using Dip' to learn how to configure dip appropriately.
  1706.  
  1707.  
  1708.   9.6.5.  Dynamic slip server with a dialup line and DIP.
  1709.  
  1710.   A dynamic slip server is one which allocates you an IP address
  1711.   randomly, from a pool of addresses, each time you logon. This means
  1712.   that there is no guarantee that you will have any particular address
  1713.   each time, and that address may well be used by someone else after you
  1714.   have logged off.  The netework administrator who configured the slip
  1715.   server will have assigned a pool of address for the slip server to
  1716.   use, when the server receives a new incoming call, it finds the first
  1717.   unused address, guides the caller through the login process, and then
  1718.   prints a welcome message that contains the IP address it has
  1719.   allocated, and will proceed to use that IP address for the duration of
  1720.   that call.
  1721.  
  1722.   Configuring for this type of server is similar to configuring for a
  1723.   static server, except that you must add a step where you obtain the IP
  1724.   address that the server has allocated for you and configure your slip
  1725.   device with that.
  1726.  
  1727.   Again, dip does the hard work, and new versions are smart enough to
  1728.   not only log you in, but to also be able to automatically read the IP
  1729.   address printed in the welcome message, and store it so that you can
  1730.   have it configure your slip device with it.
  1731.  
  1732.   If this is how your slip server works then you can move to section
  1733.   `Using Dip' to learn how to configure dip appropriately.
  1734.  
  1735.  
  1736.   9.6.6.  Using DIP.
  1737.  
  1738.   As explained earlier, dip is a powerful program that can simplify and
  1739.   automate the process of dialling into the slip server, logging you in,
  1740.   starting the connection, and configuring your slip devices with the
  1741.   appropriate ifconfig and route commands.
  1742.  
  1743.   Essentially to use dip you'll write a `dip script', which is basically
  1744.   a list of commands that dip understands that tell dip how to perform
  1745.   each of the actions you want it to perform. See sample.dip that comes
  1746.   supplied with dip to get an idea of how it works. dip is quite a
  1747.   powerful program, with many options.  Instead of going into all of
  1748.   them here you should looks at the man page, README and sample files
  1749.   that will have come with your version of dip.
  1750.  
  1751.   You may notice that the sample.dip script assumes that you're using a
  1752.   static slip server, so you know what your IP address is beforehand.
  1753.   For dynamic slip servers, the newer versions of dip include a command
  1754.   you can use to automatically read and configure your slip device with
  1755.   the IP address that the dynamic server allocates for you. The
  1756.   following sample is a modified verson of the sample.dip that came
  1757.   supplied with dip337j-uri.tgz, and is probably a good starting point
  1758.   for you.  You might like to save it as /etc/dipscript and edit it to
  1759.   suit your configuration:
  1760.  
  1761.  
  1762.  
  1763.  
  1764.  
  1765.  
  1766.  
  1767.  
  1768.  
  1769.  
  1770.  
  1771.  
  1772.  
  1773.  
  1774.  
  1775.  
  1776.  
  1777.  
  1778.  
  1779.  
  1780.  
  1781.  
  1782.  
  1783.   #
  1784.   # sample.dip    Dialup IP connection support program.
  1785.   #
  1786.   #               This file (should show) shows how to use the DIP
  1787.   #       This file should work for Annex type dynamic servers, if you
  1788.   #       use a static address server then use the sample.dip file that
  1789.   #       comes as part of the dip337-uri.tgz package.
  1790.   #
  1791.   #
  1792.   # Version:      @(#)sample.dip  1.40    07/20/93
  1793.   #
  1794.   # Author:       Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
  1795.   #
  1796.  
  1797.   main:
  1798.   # Next, set up the other side's name and address.
  1799.   # My dialin machine is called 'xs4all.hacktic.nl' (== 193.78.33.42)
  1800.   get $remote xs4all.hacktic.nl
  1801.   # Set netmask on sl0 to 255.255.255.0
  1802.   netmask 255.255.255.0
  1803.   # Set the desired serial port and speed.
  1804.   port cua02
  1805.   speed 38400
  1806.  
  1807.   # Reset the modem and terminal line.
  1808.   # This seems to cause trouble for some people!
  1809.   reset
  1810.  
  1811.   # Note! "Standard" pre-defined "errlevel" values:
  1812.   #  0 - OK
  1813.   #  1 - CONNECT
  1814.   #  2 - ERROR
  1815.   #
  1816.   # You can change those grep'ping for "addchat()" in *.c...
  1817.  
  1818.   # Prepare for dialing.
  1819.   send ATQ0V1E1X4\r
  1820.   wait OK 2
  1821.   if $errlvl != 0 goto modem_trouble
  1822.   dial 555-1234567
  1823.   if $errlvl != 1 goto modem_trouble
  1824.  
  1825.   # We are connected.  Login to the system.
  1826.   login:
  1827.   sleep 2
  1828.   wait ogin: 20
  1829.   if $errlvl != 0 goto login_trouble
  1830.   send MYLOGIN\n
  1831.   wait ord: 20
  1832.   if $errlvl != 0 goto password_error
  1833.   send MYPASSWD\n
  1834.   loggedin:
  1835.  
  1836.   # We are now logged in.
  1837.   wait SOMEPROMPT 30
  1838.   if $errlvl != 0 goto prompt_error
  1839.  
  1840.   # Command the server into SLIP mode
  1841.   send slip\n
  1842.   wait SLIP 30
  1843.   if $errlvl != 0 goto prompt_error
  1844.  
  1845.   # Get and Set your IP address from the server.
  1846.   #   Here we assume that after commanding the slip server into SLIP
  1847.   #   mode that it prints your IP address
  1848.   get $locip remote 30
  1849.   if $errlvl != 0 goto prompt_error
  1850.  
  1851.   # Set up the SLIP operating parameters.
  1852.   get $mtu 296
  1853.   # Ensure "route add -net default xs4all.hacktic.nl" will be done
  1854.   default
  1855.  
  1856.   # Say hello and fire up!
  1857.   done:
  1858.   print CONNECTED $locip ---> $rmtip
  1859.   mode CSLIP
  1860.   goto exit
  1861.  
  1862.   prompt_error:
  1863.   print TIME-OUT waiting for SLIPlogin to fire up...
  1864.   goto error
  1865.  
  1866.   login_trouble:
  1867.   print Trouble waiting for the Login: prompt...
  1868.   goto error
  1869.  
  1870.   password:error:
  1871.   print Trouble waiting for the Password: prompt...
  1872.   goto error
  1873.  
  1874.   modem_trouble:
  1875.   print Trouble ocurred with the modem...
  1876.   error:
  1877.   print CONNECT FAILED to $remote
  1878.   quit
  1879.  
  1880.   exit:
  1881.   exit
  1882.  
  1883.  
  1884.  
  1885.  
  1886.   The above example assumes you are calling a dynamic slip server, if
  1887.   you are calling a static slip server, then the sample.dip file that
  1888.   comes with dip337j-uri.tgz should work for you.
  1889.  
  1890.   When dip is given the get $local command it searches the incoming text
  1891.   from the remote end for a string that looks like an IP address, ie
  1892.   strings numbers seperated by `.' characters. This modification was put
  1893.   in place specifically for dynamic slip servers, so that the process of
  1894.   reading the IP address granted by the server could be automated.
  1895.  
  1896.   The example above will automaticaly create a default route via your
  1897.   slip link, if this is not what you want, you might have an ethernet
  1898.   connection that should be your default route, then remove the default
  1899.   command from the script.  After this script has finished running, if
  1900.   you do an ifconfig command, you will see that you have a device sl0.
  1901.   This is your slip device.  Should you need to, you can modify its
  1902.   configuration manually, after the dip command has finished, using the
  1903.   ifconfig and route commands.
  1904.  
  1905.   Please note that dip allows you to select a number of different
  1906.   protocols to use with the mode command, the most common example is
  1907.   cslip for slip with compression. Please note that both ends of the
  1908.   link must agree, so you should ensure that whatever you select agrees
  1909.   with what your server is set to.
  1910.  
  1911.   The above example is fairly robust and should cope with most errors.
  1912.   Please refer to the dip man page for more information. Naturally you
  1913.   could, for example, code the script to do such things as redial the
  1914.   server if it doesn't get a connection within a prescribed period of
  1915.   time, or even try a series of servers if you have access to more than
  1916.   one.
  1917.  
  1918.  
  1919.   9.6.7.  Permament slip connection using a leased line and slattach.
  1920.  
  1921.   If you have a cable between two machines, or are fortunate enough to
  1922.   have a leased line, or some other permanent serial connection between
  1923.   your machine and another, then you don't need to go to all the trouble
  1924.   of using dip to set up your serial link. slattach is a very simple to
  1925.   use utility that will allow you just enough functionality to configure
  1926.   your connection.
  1927.  
  1928.   Since your connection will be a permanent one, you will want to add
  1929.   some commands to your rc.inet1 file. In essence all you need to do for
  1930.   a permament connection is ensure that you configure the serial device
  1931.   to the correct speed and switch the serial device into slip mode.
  1932.   slattach allows you to do this with one command. Add the following to
  1933.   your rc.inet1 file:
  1934.  
  1935.  
  1936.  
  1937.        #
  1938.        # Attach a leased line static slip connection
  1939.        #
  1940.        #  configure /dev/cua0 for 19.2kbps and cslip
  1941.        /sbin/slattach -p cslip -s 19200 /dev/cua0 &
  1942.        /sbin/ifconfig sl0 IPA.IPA.IPA.IPA pointopoint IPR.IPR.IPR.IPR up
  1943.        #
  1944.        # End static slip.
  1945.  
  1946.  
  1947.  
  1948.  
  1949.   Where:
  1950.  
  1951.      IPA.IPA.IPA.IPA
  1952.         represents your IP address.
  1953.  
  1954.      IPR.IPR.IPR.IPR
  1955.         represents the IP address of the remote end.
  1956.  
  1957.   slattach allocated the first unallocated slip device to the serial
  1958.   device specified. slattach starts with sl0. Therefore the first
  1959.   slattach command attaches slip device sl0 to the serial device
  1960.   specified, and sl1 the next time, etc.
  1961.  
  1962.   slattach allows you to configure a number of different protocols with
  1963.   the -p argument. In your case you will use either slip or cslip
  1964.   depending on whether you want to use compression or not.  Note: both
  1965.   ends must agree on whether you want compression or not.
  1966.  
  1967.  
  1968.   9.7.  Configuring a PLIP device. (optional)
  1969.  
  1970.   plip (Parallel Line IP), is like slip, in that it is used for
  1971.   providing a point to point network connection between two machines,
  1972.   except that it is designed to use the parallel printer ports on your
  1973.   machine instead of the serial ports. Because it is possible to
  1974.   transfer more than one bit at a time with a parallel port, it is
  1975.   possible to attain higher speeds with the plip interface than with a
  1976.   standard serial device. In addition, even the simplest of parallel
  1977.   ports, printer ports, can be used, in lieu of you having to purchase
  1978.   comparitively expensive 16550AFN UART's for your serial ports.
  1979.  
  1980.  
  1981.   Please note that some laptops use chipsets that will not work with
  1982.   PLIP because they do not allow some combinations of signals that PLIP
  1983.   relies on, that printers don't use.
  1984.  
  1985.   The Linux plip interface is compatible with the Crywyr Packet Driver
  1986.   PLIP, and this will mean that you can connect your Linux machine to a
  1987.   DOS machine running any other sort of tcp/ip software via plip.
  1988.  
  1989.   You have two options in using the PLIP driver. You can either compile
  1990.   the driver into your kernel, or use the modules package to load the
  1991.   module dynamically. I recommend just compiling it into your kernel as
  1992.   it is probably the easiest, and in most circumstances you will want
  1993.   the driver there all the time anyway.
  1994.  
  1995.   When compiling the kernel, there is only one file that might need to
  1996.   be looked at to configure plip. That file is
  1997.   /usr/src/linux/driver/net/CONFIG, and it contains plip timers in mS.
  1998.   The defaults are probably ok in most cases. You will probably need to
  1999.   increase them if you have an especially slow computer, in which case
  2000.   the timers to increase are actually on the other computer.
  2001.  
  2002.   The driver assumes the following defaults:
  2003.  
  2004.  
  2005.        device  i/o addr    IRQ
  2006.        ------  --------    -----
  2007.        plip0   0x3BC           5
  2008.        plip1   0x378           7
  2009.        plip2   0x278           2 (9)
  2010.  
  2011.  
  2012.  
  2013.  
  2014.   If your parallel ports don't match any of the above combinations then
  2015.   you can change the IRQ of a port using the ifconfig command using the
  2016.   `irq' paramater. Be sure to enable IRQ's on your printer ports in your
  2017.   ROM BIOS if it supports this option.
  2018.  
  2019.   To configure a plip interface, you will need to add the following
  2020.   lines to your rc.inet1 file:
  2021.  
  2022.  
  2023.  
  2024.        #
  2025.        # Attach a PLIP interface
  2026.        #
  2027.        #  configure first parallel port as a plip device
  2028.        /sbin/ifconfig plip0 IPA.IPA.IPA.IPA pointopoint IPR.IPR.IPR.IPR up
  2029.        #
  2030.        # End plip
  2031.  
  2032.  
  2033.  
  2034.  
  2035.   Where:
  2036.  
  2037.      IPA.IPA.IPA.IPA
  2038.         represents your IP address.
  2039.  
  2040.      IPR.IPR.IPR.IPR
  2041.         represents the IP address of the remote machine.
  2042.  
  2043.   The pointopoint parameter has the same meaning as for slip, in that it
  2044.   specifies the address of the machine at the other end of the link.
  2045.  
  2046.  
  2047.   In almost all respects you can treat a plip interface as though it
  2048.   were a slip interface, except that neither dip nor slattach need be,
  2049.   nor can be, used.
  2050.  
  2051.  
  2052.   9.7.1.  PLIP cabling diagram.
  2053.  
  2054.   plip has been designed to use cables with the same pinout as those
  2055.   commonly used by the better known of the MS-DOS based pc-pc file
  2056.   transfer programs.
  2057.  
  2058.  
  2059.   The pinout diagram (taken from /usr/src/linux/drivers/net/plip.c)
  2060.   looks as follows:
  2061.  
  2062.  
  2063.  
  2064.        Pin Name    Connect pin - pin
  2065.        ---------   -------------------------------
  2066.        GROUND      25 - 25
  2067.        D0->ERROR   2 - 15
  2068.        ERROR->D0   15 - 2
  2069.        D1->SLCT    3 - 13
  2070.        SLCT->D1    13 - 3
  2071.        D2->PAPOUT  4 - 12
  2072.        PAPOUT->D2  12 - 4
  2073.        D3->ACK     5 - 10
  2074.        ACK->D3     10 - 5
  2075.        D4->BUSY    6 - 11
  2076.        BUSY->D4    11 - 6
  2077.        D5          7*
  2078.        D6          8*
  2079.        D7          9*
  2080.        STROBE      1*
  2081.        FEED        14*
  2082.        INIT        16*
  2083.        SLCTIN      17*
  2084.  
  2085.  
  2086.  
  2087.  
  2088.   Notes: Do not connect the pins marked with an asterisk `*'.  Extra
  2089.   grounds are 18,19,20,21,22,23, and 24.
  2090.  
  2091.   If the cable you are using has a metallic shield, it should be
  2092.   connected to the metallic DB-25 shell at one end only.
  2093.  
  2094.   Warning: A miswired PLIP cable can destroy your controller card. Be
  2095.   very careful, and double check every connection to ensure you don't
  2096.   cause yourself any unnecessary work or heartache.
  2097.  
  2098.   While you may be able to run PLIP cables for long distances, you
  2099.   should avoid it if you can. The specifications for the cable allow for
  2100.   a cable length of about 1 metre or so. Please be very careful when
  2101.   running long plip cables as sources of strong electromagnetic fields
  2102.   such as lightning, power lines, and radio transmitters can interfere
  2103.   with and sometimes even damage your controller. If you really want to
  2104.   connect two of your computers over a large distance you really should
  2105.   be looking at obtaining a pair of thin-net ethernet cards and running
  2106.   some coaxial cable.
  2107.  
  2108.  
  2109.   10.  Routing. (mandatory)
  2110.  
  2111.   After you have configured all of your network devices you need to
  2112.   think about how your machine is going to route IP datagrams. If you
  2113.   have only one network device configured then your choice is easy, as
  2114.   all datagrams for any machine other than yours must go via that
  2115.   interface. If you have more than one network interface then your
  2116.   choice is a little more complicated. You might have both an ethernet
  2117.   device and slip connection to your machine at home. In this situation
  2118.   you must direct all datagrams for your machine at home via your slip
  2119.   interface, and all else via the ethernet device. Routing is actually a
  2120.   very simple mechanism, but don't worry if you find it slightly
  2121.   difficult to understand at first; everybody does.
  2122.  
  2123.   You can display the contents of your routing table by using the route
  2124.   command without any options.
  2125.  
  2126.   There are four commonly used routing mechanisms for unix network
  2127.   configurations.  I'll briefly discuss each in turn.
  2128.  
  2129.  
  2130.   10.1.  Static/Manual Routes.
  2131.  
  2132.   Static routing, as its name implies, is `hard coded' routing, that is,
  2133.   it will not change if your network suffers some failure, or if an
  2134.   alternate route becomes available. Static routes are often used in
  2135.   cases where you have a very simple network with no alternate routes
  2136.   available to a destination host, that is, there is only one possible
  2137.   network path to a destination host, or where you want to route a
  2138.   particular way to a host regardless of network changes.
  2139.  
  2140.   In Linux there is a special use for manual routes, and that is for
  2141.   adding a route to a slip or plip host where you have used the ifconfig
  2142.   pointopoint parameter. If you have a slip/plip link, and have the
  2143.   pointopoint parameter specifying the address of the remote host, then
  2144.   you should add a static route to that address so that the ip routing
  2145.   software knows how to route datagrams to that address. The route
  2146.   command you would use for the slip/plip link via leased line example
  2147.   presented earlier would be:
  2148.  
  2149.  
  2150.  
  2151.        #/sbin/route add IPR.IPR.IPR.IPR
  2152.  
  2153.  
  2154.  
  2155.  
  2156.   Where:
  2157.  
  2158.      IPR.IPR.IPR.IPR
  2159.         represents the IP address of the remote end.
  2160.  
  2161.  
  2162.   10.2.  Default Route.
  2163.  
  2164.   The default route mechanism is probably the most common and most
  2165.   useful to most end-user workstations and hosts on most networks. The
  2166.   default route is a special static route that matches every destination
  2167.   address, so that if there is no more specific route for a datagram to
  2168.   be sent to, then the default route will be used.
  2169.  
  2170.   If you have a configuration where you have only a single ethernet
  2171.   interface, or a single slip interface device defined then you should
  2172.   point your default route via it. In the case of an ethernet interface,
  2173.   the Linux kernel knows where to send datagrams for any host on your
  2174.   network. It works this out using the network address and the network
  2175.   mask as discussed earlier. This means that the only datagrams the
  2176.   kernel won't know how to properly route will be those for people not
  2177.   on your network. To make this work you would normally have your
  2178.   default route point to your router address, as it is your means of
  2179.   getting outside of your local network. If you are using a slip
  2180.   connection, then your slip server will be acting as your router, so
  2181.   your default route will be via your slip server.
  2182.  
  2183.   To configure your default route, add the following to your rc.inet1
  2184.   after all of your network device configurations:
  2185.  
  2186.  
  2187.  
  2188.        #
  2189.        # Add a default route.
  2190.        #
  2191.        /sbin/route add default gw RGA.RGA.RGA.RGA
  2192.        #
  2193.  
  2194.  
  2195.  
  2196.  
  2197.   Where:
  2198.  
  2199.      RGA.RGA.RGA.RGA
  2200.         represents your Router/Gateway Address.
  2201.  
  2202.  
  2203.   10.3.  Proxy ARP.
  2204.  
  2205.   This method is ugly, hazard prone and should be used with extreme
  2206.   care, some of you will want to use it anyway.
  2207.  
  2208.   Those with the greatest need for proxy arp will be those of you who
  2209.   are configuring your Linux machine as a slip dial-in server. For those
  2210.   of you who will be using PPP, the PPP daemon simplifies and automates
  2211.   this task, making it a lot safer to use.
  2212.  
  2213.   Normally when a tcp/ip host on your ethernet network wants to talk to
  2214.   you, it knows your IP address, but doesn't know what hardware
  2215.   (ethernet) address to send datagrams to. The ARP mechanism is there
  2216.   specifically to provide that mapping function between network address
  2217.   and hardware address. The ethernet protocol provides a special address
  2218.   that is recognised by all ethernet cards, this is called the broadcast
  2219.   address. ARP works by sending a specially formatted datagram
  2220.   containing the IP address of the host it wishes to discover the
  2221.   hardware address of, and transmits it to the ethernet broadcast
  2222.   address.  Every host will receive this datagram and the host that is
  2223.   configured with the matching IP address will reply with its hardware
  2224.   address. The host that performed the arp will then know what hardware
  2225.   address to use for the desired IP address.
  2226.  
  2227.   If you want to use your machine as a server for other machines, you
  2228.   must get your machine to answer ARP requests for their IP addresses on
  2229.   their behalf, as they will not be physically connected to the ethernet
  2230.   network. Lets say that you have been assigned a number of IP addresses
  2231.   on your local network that you will be offering to dial-in slip users.
  2232.   Lets say those addresses are: 128.253.154.120-124, and that you have
  2233.   an ethernet card with a hardware address of 00:00:C0:AD:37:1C. (You
  2234.   can find the hardware address of your ethernet card by using the
  2235.   ifconfig command with no options). To instruct your Linux server to
  2236.   answer arp requests by proxy for these addresses you would need to add
  2237.   the following commands to the end of your rc.inet1 file:
  2238.  
  2239.  
  2240.  
  2241.  
  2242.  
  2243.  
  2244.  
  2245.   #
  2246.   # Proxy ARP for those dialin users who will be using this
  2247.   #           machine as a server:
  2248.   #
  2249.   /sbin/arp -s 128.263.154.120 00:00:C0:AD:37:1C pub
  2250.   /sbin/arp -s 128.263.154.121 00:00:C0:AD:37:1C pub
  2251.   /sbin/arp -s 128.263.154.122 00:00:C0:AD:37:1C pub
  2252.   /sbin/arp -s 128.263.154.123 00:00:C0:AD:37:1C pub
  2253.   /sbin/arp -s 128.263.154.124 00:00:C0:AD:37:1C pub
  2254.   #
  2255.   # End proxy arps.
  2256.  
  2257.  
  2258.  
  2259.  
  2260.   The pub argument stands for `publish'. It is this argument that
  2261.   instructs your machine to answer requests for these addresses, even
  2262.   though they are not for your machine. When it answers it will supply
  2263.   the hardware address specified, which is of course its own hardware
  2264.   address.
  2265.  
  2266.   Naturally you will need to ensure that you have routes configured in
  2267.   your linux server that point these addresses to the slip device on
  2268.   which they will be connecting.
  2269.  
  2270.   If you are using PPP, you don't need to worry about manually messing
  2271.   with the arp table, as the pppd will manage those entries for you if
  2272.   you use the proxyarp parameter, and as long as the IP addresses of the
  2273.   remote machine and the server machine are in the same network. You
  2274.   will need to supply the netmask of the network on the server's pppd
  2275.   command line.
  2276.  
  2277.  
  2278.   10.4.  gated - the routing daemon.
  2279.  
  2280.   gated could be used in place of proxy arp in some cases, and would
  2281.   certainly be much cleaner, but its primary use is if you want your
  2282.   linux machine to act as an intelligent ip router for your network.
  2283.   gated provides support for a number of routing protocols. Among these
  2284.   are RIP, BGP, EGP, HELLO, and OSPF. The most commonly used in small
  2285.   networks being rip. rip stands for `Routing Information Protocol'. If
  2286.   you run gated, configured for rip, your linux machine will
  2287.   periodically broadcast a copy of its routing table to your network in
  2288.   a special format. In this way, all of the other machines on your
  2289.   network will know what addresses are accessible via your machine.
  2290.  
  2291.   gated can be used to replace proxy arp when all hosts on your network
  2292.   run either gated or routed. If you have a network where you use a
  2293.   mixture of manual and dynamic routes, you should mark any manual
  2294.   routes as passive to ensure that they aren't destroyed by gated
  2295.   because it hasn't received an update for them. The best way to add
  2296.   static routes if you are using gated is to add a static stanza to your
  2297.   /etc/gated.conf file. This is described below.
  2298.  
  2299.   gated would normally be started from your rc.inet2 which is covered in
  2300.   the next section. You might already see a daemon called routed
  2301.   running. gated is superior to routed in that it is more flexible and
  2302.   more functional. So you should use gated and not routed.
  2303.  
  2304.  
  2305.   10.4.1.  Obtaining gated
  2306.  
  2307.   Gated is available from:
  2308.  
  2309.   sunsite.unc.edu
  2310.  
  2311.   /pub/Linux/system/Network/daemons/gated11_bin.tgz
  2312.  
  2313.  
  2314.  
  2315.  
  2316.  
  2317.   10.4.2.  Installing gated
  2318.  
  2319.   The gated binary distribution comprises three programs and two sample
  2320.   configuration files.
  2321.  
  2322.   The programs are:
  2323.  
  2324.  
  2325.      gated
  2326.         the actual gated daemon.
  2327.  
  2328.      gdc
  2329.         the operational user interface for gated. gdc is for controlling
  2330.         the gated daemon, stopping and starting it, obtaining its status
  2331.         and the like.
  2332.  
  2333.      ripquery
  2334.         a diagnostic tool to query the known routes of a gateway using
  2335.         either a `rip query' or a `rip poll'.
  2336.  
  2337.   The configuration files are:
  2338.  
  2339.  
  2340.      gated.conf
  2341.         this is the actual configuration file for the gated daemon. It
  2342.         allows you to specify how gated will behave when it is running.
  2343.         You can enable and disable any of the routing protocols, and
  2344.         control the behaviour of those routing protocols running.
  2345.  
  2346.      gated.version
  2347.         a text file that describes the version number of the gated
  2348.         daemon
  2349.  
  2350.   The gated binary distribution will not install the gated files in the
  2351.   correct place for you. Fortunately there aren't very many, so its
  2352.   fairly simple to do.
  2353.  
  2354.   To install the binaries try the following:
  2355.  
  2356.  
  2357.  
  2358.        # cd /tmp
  2359.        # gzip -dc .../gated.linux.bin.tgz | tar xvf -
  2360.        # install -m 500 bin/gated /usr/sbin
  2361.        # install -m 444 bin/gated.conf bin/gated.version /etc
  2362.        # install -m 555 bin/ripquery bin/gdc /sbin
  2363.        # rm -rf /tmp/bin
  2364.  
  2365.  
  2366.  
  2367.  
  2368.   I keep the networking daemons in /usr/sbin, if yours are somewhere
  2369.   else then naturally you'll have to change the target directory. The
  2370.   sample gated configuration file included configures gated to emulate
  2371.   the old routed daemon. It will probably work for you in most
  2372.   circumstances, and it looks like this:
  2373.  
  2374.  
  2375.  
  2376.  
  2377.   #
  2378.   #  This configuration emulates routed.  It runs RIP and only sends
  2379.   #  updates if there are more than one interfaces up and IP forwarding is
  2380.   #  enabled in the kernel.
  2381.   #
  2382.   #       NOTE that RIP *will not* run if UDP checksums are disabled in
  2383.   #       the kernel.
  2384.   #
  2385.   rip yes ;
  2386.   traceoptions all;
  2387.   #
  2388.  
  2389.  
  2390.  
  2391.  
  2392.   If you have any static routes you wish to add, you can add them in a
  2393.   static stanza appended to your /etc/gated.conf as follows:
  2394.  
  2395.  
  2396.  
  2397.        #
  2398.        static {
  2399.        37.0.0.0 mask 255.0.0.0 gateway 44.136.8.97 ;
  2400.        host 44.136.8.100 gateway 44.136.8.97 ;
  2401.        } ;
  2402.        #
  2403.  
  2404.  
  2405.  
  2406.  
  2407.   The above example would create a static route to the Class A network
  2408.   37.0.0.0 via gateway 44.136.8.97, and a static route to a host with
  2409.   address 44.136.8.100 via gateway 44.136.8.97.  If you do this you do
  2410.   not need to add the routes using the route command, gated will add and
  2411.   manage the routes for you.
  2412.  
  2413.  
  2414.   To install the man files, try the following:
  2415.  
  2416.  
  2417.  
  2418.        # cd /tmp
  2419.        # gzip -dc .../gated.linux.man.tgz | tar xvf -
  2420.        # install -m 444 man/*.8 /usr/man/man8
  2421.        # install -m 444 man/*.5 /usr/man/man5
  2422.        # rm -rf /tmp/man
  2423.  
  2424.  
  2425.  
  2426.  
  2427.   The man files contain concise and detailed information on the
  2428.   configuration and use of gated. For information on configuring gated,
  2429.   refer to the gated-config man page.
  2430.  
  2431.  
  2432.   11.  Configuring the network daemons.
  2433.  
  2434.   As mentioned earlier, there are other files that you will need to
  2435.   complete your network installation. These files concern higher level
  2436.   configurations of the network software. Each of the important ones are
  2437.   covered in the following sub-sections, but you will find there are
  2438.   others that you will have to configure as you become more familiar
  2439.   with the network suite.
  2440.  
  2441.  
  2442.  
  2443.   11.1.  /etc/rc.d/rc.inet2 (the second half of rc.net)
  2444.  
  2445.   If you have been following this document you should at this stage have
  2446.   built an rc file to configure each of your network devices with the
  2447.   correct addresses, and set up whatever routing you will need for your
  2448.   particular network configuration. You will now need to actually start
  2449.   some of the higher level network software.
  2450.  
  2451.   Now would be a really good time to read Olaf's Network Administrators
  2452.   Guide, as it really should be considered the definitive document for
  2453.   this stage of the configuration process. It will help you decide what
  2454.   to include in this file, and more importantly perhaps, what not to
  2455.   include in this file. For the security conscious it is a fair
  2456.   statement to say that the more network services you have running, the
  2457.   more likely the chance of your system having a security hole: Run only
  2458.   what you need.
  2459.  
  2460.   There are some very important daemons (system processes that run in
  2461.   the background) that you will need to know a little about. The man
  2462.   pages will tell you more, but they are:
  2463.  
  2464.  
  2465.   11.1.1.  inetd.
  2466.  
  2467.   inetd is a program that sits in the background and manages internet
  2468.   connection requests and the like. It is smart enough that you don't
  2469.   need to leave a whole bunch of servers running when there is nothing
  2470.   connected to them.  When it sees an incoming request for a particular
  2471.   service, eg telnet, or ftp, it will check the /etc/services file, find
  2472.   what server program needs to be run to manage the request, start it,
  2473.   and hand the connection over to it. Imagine it as a master server for
  2474.   your internet servers. It also has a few simple standard services
  2475.   inbuilt. These are echo, discard and generate services used for
  2476.   various types of network testing. inetd doesn't manage all servers and
  2477.   services that you might run, but it manages most of the usual ones.
  2478.   Normally services such as udp based services, or services that manage
  2479.   their own connection multiplexing such as World Wide Web servers or
  2480.   muds would be run independently of inetd. Generally the documentation
  2481.   accompanying such servers will tell you whether to use inetd or not.
  2482.  
  2483.  
  2484.   11.1.2.  syslogd.
  2485.  
  2486.   syslogd is a daemon that handles all system logging. It accepts
  2487.   messages generated for it and will distribute them according to a set
  2488.   of rules contained in /etc/syslogd.conf. For example, certain types of
  2489.   messages you will want to send to the console, and also to a log file,
  2490.   where others you will want only to log to a file. syslogd allows you
  2491.   to specify what messages should go where.
  2492.  
  2493.  
  2494.   11.2.  A sample rc.inet2 file.
  2495.  
  2496.   The following is a sample rc.inet2 file that Fred built. It starts a
  2497.   large number of servers, so you might want to trim it down to just
  2498.   those services that you actually want to run. To trim it down, simply
  2499.   delete or comment out the stanzas (if to fi) that you don't need. All
  2500.   each stanza does is test that the relevant module is a file, that it
  2501.   exists, echoes a comment that you can see when you boot your machine,
  2502.   and then executes the commands with the arguments supplied to ensure
  2503.   that it runs happily in the background. For more detailed information
  2504.   on each of the deamons, check either the Network Administrators Guide
  2505.   or the relevant man pages.
  2506.  
  2507.  
  2508.  
  2509.   #! /bin/sh
  2510.   #
  2511.   # rc.inet2      This shell script boots up the entire INET system.
  2512.   #               Note, that when this script is used to also fire
  2513.   #               up any important remote NFS disks (like the /usr
  2514.   #               distribution), care must be taken to actually
  2515.   #               have all the needed binaries online _now_ ...
  2516.   #
  2517.   # Version:      @(#)/etc/rc.d/rc.inet2  2.18    05/27/93
  2518.   #
  2519.   # Author:       Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
  2520.   #
  2521.  
  2522.   # Constants.
  2523.   NET="/usr/sbin"
  2524.   IN_SERV="lpd"
  2525.   LPSPOOL="/var/spool/lpd"
  2526.  
  2527.   # At this point, we are ready to talk to The World...
  2528.   echo -e "\nMounting remote file systems ..."
  2529.   /bin/mount -t nfs -v            # This may be our /usr runtime!!!
  2530.  
  2531.   echo -e "\nStarting Network daemons ..."
  2532.   # Start the SYSLOG daemon.  This has to be the first server.
  2533.   # This is a MUST HAVE, so leave it in.
  2534.   echo -n "INET: "
  2535.   if [ -f ${NET}/syslogd ]
  2536.   then
  2537.   echo -n "syslogd "
  2538.   ${NET}/syslogd
  2539.   fi
  2540.  
  2541.   # Start the SUN RPC Portmapper.
  2542.   if [ -f ${NET}/rpc.portmap ]
  2543.   then
  2544.   echo -n "portmap "
  2545.   ${NET}/rpc.portmap
  2546.   fi
  2547.  
  2548.   # Start the INET SuperServer
  2549.   # This is a MUST HAVE, so leave it in.
  2550.   if [ -f ${NET}/inetd ]
  2551.   then
  2552.   echo -n "inetd "
  2553.   ${NET}/inetd
  2554.   else
  2555.   echo "no INETD found.  INET cancelled!"
  2556.   exit 1
  2557.   fi
  2558.  
  2559.   # Start the NAMED/BIND name server.
  2560.   # NOTE: you probably don't need to run named.
  2561.   #if [ ! -f ${NET}/named ]
  2562.   #then
  2563.   #        echo -n "named "
  2564.   #        ${NET}/named
  2565.   #fi
  2566.  
  2567.   # Start the ROUTEd server.
  2568.   # NOTE: routed is now obselete. You should now use gated.
  2569.   #if [ -f ${NET}/routed ]
  2570.   #then
  2571.   #        echo -n "routed "
  2572.   #        ${NET}/routed -q #-g -s
  2573.   #fi
  2574.  
  2575.   # Start the GATEd server.
  2576.   if [ -f ${NET}/gated ]
  2577.   then
  2578.   echo -n "gated "
  2579.   ${NET}/gated
  2580.   fi
  2581.  
  2582.   # Start the RWHO server.
  2583.   if [ -f ${NET}/rwhod ]
  2584.   then
  2585.   echo -n "rwhod "
  2586.   ${NET}/rwhod -t -s
  2587.   fi
  2588.  
  2589.   # Start the U-MAIL SMTP server.
  2590.   if [ -f XXX/usr/lib/umail/umail ]
  2591.   then
  2592.   echo -n "umail "
  2593.   /usr/lib/umail/umail -d7 -bd </dev/null >/dev/null 2>&1 &
  2594.   fi
  2595.  
  2596.   # Start the various INET servers.
  2597.   for server in ${IN_SERV}
  2598.   do
  2599.   if [ -f ${NET}/${server} ]
  2600.   then
  2601.                   echo -n "${server} "
  2602.                   ${NET}/${server}
  2603.   fi
  2604.   done
  2605.  
  2606.   # Start the various SUN RPC servers.
  2607.   if [ -f ${NET}/rpc.portmap ]
  2608.   then
  2609.   if [ -f ${NET}/rpc.ugidd ]
  2610.   then
  2611.                   echo -n "ugidd "
  2612.                   ${NET}/rpc.ugidd -d
  2613.   fi
  2614.   if [ -f ${NET}/rpc.mountd ]
  2615.   then
  2616.                   echo -n "mountd "
  2617.                   ${NET}/rpc.mountd
  2618.   fi
  2619.   if [ -f ${NET}/rpc.nfsd ]
  2620.   then
  2621.                   echo -n "nfsd "
  2622.                   ${NET}/rpc.nfsd
  2623.   fi
  2624.  
  2625.   # Fire up the PC-NFS daemon(s).
  2626.   if [ -f ${NET}/rpc.pcnfsd ]
  2627.   then
  2628.                   echo -n "pcnfsd "
  2629.                   ${NET}/rpc.pcnfsd ${LPSPOOL}
  2630.   fi
  2631.   if [ -f ${NET}/rpc.bwnfsd ]
  2632.   then
  2633.                   echo -n "bwnfsd "
  2634.                   ${NET}/rpc.bwnfsd ${LPSPOOL}
  2635.   fi
  2636.  
  2637.   fi
  2638.   echo network daemons started.
  2639.   # Done!
  2640.  
  2641.   11.3.  Other necessary network configuration files.
  2642.  
  2643.   There are other network configuraiton files that you will need to
  2644.   configure if you want to have people connect to and use your machine
  2645.   as a host. If you have installed your linux from a distribution then
  2646.   you will probably already have copies of these files so just check
  2647.   them to make sure they look ok, and if not you can use the following
  2648.   samples.
  2649.  
  2650.  
  2651.   11.3.1.  A sample /etc/inetd.conf file.
  2652.  
  2653.   Your /etc/rc.d/rc.inet2 file will have started inetd, syslogd and the
  2654.   various rpc servers for you. You will now need to configure the
  2655.   network daemons that will be managed by inetd. inetd uses a
  2656.   configuration file called /etc/inetd.conf.
  2657.  
  2658.   The following is an example of how a simple configuration might look:
  2659.  
  2660.  
  2661.  
  2662.        #
  2663.        # The internal services.
  2664.        #
  2665.        # Authors:      Original taken from BSD UNIX 4.3/TAHOE.
  2666.        #               Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
  2667.        #
  2668.        echo    stream tcp nowait root  internal
  2669.        echo    dgram  udp wait   root  internal
  2670.        discard stream tcp nowait root  internal
  2671.        discard dgram  udp wait   root  internal
  2672.        daytime stream tcp nowait root  internal
  2673.        daytime dgram  udp wait   root  internal
  2674.        chargen stream tcp nowait root  internal
  2675.        chargen dgram  udp wait   root  internal
  2676.        #
  2677.        # Standard services.
  2678.        #
  2679.        ftp     stream tcp nowait root  /usr/sbin/tcpd in.ftpd ftpd
  2680.        telnet  stream tcp nowait root  /usr/sbin/tcpd in.telnetd
  2681.        #
  2682.        # Shell, login, exec and talk are BSD protocols.
  2683.        #
  2684.        shell   stream tcp nowait root  /usr/sbin/tcpd in.rshd
  2685.        login   stream tcp nowait root  /usr/sbin/tcpd in.rlogind
  2686.        exec    stream tcp nowait root  /usr/sbin/tcpd in.rexecd
  2687.        talk    dgram  udp wait   root  /usr/sbin/tcpd in.talkd
  2688.        ntalk   dgram  udp wait   root  /usr/sbin/tcpd in.talkd
  2689.        #
  2690.        # Status and Information services.
  2691.        #
  2692.        finger  stream tcp nowait root  /usr/sbin/tcpd in.fingerd
  2693.        systat  stream tcp nowait guest /usr/sbin/tcpd /usr/bin/ps -auwwx
  2694.        netstat stream tcp nowait guest /usr/sbin/tcpd /bin/netstat
  2695.        #
  2696.        # End of inetd.conf.
  2697.  
  2698.  
  2699.  
  2700.  
  2701.   The inetd man page describes what each of the fields are, but put
  2702.   simply, each entry describes what program should be executed when an
  2703.   incoming connection is received on the socket listed as the first
  2704.   entry. Those entries which have incoming where the program name and
  2705.   arguments would be are those services that are provided internally by
  2706.   the inetd program.
  2707.   The conversion between the service name in the first column, and the
  2708.   actual socket number it refers to is performed by the /etc/services
  2709.   file.
  2710.  
  2711.  
  2712.   11.3.2.  A sample /etc/services file.
  2713.  
  2714.   The /etc/services file is a simple table of Internet service names and
  2715.   the socket number and protocol is uses. This table is used by a number
  2716.   of programs including inetd, telnet and tcpdump.  It makes life a
  2717.   little easier by allowing us to refer to services by name rather than
  2718.   by number.
  2719.  
  2720.   The following is a sample of what a simple /etc/services file might
  2721.   look like:
  2722.  
  2723.  
  2724.  
  2725.  
  2726.  
  2727.  
  2728.  
  2729.  
  2730.  
  2731.  
  2732.  
  2733.  
  2734.  
  2735.  
  2736.  
  2737.  
  2738.  
  2739.  
  2740.  
  2741.  
  2742.  
  2743.  
  2744.  
  2745.  
  2746.  
  2747.  
  2748.  
  2749.  
  2750.  
  2751.  
  2752.  
  2753.  
  2754.  
  2755.  
  2756.  
  2757.  
  2758.  
  2759.  
  2760.  
  2761.  
  2762.  
  2763.  
  2764.  
  2765.  
  2766.  
  2767.  
  2768.  
  2769.  
  2770.  
  2771.  
  2772.  
  2773.   #
  2774.   # /etc/services - database of service name, socket number
  2775.   #                 and protocol.
  2776.   #
  2777.   # Original Author:
  2778.   #     Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
  2779.   #
  2780.   tcpmux     1/tcp
  2781.   echo       7/tcp
  2782.   echo       7/udp
  2783.   discard    9/tcp   sink null
  2784.   discard    9/udp   sink null
  2785.   systat     11/tcp  users
  2786.   daytime    13/tcp
  2787.   daytime    13/udp
  2788.   netstat    15/tcp
  2789.   chargen    19/tcp  ttytst source
  2790.   chargen    19/udp  ttytst source
  2791.   ftp-data   20/tcp
  2792.   ftp        21/tcp
  2793.   telnet     23/tcp
  2794.   smtp       25/tcp  mail
  2795.   time       37/tcp  timserver
  2796.   time       37/udp  timserver
  2797.   name       42/udp  nameserver
  2798.   whois      43/tcp  nicname    # usually to sri-nic
  2799.   domain     53/tcp
  2800.   domain     53/udp
  2801.   finger     79/tcp
  2802.   link       87/tcp  ttylink
  2803.   hostnames  101/tcp hostname   # usually to sri-nic
  2804.   sunrpc     111/tcp
  2805.   sunrpc     111/tcp portmapper # RPC 4.0 portmapper TCP
  2806.   sunrpc     111/udp
  2807.   sunrpc     111/udp portmapper # RPC 4.0 portmapper UDP
  2808.   auth       113/tcp authentication
  2809.   nntp       119/tcp usenet     # Network News Transfer
  2810.   ntp        123/tcp            # Network Time Protocol
  2811.   ntp        123/udp            # Network Time Protocol
  2812.   snmp       161/udp
  2813.   snmp-trap  162/udp
  2814.   exec       512/tcp            # BSD rexecd(8)
  2815.   biff       512/udp comsat
  2816.   login      513/tcp            # BSD rlogind(8)
  2817.   who        513/udp whod       # BSD rwhod(8)
  2818.   shell      514/tcp cmd        # BSD rshd(8)
  2819.   syslog     514/udp            # BSD syslogd(8)
  2820.   printer    515/tcp spooler    # BSD lpd(8)
  2821.   talk       517/udp            # BSD talkd(8)
  2822.   ntalk      518/udp            # SunOS talkd(8)
  2823.   route      520/udp routed     # 521/udp too
  2824.   timed      525/udp timeserver
  2825.   mount      635/udp            # NFS Mount Service
  2826.   pcnfs      640/udp            # PC-NFS DOS Authentication
  2827.   bwnfs      650/udp            # BW-NFS DOS Authentication
  2828.   listen     1025/tcp listener  # RFS remote_file_sharing
  2829.   ingreslock 1524/tcp           # ingres lock server
  2830.   nfs        2049/udp           # NFS File Service
  2831.   irc        6667/tcp           # Internet Relay Chat
  2832.   # End of services.
  2833.  
  2834.  
  2835.  
  2836.  
  2837.   The telnet entry tells us that the telnet service uses socket number
  2838.   23 and the tcp protocol. The domain entry tells us that the Domain
  2839.   Name Service uses socket number 52 and both tcp and udp protocols. You
  2840.   should have an appropriate /etc/services entry for each
  2841.   /etc/inetd.conf entry.
  2842.  
  2843.  
  2844.   11.3.3.  A sample /etc/protocols file.
  2845.  
  2846.   The /etc/protocols file is a table of protocol name with its
  2847.   corresponding protocol number. Since the number of protocols in use is
  2848.   small this file is quite trivial.
  2849.  
  2850.  
  2851.  
  2852.        #
  2853.        # /etc/protocols - database of protocols.
  2854.        #
  2855.        # Original Author:
  2856.        #   Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
  2857.        #
  2858.        ip   0   IP   # internet protocol
  2859.        icmp 1   ICMP # internet control message protocol
  2860.        igmp 2   IGMP # internet group multicast protocol
  2861.        ggp  3   GGP  # gateway-gateway protocol
  2862.        tcp  6   TCP  # transmission control protocol
  2863.        pup  12  PUP  # PARC universal packet protocol
  2864.        udp  17  UDP  # user datagram protocol
  2865.        idp  22  IDP
  2866.        raw  255 RAW
  2867.        #
  2868.        # End of protocols.
  2869.  
  2870.  
  2871.  
  2872.  
  2873.  
  2874.   11.4.  Name Resolution.
  2875.  
  2876.   Name Resolution is the process of converting a hostname in the
  2877.   familiar dotted notation (e.g. tsx-11.mit.edu) into an IP address
  2878.   which the network software understands. There are two principal means
  2879.   of achieving this in a typical installation, one simple, and one more
  2880.   complex.
  2881.  
  2882.  
  2883.   11.4.1.  /etc/hosts
  2884.  
  2885.   /etc/hosts contains a list of ip addresses and the hostnames they map
  2886.   to. In this way, you can refer to other machines on the network by
  2887.   name, as well as their ip address. Using a nameserver (see section
  2888.   `named') allows you to do the same name->ip address translation
  2889.   automatically. (Running named allows you to run your own nameserver on
  2890.   your linux machine).  This file needs to contain at least an entry for
  2891.   127.0.0.1 with the name localhost. If you're not only using loopback,
  2892.   you need to add an entry for your ip address, with your full hostname
  2893.   (such as loomer.vpizza.com). You may also wish to include entries for
  2894.   your gateways and network addresses.
  2895.  
  2896.   For example, if loomer.vpizza.com has the ip address 128.253.154.32,
  2897.   the /etc/hosts file would contain:
  2898.  
  2899.  
  2900.  
  2901.  
  2902.  
  2903.  
  2904.  
  2905.   # /etc/hosts
  2906.   # List of hostnames and their ip addresses
  2907.   127.0.0.1               localhost
  2908.   128.253.154.32          loomer.vpizza.com loomer
  2909.   # end of hosts
  2910.  
  2911.  
  2912.  
  2913.  
  2914.   Once again you will need to edit this file to suit your own needs. If
  2915.   you're only using loopback, the only line in /etc/hosts should be for
  2916.   127.0.0.1, with both localhost and your hostname after it.
  2917.  
  2918.   Note that in the second line, above, there are two names for
  2919.   128.253.154.32: loomer.vpizza.com and just loomer.  The first name is
  2920.   the full hostname of the system, called the "Fully Qualified Domain
  2921.   Name", and the second is an alias for it. The second allows you to
  2922.   type only rlogin loomer instead of having to type the entire hostname.
  2923.   You should ensure that you put the Fully Qualified Domain Name in the
  2924.   line before the alias name.
  2925.  
  2926.  
  2927.   11.4.2.  named - do I need thee ?
  2928.  
  2929.   `I dub thee ..'
  2930.  
  2931.   named is the nameserver daemon for many unix-like operating systems.
  2932.   It allows your machine to serve the name lookup requests, not only for
  2933.   itself, but also for other machines on the network, that is, if
  2934.   another machine wants to find the address for `goober.norelco.com',
  2935.   and you have this machines address in your named database, then you
  2936.   can service the request and tell other machines what `goobers' address
  2937.   is.
  2938.  
  2939.   Under older implementations of Linux tcp/ip, to create aliases for
  2940.   machine names, (even for your own machine), you had to run named on
  2941.   your Linux machine to do the hostname to IP address conversion. One
  2942.   problem with this is that named is comparitively difficult to set up
  2943.   properly, and maintain.  To solve this problem, a program called
  2944.   hostcvt.build was made available on Linux systems to translate your
  2945.   /etc/hosts file into the many files that make up named database files.
  2946.   However even with this problem overcome, named still uses CPU overhead
  2947.   and causes network traffic.
  2948.  
  2949.   The bottom line is this: You do not need to run named on your Linux
  2950.   system. The SLS instructions will probably tell you to run
  2951.   hostcvt.build to setup named. This is simply unnecessary unless you
  2952.   want to make your Linux system function as a nameserver for other
  2953.   machines, in which case you probably should learn some more about
  2954.   named anyway. When looking up hostnames, your linux machine will first
  2955.   check the /etc/hosts file, and then ask the nameserver out on the net.
  2956.  
  2957.   The only reason you may want to run named would be if:
  2958.  
  2959.  
  2960.   o  You're setting up a network of machines, and need a nameserver for
  2961.      one of them, and don't have a nameserver out on the net somewhere.
  2962.  
  2963.   o  Your network administrators want you to run your Linux system as a
  2964.      nameserver for some reason.
  2965.  
  2966.   o  You have a slow slip connection, and want to run a small cache-only
  2967.      nameserver on your Linux machine so that you don't have to go out
  2968.      on the serial line for every name lookup that occurs. If you're
  2969.      only going to be connecting to a small number of hosts on the net,
  2970.      and you know what their addresses are, then you can put them in
  2971.      your hosts file and not need to query a nameserver at all.
  2972.      Generally namelookup isn't that slow and should work fine over a
  2973.      slip link anyway.
  2974.  
  2975.   o  You want to run a nameserver for fun and excitement.
  2976.  
  2977.   In general, you do NOT need to run named: this means that you can
  2978.   comment it out from your rc.inet2 file, and you don't have to run
  2979.   hostcvt.build. If you want to alias machine names, for example, if you
  2980.   want to refer to loomer.vpizza.com as just loomer, then you can add as
  2981.   alias in /etc/hosts instead. There is no reason to run named unless
  2982.   you have a specific requirement to do so. If you have access to a
  2983.   nameserver, (and your network administrators will tell you its
  2984.   address), and most networks do, then don't bother running named.
  2985.  
  2986.   If you're only using loopback, you can run named and set your
  2987.   nameserver address to 127.0.0.1, but since you are the only machine
  2988.   you can talk to, this would be quite bizzarre, as you'd never need to
  2989.   call it.
  2990.  
  2991.  
  2992.   11.4.3.  /etc/networks
  2993.  
  2994.   The /etc/networks file lists the names and addresses of your own, and
  2995.   other, networks. It is used by the route command, and allows you to
  2996.   specify a network by name, should you so desire.
  2997.  
  2998.   Every network you wish to add a route to using the route command
  2999.   should have an entry in the /etc/networks file, unless you also
  3000.   specify the -net argument in the route command line.
  3001.  
  3002.   Its format is simliar to that of /etc/hosts file above, and an example
  3003.   file might look like:
  3004.  
  3005.  
  3006.  
  3007.        #
  3008.        # /etc/networks: list all networks that you wish to add route commands
  3009.        #                for in here
  3010.        #
  3011.        default         0.0.0.0         # default route    - recommended
  3012.        loopnet         127.0.0.0       # loopback network - recommended
  3013.        mynet           128.253.154.0   # Example network CHANGE to YOURS
  3014.        #
  3015.        # end of networks
  3016.  
  3017.  
  3018.  
  3019.  
  3020.  
  3021.   11.4.4.  /etc/host.conf
  3022.  
  3023.   The system has some library functions called the resolver library.
  3024.   This file specifies how your system will lookup host names. It should
  3025.   contain at least the following two lines:
  3026.  
  3027.  
  3028.  
  3029.        order hosts,bind
  3030.        multi on
  3031.  
  3032.  
  3033.  
  3034.  
  3035.   These two lines tell the resolve libraries to first check the
  3036.   /etc/hosts file, and then to ask the nameserver (if one is present).
  3037.   The multi entry allows you to have multiple IP addresses for a given
  3038.   machine name in /etc/hosts.
  3039.  
  3040.   This file comes from the implementation of the resolv+ bind library
  3041.   for Linux. You can find further documentation in the resolv+(8) man
  3042.   page if you have it. If you don't, it can be obtained from:
  3043.  
  3044.   sunsite.doc.ic.ac.uk
  3045.  
  3046.  
  3047.        /computing/comms/tcpip/nameserver/resolv+/resolv+2.1.1.tar.Z
  3048.  
  3049.  
  3050.  
  3051.  
  3052.   This file contains the resolv+.8 man page for the resolver library.
  3053.  
  3054.  
  3055.   11.4.5.  /etc/resolv.conf
  3056.  
  3057.   This file actually configures the system name resolver, and contains
  3058.   two types of entries: The addresses of your nameservers (if any), and
  3059.   the name of your domain, if you have one. If you're running your own
  3060.   nameserver (i.e running named on your Linux machine), then the address
  3061.   of your nameserver is 127.0.0.1, the loopback address.
  3062.  
  3063.   Your domain name is your fully qualified hostname (if you're a
  3064.   registered machine on the Internet, for example), with the hostname
  3065.   component removed.  That is, if your full hostname is
  3066.   loomer.vpizza.com, then your domain name is vpizza.com, without the
  3067.   hostname loomer.
  3068.  
  3069.   For example, if you machine is goober.norelco.com, and has a
  3070.   nameserver at the address 128.253.154.5, then your /etc/resolv.conf
  3071.   file would look like:
  3072.  
  3073.  
  3074.  
  3075.        domain norelco.com
  3076.        nameserver 127.253.154.5
  3077.  
  3078.  
  3079.  
  3080.  
  3081.   You can specify more than one nameserver. Each one must have a
  3082.   nameserver entry in the resolv.conf file.
  3083.  
  3084.   Remember, if you're running on loopback, you don't need a nameserver.
  3085.  
  3086.  
  3087.   11.4.6.  Configuring your Hostname - /etc/HOSTNAME
  3088.  
  3089.   After you have configured everything else, there is one small task
  3090.   that remains, you need to configure your own machine with a name. This
  3091.   is so that application programs like sendmail can know who you are to
  3092.   accept mail, and so that your machine can identify itself to other
  3093.   machines that it might be connected to.
  3094.  
  3095.   There are two programs that are used to configure this sort of
  3096.   information, and they are commonly misused. They are hostname and
  3097.   domainname.
  3098.  
  3099.   If you are using a release of net-tools earlier than 1.1.38 then you
  3100.   can include a command in your /etc/rc file that looks like this:
  3101.  
  3102.  
  3103.        /bin/hostname -S
  3104.  
  3105.  
  3106.  
  3107.  
  3108.   and this will cause the hostname command to read a file called
  3109.   /etc/HOSTNAME which it expects will contain a "Fully Qualified Domain
  3110.   Name", that is, your machines hostname including the domainname. It
  3111.   will split the F.Q.D.N. into its DNS hostname and domainname
  3112.   components and set them appropriately for you.
  3113.  
  3114.   For example, the machine above would have the file /etc/HOSTNAME:
  3115.  
  3116.  
  3117.  
  3118.        goober.norelco.com
  3119.  
  3120.  
  3121.  
  3122.  
  3123.   If you are using the hostname that came with net-tools-1.1.38 or
  3124.   later, then you would add a command at the end of your
  3125.   /etc/rc.d/rc.inet1 file like:
  3126.  
  3127.  
  3128.  
  3129.        /bin/hostname goober.norelco.com
  3130.  
  3131.  
  3132.  
  3133.  
  3134.   or if you have upgraded from a previous release, you could add:
  3135.  
  3136.  
  3137.  
  3138.        /bin/hostname -F /etc/HOSTNAME
  3139.  
  3140.  
  3141.  
  3142.  
  3143.   and it would behave in the same way as for the earlier version.
  3144.  
  3145.   The /bin/domainname command is for setting the N.I.S.  domain name NOT
  3146.   the D.N.S. domain name. You do not need to set this unless you are
  3147.   running NIS, which is briefly described later.
  3148.  
  3149.  
  3150.   11.5.  Other files.
  3151.  
  3152.   There are of course many other files in the /etc directory which you
  3153.   may need to dabble with later on. Instead of going into them here, I'm
  3154.   going to provide the bare minimum to get you on the net. More
  3155.   information is available in Olaf's Network Administration Guide. It
  3156.   picks up where this HOWTO ends, and some more information will be
  3157.   provided in later versions of this document.
  3158.  
  3159.   Once you have all of the files set up, and everthing in the right
  3160.   place, you should be able to reboot you new kernel, and net away to
  3161.   your hearts content.  However I strongly suggest that you keep a
  3162.   bootable copy of your old kernel and possibly even a `recovery disk',
  3163.   in case something goes wrong, so that you can get back in and fix it.
  3164.   You might try HJLu's `single disk boot disk', or `disk1' from an SLS
  3165.   distribution.
  3166.  
  3167.  
  3168.  
  3169.   12.  Advanced Configurations.
  3170.  
  3171.   The configurations above have described how a typical Linux
  3172.   workstation might be configured for normal end-user operation. Some of
  3173.   you will have other requirements which will require slightly more
  3174.   advanced configurations. What follows are examples of some the more
  3175.   common of these.
  3176.  
  3177.   The details of the AX.25, Ottawa PI and generic SCC drivers have been
  3178.   moved to the HAM-HOWTO <http://sunsite.unc.edu/mdw/HOWTO/HAM-
  3179.   HOWTO.html>.
  3180.  
  3181.  
  3182.   12.1.  PPP - Point to Point Protocol.
  3183.  
  3184.   The Point to Point Protocol is a modern and efficient protocol for
  3185.   conveying multiple protocols, tcp/ip for one, across serial links,
  3186.   that a lot of people use in place of slip. It offers enhanced
  3187.   functionality, error detection and security options. It corrects a
  3188.   number of deficiencies that are found in slip, and is suitable for
  3189.   both asynchronous links and synchronous links alike.
  3190.  
  3191.   An important feature of PPP operation is dynamic address allocation,
  3192.   and this feature will almost certainly be exploited by your PPP
  3193.   server. This feature allows a PPP client, with a specially formatted
  3194.   frame, to request its address from the server. In this way
  3195.   configuration is somewhat less messy than with slip, since this
  3196.   ability to retrieve your address must occur outside of the protocol.
  3197.  
  3198.   The authors of the Linux port are Michael Callahan,
  3199.   <callahan@maths.ox.ac.uk> and  Al Longyear, <longyear@netcom.com>.
  3200.   Most of this information has come from the documentation that
  3201.   accompanies the PPP software. The documentation is quite complete, and
  3202.   will tell you much more than I present here.
  3203.  
  3204.   The Linux PPP code has come out of Alpha testing and is now available
  3205.   as a public release. The 1.0.0 Linux PPP code is based on Paul
  3206.   Mackerras's free PPP for BSD-derivative operating systems. The 1.0.0
  3207.   release is based on version 2.1.1 of the free PPP code.
  3208.  
  3209.   The PPP code comes in two parts. The first is a kernel module which
  3210.   handles the assembly and disassembly of the frames, and the second is
  3211.   a set of protocols called LCP, IPCP, UPAP and CHAP, for negotiating
  3212.   link options, bringing the link into a functioning state and for
  3213.   authentication.
  3214.  
  3215.  
  3216.   12.1.1.  Why would I use PPP in place of SLIP ?
  3217.  
  3218.   You would use PPP in place of SLIP for a few reasons. The most common
  3219.   are:
  3220.  
  3221.  
  3222.      Your Internet Provider supports only PPP
  3223.         The most obvious reason you would use PPP in favour of SLIP is
  3224.         when your Internet Provider supports PPP and not SLIP. Ok, I
  3225.         said it was obvious.
  3226.  
  3227.      You have a normally noisy serial line
  3228.         PPP provides a frame check sequence for each and every frame
  3229.         transmitted, SLIP does not. If you have a noisy serial line, and
  3230.         you are using SLIP, your error correction will be performed end
  3231.         to end, that is between your machine and the destination
  3232.         machine, whereas with PPP the error detection occurs locally,
  3233.         between your machine and the PPP server. This makes for faster
  3234.         recovery from errors.
  3235.      You need to make use of some other feature PPP offers.
  3236.         PPP provides a number of features that SLIP does not. You might
  3237.         for example want to carry not only IP, but also DECNET, or
  3238.         AppleTalk frames over your serial link. PPP will allow you to do
  3239.         this.
  3240.  
  3241.  
  3242.   12.1.2.  Where to obtain the PPP software.
  3243.  
  3244.   The ppp software is available from:
  3245.  
  3246.   sunsite.unc.edu
  3247.  
  3248.  
  3249.        /pub/Linux/system/Networking/serial/ppp-2.1.2d.tar.gz
  3250.  
  3251.  
  3252.  
  3253.  
  3254.   This file contains the kernel source, and the pppd source and binary.
  3255.   Version 1.0.0 is meant for use with kernels 1.0.x and 1.1.x.
  3256.  
  3257.  
  3258.   12.1.3.  Installing the PPP software.
  3259.  
  3260.   Installation of the PPP software is fairly straightforward.
  3261.  
  3262.  
  3263.   12.1.3.1.  The kernel driver.
  3264.  
  3265.   Some support for ppp has been built into the kernel for some time.  so
  3266.   you are advised to run a modern kernel. Configuring the kernel is
  3267.   fairly easy, the following should work ok:
  3268.  
  3269.  
  3270.  
  3271.        # make config   (remembering to answer yes to PPP support)
  3272.        # make dep
  3273.        # make          (remember to install the new kernel after recompiling!)
  3274.  
  3275.  
  3276.  
  3277.  
  3278.   When you reboot with the new kernel you should see messages at boot
  3279.   time that look something like these:
  3280.  
  3281.  
  3282.  
  3283.        PPP: version 0.2.7 (4 channels) NEW_TTY_DRIVERS OPTIMIZE_FLAGS
  3284.        TCP compression code copyright 1989 Regents of the University of California
  3285.        PPP line discipline registered.
  3286.  
  3287.  
  3288.  
  3289.  
  3290.   These indicate that the PPP support has in fact been compiled into
  3291.   your kernel.
  3292.  
  3293.   Now, try looking at the contents of /proc/net/dev. You should be
  3294.   careful not to use more or less on the files in the /proc filesystem,
  3295.   as some of them check the filesize first and it is a feature of the
  3296.   /proc filesystem that the files are zero length, so use:
  3297.  
  3298.  
  3299.        # cat /proc/net/dev
  3300.  
  3301.   It should look something like this:
  3302.  
  3303.  
  3304.  
  3305.        Inter-|   Receive                  |  Transmit
  3306.         face |packets errs drop fifo frame|packets errs drop fifo colls carrier
  3307.        lo:        0    0    0    0    0        0    0    0    0     0    0
  3308.        ppp0:      0    0    0    0    0        0    0    0    0     0    0
  3309.        ppp1:      0    0    0    0    0        0    0    0    0     0    0
  3310.        ppp2:      0    0    0    0    0        0    0    0    0     0    0
  3311.        ppp3:      0    0    0    0    0        0    0    0    0     0    0
  3312.  
  3313.  
  3314.  
  3315.  
  3316.   This indicates that the kernel driver is installed correctly.
  3317.  
  3318.  
  3319.   12.1.3.2.  pppd
  3320.  
  3321.   To extract the ppp software and associated utilities the following
  3322.   should work ok:
  3323.  
  3324.  
  3325.  
  3326.        # cd /usr/src
  3327.        # gzip -dc ppp-2.1.2d.tar.gz | tar xvf -
  3328.  
  3329.  
  3330.  
  3331.  
  3332.   If you want to recompile pppd, type make in the pppd subdirectory of
  3333.   the installation.  There will be some warnings when compiling lcp.c,
  3334.   upap.c and chap.c but these are OK.
  3335.  
  3336.   If you want to recompile chat, consult README.linux in the chat
  3337.   directory.
  3338.  
  3339.   To install, type make install in the chat and pppd directories.   This
  3340.   will put chat and pppd binaries in /usr/sbin and the pppd.8 manual
  3341.   page in /usr/man/man8.
  3342.  
  3343.   pppd needs to be run as root. You can either make it suid root or just
  3344.   use it when you are root. make install will try to install it suid
  3345.   root, so if you are root when you try to install it, it should work
  3346.   ok.
  3347.  
  3348.  
  3349.   12.1.4.  Configuring and using the PPP software.
  3350.  
  3351.   Like slip, you can configure the PPP software as either a client or a
  3352.   server.  The chat program performs a similar function to the dip
  3353.   program in that it is used to automate the dialling and login
  3354.   procedure to the remote machine, unlike dip though, it does not
  3355.   perform the ioctl to convert the serial line into a PPP line. This is
  3356.   performed by the pppd program. pppd can act as either the client or
  3357.   the server. When used as a client, it normally invokes the chat
  3358.   program to perform the connection and login, and then it takes over by
  3359.   performing the ioctl to change the line discipline to ppp, performs a
  3360.   number of steps in configuring your machine to talk to the remote
  3361.   machine and then steps out of the way to let you operate.
  3362.  
  3363.   Please refer to the pppd and chat man pages for more information.
  3364.   Please also refer to the README file that comes with the ppp software,
  3365.   as its description of the operation of these utilities is much more
  3366.   complete than I have described here.
  3367.   12.1.4.1.  Configuring a PPP client by dial-up modem.
  3368.  
  3369.   This is perhaps what most of you will want to do, so it appears first.
  3370.   You would use this configuration when you have a network provider who
  3371.   supports ppp by dialup modem. When you want to establish your
  3372.   connection you simply have to invoke the pppd program with appropriate
  3373.   arguments.
  3374.  
  3375.   The following example might look a little confusing at first, but it
  3376.   is easier to understand if you can see that all it is doing is taking
  3377.   a command line for the chat program as its first argument and then
  3378.   others for itself later.
  3379.  
  3380.  
  3381.  
  3382.        pppd connect 'chat -v "" ATDT5551212 CONNECT "" ogin: ppp word: password'\
  3383.        /dev/cua1 38400 debug crtscts modem defaultroute 192.1.1.17:
  3384.  
  3385.  
  3386.  
  3387.  
  3388.   What this says is:
  3389.  
  3390.  
  3391.   o  Invoke the chat program with the command line:
  3392.  
  3393.  
  3394.        chat -v "" ATDT5551212 CONNECT "" ogin: ppp word: password
  3395.  
  3396.  
  3397.  
  3398.  
  3399.   Which says: Dial 5551212, wait for the `CONNECT' string, transmit a
  3400.   carriage return, wait for the string `ogin:', transmit the string
  3401.   `ppp', wait for the string `word:', transmit the string `password',
  3402.   and quit.
  3403.  
  3404.   o  Use serial device /dev/cua1
  3405.  
  3406.   o  Set its speed to 38400 bps.
  3407.  
  3408.   o  debug means log status messages to syslog
  3409.  
  3410.   o  crtscts means use hardware handshaking to the modem - recommended.
  3411.  
  3412.   o  modem means that pppd will attempt to hang up the call before and
  3413.      after making the call.
  3414.  
  3415.   o  defaultroute instructs pppd to add a routing entry that makes this
  3416.      the default route. In most cases this will be what you want.
  3417.  
  3418.   o  192.1.1.17: says to set the ppp interfaces address to 192.1.1.17.
  3419.      This argument normally looks like x.x.x.x:y.y.y.y, where x.x.x.x is
  3420.      your ip address, and y.y.y.y is the ip address of the server. If
  3421.      you leave off the server's address, pppd will ask for it, and
  3422.      x.x.x.x will be set to your machines ip address.
  3423.  
  3424.   Please refer to the pppd and chat man pages for more information.
  3425.   Please also refer to the README file that comes with the ppp software,
  3426.   as its description of the above is much more complete than I have
  3427.   described here.
  3428.  
  3429.  
  3430.  
  3431.  
  3432.  
  3433.   12.1.4.2.  Configuring a PPP client via a leased line.
  3434.  
  3435.   Configuring a PPP client via a leased line is very simple. You will
  3436.   still use the pppd program, but since you won't need to establish the
  3437.   modem link the arguments to the chat program can be much simpler.
  3438.  
  3439.   The example I'm presenting here assumes that the ppp server doesn't
  3440.   require any special login procedure. I do this because every login
  3441.   procedure will be different, and if you are simply running a local
  3442.   connection then it is possible that you might have it set up this way.
  3443.  
  3444.  
  3445.  
  3446.        pppd defaultroute noipdefault debug \
  3447.        kdebug 2 /dev/cua0 9600
  3448.  
  3449.  
  3450.  
  3451.  
  3452.   This will open the serial device, generate the ioctl to change it into
  3453.   a pppdevice, set your default route via the ppp interface.  The
  3454.   noipdefault argument instructs the pppd program to request the address
  3455.   to use for this device from the server. Debug messages will go to
  3456.   syslog. The kdebug 2 argument causes the debug messages to be set to
  3457.   level 2, this will give you slightly more information on what is going
  3458.   on. It will use /dev/cua0 at 9600 bps.
  3459.  
  3460.   If your ppp server does require some sort of login procedure, you can
  3461.   easily use the chat program as in the example for the dialup server to
  3462.   perform that function for you.
  3463.  
  3464.   Please refer to the pppd and chat man pages for more information.
  3465.   Please also refer to the README file that comes with the ppp software,
  3466.   as its description of the above is much more complete than I have
  3467.   described here.
  3468.  
  3469.  
  3470.   12.1.4.3.  Configuring a PPP server.
  3471.  
  3472.   Configuring a PPP server is similar to establishing a slip server.
  3473.   You can create a special `ppp' account, which uses an executable
  3474.   script as its login shell. The /etc/passwd entry might look like:
  3475.  
  3476.  
  3477.  
  3478.        ppp:EncPasswd:102:50:PPP client login:/tmp:/etc/ppp/ppplogin
  3479.  
  3480.  
  3481.  
  3482.  
  3483.   and the /etc/ppp/ppplogin script might look like:
  3484.  
  3485.  
  3486.  
  3487.        #!/bin/sh
  3488.        exec /usr/sbin/pppd passive :192.1.2.23
  3489.  
  3490.  
  3491.  
  3492.  
  3493.   The address that you provide will be the address that the calling
  3494.   machine will be assigned.
  3495.  
  3496.   Naturally, if you want multiple users to have simultaneous access you
  3497.   would have to create a number of startup scripts and individual
  3498.   accounts for each to use, as you can only put one ip address in each
  3499.   script.
  3500.  
  3501.  
  3502.   12.1.5.  Where to obtain more information on PPP, or report bugs.
  3503.  
  3504.   Most discussion on PPP for Linux takes place on the PPP mailing list.
  3505.  
  3506.   To join the Linux linux-ppp channel on the mail list server, send mail
  3507.   to:
  3508.  
  3509.  
  3510.  
  3511.        Majordomo@vger.rutgers.edu
  3512.  
  3513.        with the line:
  3514.  
  3515.        subscribe linux-ppp
  3516.  
  3517.        in the message body. The subject line is ignored.
  3518.  
  3519.  
  3520.  
  3521.  
  3522.   Please remember that when you are reporting bugs or problems you
  3523.   should include as much information relevant to the problem as you can
  3524.   to assist those that will help you understand your problem.
  3525.  
  3526.   You might also like to check out:
  3527.  
  3528.   RFCS 1548, 1331, 1332, 1333, and 1334. These are the definitive
  3529.   documents for PPP.
  3530.  
  3531.   W. Richard Stevens also describes PPP in his book `TCP/IP Illustrated
  3532.   Volume 1', (Addison-Wessley, 1994, ISBN 0-201-63346-9).
  3533.  
  3534.  
  3535.   12.2.  Configuring Linux as a Slip Server.
  3536.  
  3537.   If you have a machine that is perhaps network connected, that you'd
  3538.   like other people be able to dial into, and provide network services,
  3539.   then you will need to configure your machine as a server. If you want
  3540.   to use slip as the serial line protocol, then currently you have three
  3541.   options as to how to configure your Linux machine as a slip server. My
  3542.   preference would be to use the first presented, sliplogin, as it seems
  3543.   the easiest to configure and understand, but I will present a summary
  3544.   of each, so you make your mind.
  3545.  
  3546.  
  3547.   12.2.1.  Slip Server using sliplogin.
  3548.  
  3549.   sliplogin is a program that you can use in place of the normal login
  3550.   shell for slip users that converts the terminal line into a slip line.
  3551.   It allows you to configure your Linux machine as either a static
  3552.   address server, users get the same address everytime they call in, or
  3553.   a dynamic address server, where users get an address allocated for
  3554.   them which will not necessarily be the same as the last time they
  3555.   called.
  3556.  
  3557.   The caller will login as per the standard login process, entering
  3558.   their username and password, but instead of being presented with a
  3559.   shell after their login, sliplogin is executed which searches its
  3560.   configuration file (/etc/slip.hosts) for an entry with a login name
  3561.   that matches that of the caller. If it locates one, it configures the
  3562.   line as an 8bit clean line, and uses an ioctl call to convert the line
  3563.   discipline to slip. When this process is complete, the last stage of
  3564.   configuration takes place, where sliplogin invokes a shell script
  3565.   which configures the slip interface with the relevant ip address,
  3566.   netmask and sets appropriate routing in place.  This script is usually
  3567.   called /etc/slip.login, but in a similar manner to getty, if you have
  3568.   certain callers that require special initialisation, then you can
  3569.   create configuration scripts called /etc/slip.login.loginname that
  3570.   will be run instead of the default specifically for them.
  3571.  
  3572.   There are either three or four files that you need to configure to get
  3573.   sliplogin working for you. I will detail how and where to get the
  3574.   software, and how each is configured in detail. The files are:
  3575.  
  3576.  
  3577.   o  /etc/passwd, for the dialin user accounts.
  3578.  
  3579.   o  /etc/slip.hosts, to contain the information unique to each dial-in
  3580.      user.
  3581.  
  3582.   o  /etc/slip.login, which manages the configuration of the routing
  3583.      that needs to be performed for the user.
  3584.  
  3585.   o  /etc/slip.tty, which is required only if you are configuring your
  3586.      server for dynamic address allocation and contains a table of
  3587.      addresses to allocate
  3588.  
  3589.   o  /etc/slip.logout, which contains commands to clean up after the
  3590.      user has hung up or logged out.
  3591.  
  3592.  
  3593.   12.2.1.1.  Where to get sliplogin
  3594.  
  3595.   sliplogin can be obtained from:
  3596.  
  3597.   sunsite.unc.edu
  3598.  
  3599.  
  3600.        /pub/Linux/system/Network/serial/sliplogin-1.3.tar.gz
  3601.  
  3602.  
  3603.  
  3604.  
  3605.   The tar file contains both source, precompiled binaries and a man
  3606.   page.
  3607.  
  3608.   To ensure that only authorised users will be able to run sliplogin
  3609.   program, you should add an entry to your /etc/group file similar to
  3610.   the following:
  3611.  
  3612.  
  3613.  
  3614.         ..
  3615.        slip::13:radio,fred
  3616.         ..
  3617.  
  3618.  
  3619.  
  3620.  
  3621.   When you install the sliplogin package, the Makefile will change the
  3622.   group ownership of the sliplogin program to slip, and this will mean
  3623.   that only users who belong to that group will be able to execute it.
  3624.   The example above will allow only users radio and fred to execute
  3625.   sliplogin.
  3626.  
  3627.   To install the binaries into your /sbin directory, and the man page
  3628.   into section 8, do the following:
  3629.  
  3630.  
  3631.        # cd /usr/src
  3632.        # gzip -dc .../sliplogin-1.3.tar.gz | tar xvf -
  3633.        # cd src
  3634.        # make install
  3635.  
  3636.  
  3637.  
  3638.  
  3639.   If you want to recompile the binaries before installation, add a make
  3640.   clean before the make install. If you want to install the binaries
  3641.   somewhere else, you will need to edit the Makefile install rule.
  3642.  
  3643.   Please read the README files that come with the package for more
  3644.   information.
  3645.  
  3646.  
  3647.   12.2.1.2.  Configuring /etc/passwd for Slip hosts.
  3648.  
  3649.   Normally you would create some special logins for Slip callers in your
  3650.   /etc/passwd file. A convention commonly followed is to use the
  3651.   hostname of the calling host with a capital `S' prefixing it. So, for
  3652.   example, if the calling host is called radio then you could create a
  3653.   /etc/passwd entry that looked like:
  3654.  
  3655.  
  3656.  
  3657.        Sradio:FvKurok73:1427:1:radio slip login:/tmp:/sbin/sliplogin
  3658.  
  3659.  
  3660.  
  3661.  
  3662.   It doesn't really matter what the account is called, so long as it is
  3663.   meaningful to you.
  3664.  
  3665.   Note: the caller doesn't need any special home directory, as they will
  3666.   not be presented with a shell from this machine, so /tmp is a good
  3667.   choice.  Also note that sliplogin is used in place of the normal login
  3668.   shell.
  3669.  
  3670.  
  3671.   12.2.1.3.  Configuring /etc/slip.hosts
  3672.  
  3673.   The /etc/slip.hosts file is the file that sliplogin searches for
  3674.   entries matching the login name to obtain configuration details for
  3675.   this caller. It is this file where you specify the ip address and
  3676.   netmask that will be assigned to the caller, and configured for their
  3677.   use. Sample entries for two hosts, one a static configuration for host
  3678.   radio, and another, a dynamic configuration for user host albert might
  3679.   look like:
  3680.  
  3681.  
  3682.  
  3683.        #
  3684.        Sradio    44.136.8.99    44.136.8.100   0xffffff00   normal
  3685.        Salbert   44.136.8.99    DYNAMIC        0xffffff00   compressed
  3686.        #
  3687.  
  3688.  
  3689.  
  3690.  
  3691.   The /etc/slip.hosts file entries are:
  3692.  
  3693.  
  3694.   1. the login name of the caller.
  3695.  
  3696.  
  3697.   2. ip address of the server machine, ie this machine.
  3698.  
  3699.   3. ip address that the caller will be assigned. If this field is coded
  3700.      DYNAMIC then an ip address will be allocated based on the
  3701.      information contained in your /etc/slip.tty file discussed later.
  3702.      Note: you must be using at least version 1.3 of sliplogin for this
  3703.      to work.
  3704.  
  3705.   4. the netmask assigned to the calling machine in hexadecimal notation
  3706.      eg 0xffffff00 for a Class C network mask.
  3707.  
  3708.   5. optional parameters to enable/disable compression and other
  3709.      features.
  3710.  
  3711.   Note: You can use either hostnames or IP addresses in dotted decimal
  3712.   notation for fields 2 and 3. If you use hostnames then those hosts
  3713.   must be resolvable, that is, your machine must be able to locate an ip
  3714.   address for those hostnames, otherwise the script will fail when it is
  3715.   called. You can test this by trying trying to telnet to the hostname,
  3716.   if you get the Trying nnn.nnn.nnn... message then your machine has
  3717.   been able to find an ip address for that name. If you get the message
  3718.   Unknown host, then it has not. If not, either use ip addresses in
  3719.   dotted decimal notation, or fix up your name resolver configuration
  3720.   (See section Name Resolution).
  3721.  
  3722.   The most commonly used optional paramaters for the opt1 and opt2
  3723.   fields are:
  3724.  
  3725.  
  3726.      normal
  3727.         to enable normal uncompressed slip.
  3728.  
  3729.      compressed
  3730.         to enable van Jacobsen header compression (cslip)
  3731.  
  3732.   Naturally these are mutually exclusive, you can use one or the other.
  3733.   For more information on the other options available, refer to the man
  3734.   pages.
  3735.  
  3736.  
  3737.   12.2.1.4.  Configuring the /etc/slip.login file.
  3738.  
  3739.   After sliplogin has searched the /etc/slip.hosts and found a matching
  3740.   entry, it will attempt to execute the /etc/slip.login file to actually
  3741.   configure the slip interface with its ip address and netmask.
  3742.  
  3743.   The sample /etc/slip.login file supplied with the sliplogin package
  3744.   looks like this:
  3745.  
  3746.  
  3747.  
  3748.        #!/bin/sh -
  3749.        #
  3750.        #       @(#)slip.login  5.1 (Berkeley) 7/1/90
  3751.        #
  3752.        # generic login file for a slip line.  sliplogin invokes this with
  3753.        # the parameters:
  3754.        #     $1       $2        $3       $4         $5        $6    $7-n
  3755.        #   slipunit ttyspeed loginname local-addr remote-addr mask opt-args
  3756.        #
  3757.        /sbin/ifconfig $1 $4 pointopoint $5 mtu 1500 -trailers up
  3758.        /sbin/route add $5
  3759.        arp -s $5 <hw_addr> pub
  3760.        exit 0
  3761.        #
  3762.  
  3763.   You will note that this script simply uses the ifconfig and route
  3764.   commands to configure the slip device with its ipaddress, remote ip
  3765.   address and netmask, and creates a route for the remote address via
  3766.   the slip device. Just the same as you would if you were using the
  3767.   slattach command.
  3768.  
  3769.   Note also the use of Proxy ARP to ensure that other hosts on the same
  3770.   ethernet as the server machine will know how to reach the dial-in
  3771.   host.  The <hw_addr> field should be the hardware address of the
  3772.   ethernet card in the machine. If your server machine isn't on an
  3773.   ethernet network then you can leave this line out completely.
  3774.  
  3775.  
  3776.   12.2.1.5.  Configuring the /etc/slip.logout file.
  3777.  
  3778.   When the call drops out, you want to ensure that the serial device is
  3779.   restored to its normal state so that future callers will be able to
  3780.   login correctly.  This is achieved with the use of the
  3781.   /etc/slip.logout file. It is quite simple in format.
  3782.  
  3783.  
  3784.  
  3785.        #!/bin/sh -
  3786.        #
  3787.        #               slip.logout
  3788.        #
  3789.        /sbin/ifconfig $1 down
  3790.        /sbin/route del $5
  3791.        arp -d $5
  3792.        exit 0
  3793.        #
  3794.  
  3795.  
  3796.  
  3797.  
  3798.   All it does is `down' the interface and delete the manual route
  3799.   previously created. It also uses the arp command to delete any proxy
  3800.   arp put in place, again, you don't need the arp command in the script
  3801.   if your server machine does not have an ethernet port.
  3802.  
  3803.  
  3804.   12.2.1.6.  Configuring the /etc/slip.tty file.
  3805.  
  3806.   If you are using dynamic ip address allocation (have any hosts
  3807.   configured with the DYNAMIC keyword in the /etc/slip.hosts file, then
  3808.   you must configure the /etc/slip.tty file to list what addresses are
  3809.   assigned to what port. You only need this file if you wish your server
  3810.   to dynamically allocate addresses to users.
  3811.  
  3812.   The file is a table that lists the tty devices that will support dial-
  3813.   in slip connections and the ip address that should be assigned to
  3814.   users who call in on that port.
  3815.  
  3816.   Its format is as follows:
  3817.  
  3818.  
  3819.        # slip.tty    tty -> IP address mappings for dynamic SLIP
  3820.        # format: /dev/tty?? xxx.xxx.xxx.xxx
  3821.        #
  3822.        /dev/ttyS0      192.168.0.100
  3823.        /dev/ttyS1      192.168.0.101
  3824.        #
  3825.  
  3826.  
  3827.  
  3828.  
  3829.   What this table says is that callers that dial in on port /dev/ttyS0
  3830.   who have their remote address field in the /etc/slip.hosts file set to
  3831.   DYNAMIC will be assigned an address of 192.168.0.100.
  3832.  
  3833.   In this way you need only allocate one address per port for all users
  3834.   who do not require an dedicated address for themselves. This helps you
  3835.   keep the number of addresses you need down to a minimum to avoid
  3836.   wastage.
  3837.  
  3838.  
  3839.   12.2.2.  Slip Server using dip.
  3840.  
  3841.   Let me start by saying that some of the information below came from
  3842.   the dip man pages, where how to run Linux as a slip server is briefly
  3843.   documented. Please also beware that the following has been based on
  3844.   the dip337j-uri.tgz package and probably will not apply to other
  3845.   versions of dip.
  3846.  
  3847.   dip has an input mode of operation, where it automatically locates an
  3848.   entry for the user who invoked it and configures the serial line as a
  3849.   slip link according to information it finds in the /etc/diphosts file.
  3850.   This input mode of operation is activated by invoking dip as diplogin.
  3851.   This therefore is how you use dip as a slip server, by creating
  3852.   special accounts where diplogin is used as the login shell.
  3853.  
  3854.   The first thing you will need to do is to make a symbolic link as
  3855.   follows:
  3856.  
  3857.  
  3858.  
  3859.        # ln -sf /usr/sbin/dip /usr/sbin/diplogin
  3860.  
  3861.  
  3862.  
  3863.  
  3864.   You then need to add entries to both your /etc/passwd and your
  3865.   /etc/diphosts files. The entries you need to make are formatted as
  3866.   follows:
  3867.  
  3868.   To configure Linux as a slip server with dip, you need to create some
  3869.   special slip accounts for users, where dip (in input mode) is used as
  3870.   the login shell. A suggested convention is that of having all slip
  3871.   accounts begin with a capital `S', eg `Sfredm'.
  3872.  
  3873.   A sample /etc/passwd entry for a slip user looks like:
  3874.  
  3875.  
  3876.  
  3877.        Sfredm:ij/SMxiTlGVCo:1004:10:Fred:/tmp:/usr/sbin/diplogin
  3878.        ^^         ^^        ^^  ^^   ^^   ^^   ^^
  3879.        |          |         |   |    |    |    \__ diplogin as login shell
  3880.        |          |         |   |    |    \_______ Home directory
  3881.        |          |         |   |    \____________ User Full Name
  3882.        |          |         |   \_________________ User Group ID
  3883.        |          |         \_____________________ User ID
  3884.        |          \_______________________________ Encrypted User Password
  3885.        \__________________________________________ Slip User Login Name
  3886.  
  3887.  
  3888.  
  3889.  
  3890.   After the user logs in, the login(1) program, if it finds and verifies
  3891.   the user ok, will execute the diplogin command. dip, when invoked as
  3892.   diplogin knows that it should automatically assume that it is being
  3893.   used a login shell. When it is started as diplogin the first thing it
  3894.   does is use the getuid() function call to get the userid of whoever
  3895.   has invoked it. It then searches the /etc/diphosts file for the first
  3896.   entry that matches either the userid or the name of the tty device
  3897.   that the call has come in on, and configures itself appropriately.  By
  3898.   judicious decision as to whether to give a user an entry in the
  3899.   diphosts file, or whether to let the user be given the default
  3900.   configuration you can build your server in such a way that you can
  3901.   have a mix of static and dynamically assigned address users.
  3902.  
  3903.   dip will automatically add a `Proxy-ARP' entry if invoked in input
  3904.   mode, so you do not need to worry about manually adding such entries.
  3905.  
  3906.  
  3907.   12.2.2.1.  Configuring /etc/diphosts
  3908.  
  3909.   /etc/diphosts is used by dip to lookup preset configurations for
  3910.   remote hosts. These remote hosts might be users dialing into your
  3911.   linux machine, or they might be for machines that you dial into with
  3912.   your linux machine.
  3913.  
  3914.   The general format for /etc/diphosts is as follows:
  3915.  
  3916.  
  3917.  
  3918.         ..
  3919.        Suwalt::145.71.34.1:145.71.34.2:255.255.255.0:SLIP uwalt:CSLIP,1006
  3920.        ttyS1::145.71.34.3:145.71.34.2:255.255.255.0:Dynamic ttyS1:CSLIP,296
  3921.         ..
  3922.  
  3923.  
  3924.  
  3925.  
  3926.   The fields are:
  3927.  
  3928.   1. login name: as returned by getpwuid(getuid()) or tty name.
  3929.  
  3930.   2. unused: compat. with passwd
  3931.  
  3932.   3. Remote Address: IP address of the calling host, either numeric or
  3933.      by name
  3934.  
  3935.   4. Local Address: IP address of this machine, again numeric or by name
  3936.  
  3937.   5. Netmask: in dotted decimal notation
  3938.  
  3939.   6. Comment field: put whatever you want here.
  3940.  
  3941.   7. protocol: Slip, CSlip etc.
  3942.  
  3943.   8. MTU: decimal number
  3944.  
  3945.   An example /etc/net/diphosts entry for a remote slip user might be:
  3946.  
  3947.  
  3948.  
  3949.        Sfredm::145.71.34.1:145.71.34.2:255.255.255.0:SLIP uwalt:SLIP,296
  3950.  
  3951.  
  3952.  
  3953.  
  3954.   which specifies a slip link with remote address of 145.71.34.1, and
  3955.   MTU of 296, or:
  3956.  
  3957.  
  3958.  
  3959.        Sfredm::145.71.34.1:145.71.34.2:255.255.255.0:SLIP uwalt:CSLIP,1006
  3960.  
  3961.   which specifies a cslip-capable link with remote address 145.71.34.1,
  3962.   and MTU of 1006.
  3963.  
  3964.   Therefore, all users who you wish to be allowed a statically allocated
  3965.   dial-up IP access should have an entry in the /etc/diphosts and if you
  3966.   want users who call a particular port to have their details
  3967.   dynamically allocated you must have an entry for the tty device and do
  3968.   not configure a user based entry. You should remember to configure at
  3969.   least one entry for each tty device that your dialup users use to
  3970.   ensure that a suitable configuration is available for them regardless
  3971.   of which modem they call in on.
  3972.  
  3973.   When a user logs in, they will receive a normal login and password
  3974.   prompt, at which they should enter their slip-login userid and
  3975.   password. If they check out ok, then the user will see no special
  3976.   messages, they should just change into slip mode at their end, and
  3977.   then they should be able to connect ok, and be configured with the
  3978.   parameters from the diphosts file.
  3979.  
  3980.  
  3981.   12.2.3.  slip server using the dslip package.
  3982.  
  3983.   Matt Dillon <dillon@apollo.west.oic.com> has written a package that
  3984.   does not only dial-in but also dial-out slip. Matt's package is a
  3985.   combination of small programs and scripts that manage your connections
  3986.   for you. You will need to have tcsh installed as at least one of the
  3987.   scripts requires it. Matt supplies a binary copy of the expect utility
  3988.   as it too is needed by one of the scripts. You will most likely need
  3989.   some experience with expect to get this package working to your
  3990.   liking, but don't let that put you off.
  3991.  
  3992.   Matt has written a good set of installation instructions in the README
  3993.   file, so I won't bother repeating them.
  3994.  
  3995.   You can get the dslip package from its home site at:
  3996.  
  3997.   apollo.west.oic.com
  3998.  
  3999.  
  4000.        /pub/linux/dillon_src/dslip203.tgz
  4001.  
  4002.  
  4003.  
  4004.  
  4005.   or from:
  4006.  
  4007.   sunsite.unc.edu
  4008.  
  4009.  
  4010.        /pub/Linux/system/Network/serial/dslip203.tgz
  4011.  
  4012.  
  4013.  
  4014.  
  4015.   Read the README file, and create the /etc/passwd and /etc/group
  4016.   entries before doing a make install.
  4017.  
  4018.  
  4019.  
  4020.   12.3.  Using the Automounter Daemon - AMD.
  4021.  
  4022.   This section has been supplied by Mitch DSouza, and I've included it
  4023.   with minimal editing, as he supplied it. Thanks Mitch.
  4024.  
  4025.  
  4026.  
  4027.   12.3.1.  What is an automounter, and why would I use one ?
  4028.  
  4029.   An automounter provides a convenient means of mounting filesystems on
  4030.   demand, i.e. when requried. This will reduce both the server and the
  4031.   client load, and provides a great deal of flexibility even with non-
  4032.   NFS mounts. It also offers a redundancy mechanism whereby a mount
  4033.   point will automatically switch to a secondary server should a primary
  4034.   one be unavailable. A rather useful mount called the union mount gives
  4035.   the automounter the ability to merge the contents of multiple
  4036.   directories into a single directory. The documentation msut be read
  4037.   thoroughly to make full use of its extensive capabilities.
  4038.  
  4039.   A few important points must be remembered - (in no particular order):
  4040.  
  4041.  
  4042.   o  amd maps are not compatible with Sun maps, which in turn are not
  4043.      compatible with HP maps ad infinitum. The point here however is
  4044.      that amd is freely available and compatible with all the systems
  4045.      mentioned above and more, thus giving you the ability to share maps
  4046.      if amd is installed throughout your network. Mitch uses it with a
  4047.      mixture of Linux/Dec/NeXt/Sun machines.
  4048.  
  4049.   o  Sun automount maps can be converted to amd style maps by using the
  4050.      perl script in the contrib directory - automount2amd.pl.
  4051.  
  4052.   o  You must have the portmapper running before starting amd.
  4053.  
  4054.   o  UFS mounts do not timeout.
  4055.  
  4056.   o  UFS mounts, in the case of Linux only, have been extended to deal
  4057.      with all varieties of native filesystems (i.e. minix, ext, ext2,
  4058.      xiafs ...) with the default being minix. This undocumented feature
  4059.      is accessed in the opts option like:
  4060.  
  4061.  
  4062.         ..., opts:=type=msdos,conv=auto
  4063.  
  4064.  
  4065.  
  4066.  
  4067.   o  Do not mount over existing directories unless you use a direct
  4068.      automount option, otherwise it is like mounting your disk on /home
  4069.      when some user directory is /home/fred.
  4070.  
  4071.   o  Always turn on full logging with the `-x all' option to amd if you
  4072.      have any troubles. Check also what the command:
  4073.  
  4074.  
  4075.        % amq -ms
  4076.  
  4077.  
  4078.  
  4079.  
  4080.   reports, as it will indicate problems as they occur.
  4081.  
  4082.   o  GNU getopt() is too clever for its own good sometimes. You should
  4083.      always use `--' before the non-options e.g.
  4084.  
  4085.  
  4086.        # /etc/amd -x all -l syslog -a /amd -- /net /etc/amd.net
  4087.  
  4088.  
  4089.  
  4090.  
  4091.  
  4092.  
  4093.   12.3.2.  Where to get AMD, the automounter daemon.
  4094.  
  4095.   amd can be obtained from:
  4096.  
  4097.   sunsite.unc.edu
  4098.  
  4099.  
  4100.        /pub/Linux/system/Misc/mount/amd920824upl67.tar.gz
  4101.  
  4102.  
  4103.  
  4104.  
  4105.   This contains ready-to-run binaries, full sources and documentation in
  4106.   texinfo format.
  4107.  
  4108.  
  4109.   12.3.3.  An example AMD configuration.
  4110.  
  4111.   You do not configure the automounter from the /etc/fstab file, which
  4112.   you will already be using to contain information about your
  4113.   fileystems, instead it is command line driven.
  4114.  
  4115.   To mount two nfs filesystems using your /etc/fstab file you would use
  4116.   two entries that looked like:
  4117.  
  4118.  
  4119.  
  4120.        server-1:/export/disk  /nfs/server-1  nfs  defaults
  4121.        server-2:/export/disk  /nfs/server-2  nfs  defaults
  4122.  
  4123.  
  4124.  
  4125.  
  4126.   i.e. you were nfs mounting server-1 and server-2 on your linux disk on
  4127.   the /nfs/server-1 and /nfs/server-2 directories.
  4128.  
  4129.   After commenting out, or deleting the above lines from your /etc/fstab
  4130.   file, you could amd to perform the same task with the following
  4131.   syntax:
  4132.  
  4133.  
  4134.  
  4135.        /etc/amd -x all -l syslog -a /amd -- /nfs /etc/amd.server
  4136.        |      | |    | |       | |     |  | |  | |             |
  4137.        |      | |    | |       | |     |  | |  | |             |
  4138.        `------' `----' `-------' `-----' -' `--' `-------------'
  4139.        |        |      |         |      |   |    |
  4140.        (1)      (2)    (3)       (4)    (5) (6)  (7)
  4141.  
  4142.  
  4143.  
  4144.  
  4145.   Where:
  4146.  
  4147.  
  4148.   1. The full amd binary path (obviously optional) depending on your
  4149.      $PATH setting, so just `amd' may be specified here.
  4150.  
  4151.   2. `-x all' means turn full logging on. Read the documentation for the
  4152.      other logging levels
  4153.  
  4154.   3. `-l syslog' means log the message via the syslog daemon. This could
  4155.      mean put it to a file, dump it, or pass it, to an unused tty
  4156.      console. This (syslog) can be changed to the name of a file, i.e.
  4157.      `-l foo' will record to a file called foo.
  4158.  
  4159.   4. `-a /amd' means use the /amd directory as a temporary place for
  4160.      automount points. This directory is created automatically by amd
  4161.      and should be removed before starting amd in your /etc/rc scripts.
  4162.  
  4163.   5. `--' means tell getopt() to stop attempting to parse the rest of
  4164.      the command line for options. This is especially useful when
  4165.      specifying the `type:=' options on the command line, otherwise
  4166.      getopt() tries to decode it incorrectly.
  4167.  
  4168.   6. `/nfs' is the real nfs mount point. Again this is automatically
  4169.      created and should not generally contain subdirectories unless the
  4170.      `type:=direct' option is used.
  4171.  
  4172.   7. The amd map (i.e. a file) named `amd.server' contains the lines:
  4173.  
  4174.  
  4175.  
  4176.        # /etc/amd.server
  4177.        /defaults    opts:=rw;type:=nfs
  4178.        server-1     rhost:=server-1;rfs:=/export/disk
  4179.        server-2     rhost:=server-2;rfs:=/export/disk
  4180.  
  4181.  
  4182.  
  4183.  
  4184.  
  4185.   Once started and successfully running, you can query the status of the
  4186.   mounts with the command:
  4187.  
  4188.  
  4189.  
  4190.        % amq -ms
  4191.  
  4192.  
  4193.  
  4194.  
  4195.   Now if you say:
  4196.  
  4197.  
  4198.  
  4199.        % ls /nfs
  4200.  
  4201.  
  4202.  
  4203.  
  4204.   you should see no files. However the command:
  4205.  
  4206.  
  4207.  
  4208.        % ls /nfs/server-1
  4209.  
  4210.  
  4211.  
  4212.  
  4213.   will mount the host `server-1' automatically. voila! amd is running.
  4214.   After the default timeout has expired, this will automatically be
  4215.   unmounted. Your /etc/password file could contain entries like:
  4216.  
  4217.  
  4218.  
  4219.         ...
  4220.        linus:EncPass:10:0:God:/nfs/server-1/home/linus:/bin/sh
  4221.        mitch:EncPass:20:10:Mitch DSouza:/nfs/server-1/home/mitch:/bin/tcsh
  4222.        matt:EncPass:20:10:Matt Welsh:/nfs/server-1/home/matt:/bin/csh
  4223.  
  4224.  
  4225.   which would mean that when Linus, Matt, or Mitch are logged in, their
  4226.   home directory will be remotely mounted from the appropriate server,
  4227.   and umounted when they log out.
  4228.  
  4229.  
  4230.   12.4.  Using Linux as a router
  4231.  
  4232.   Linux will function just fine as a router. You should run a routing
  4233.   daemon such as gated, or if you have simple routing requirements use
  4234.   hard coded routes. If you are using a late version kernel (1.1.*) then
  4235.   you should ensure that you have answered `y' to:
  4236.  
  4237.  
  4238.  
  4239.        IP forwarding/gatewaying (CONFIG_IP_FORWARD) [y] y
  4240.  
  4241.  
  4242.  
  4243.  
  4244.   when building your kernel.
  4245.  
  4246.   Olaf Kirch's Network Administrators Guide discusses network design and
  4247.   routing issues, and you should read it for more information. A
  4248.   reference to it is in the "Related Documentation" section of this
  4249.   document.
  4250.  
  4251.  
  4252.   12.5.  NIS - Sun Network Information System.
  4253.  
  4254.   There is now an NIS-HOWTO <http://sunsite.unc.edu/mdw/HOWTO/NIS-
  4255.   HOWTO.html> which you should read if you are interested in using NIS.
  4256.   It details how to obtain, install and configure the NIS system for
  4257.   Linux.
  4258.  
  4259.  
  4260.  
  4261.   13.  Experimental and Developmental modules.
  4262.  
  4263.   There are a number of people developing new features and modules for
  4264.   the Linux networking code. Some of these are in quite an advanced
  4265.   state (read working), and it is these that I intend to include in this
  4266.   section until they are standard release code, when they will be moved
  4267.   forward.
  4268.  
  4269.   The AX25 section has been relocated into the HAM-HOWTO
  4270.   <http://sunsite.unc.edu/mdw/HOWTO/HAM-HOWTO.html> because it was
  4271.   fairly specific to Amateur Radio.
  4272.  
  4273.  
  4274.   13.1.  snmp agent.
  4275.  
  4276.   There is an experimental snmp agent for linux, ported from the cmu-
  4277.   snmp source by Erik Schoenfelder, <schoenfr@ibr.cs.tu-bs.de>.
  4278.  
  4279.   It is available from:
  4280.  
  4281.   ftp.ibr.cs.tu-bs.de
  4282.  
  4283.  
  4284.        /pub/local/cmu-snmp2.1.2l3-src.tar.gz
  4285.  
  4286.  
  4287.  
  4288.  
  4289.   Please read the file called cmu-snmp2.1.2l3.README, as it contains
  4290.   information that you will need to know about the package.
  4291.   This package provides a nearly complete MIB-II variable set. and parts
  4292.   of the host MIB. Setting of system group variables is provided. The
  4293.   private community string is setable in the config file.
  4294.  
  4295.   nstat.tar.gz contains a formatter of the output from /proc/net/snmp
  4296.   called nstat.
  4297.  
  4298.   You will need Linux v1.1.60 and libc v4.6.27 or higher to compile and
  4299.   run the agent.
  4300.  
  4301.  
  4302.   13.2.  Experimental Token Ring driver
  4303.  
  4304.   An experimental Token Ring driver is being developed by Peter De
  4305.   Schrijver <stud11@cc4.kuleuven.ac.be>. His latest version, at the time
  4306.   of writing is available in the Linux 1.3.* kernel release kernels.
  4307.   For older kernel versions the driver patches are located at:
  4308.  
  4309.   linux3.cc.kuleuven.ac.be
  4310.  
  4311.  
  4312.        /pub/Linux/TokenRing/TokenRing.patch-1.2.0.gz
  4313.  
  4314.  
  4315.  
  4316.  
  4317.   ftp.cs.kuleuven.ac.be
  4318.  
  4319.  
  4320.        /pub/unix/linux/TokenRing.patch-1.1.64.gz
  4321.  
  4322.  
  4323.  
  4324.  
  4325.   There are a number of patch files against various kernel versions.
  4326.   Just pick the one that suits your kernel.
  4327.  
  4328.   Note also that there are versions of the network tools to suit Token
  4329.   Ring in the same directory at linux3.cc.kuleven.ac.be.
  4330.  
  4331.   Most boards based on IBM's TROPIC chipset should work now. The
  4332.   following boards are known to be working with the driver :
  4333.  
  4334.  
  4335.   o  IBM Token Ring Adapter II
  4336.  
  4337.   o  IBM Token Ring 16/4 Adapter
  4338.  
  4339.   o  IBM Token Ring Adapter/A
  4340.  
  4341.   o  IBM Token Ring 16/4 Adapter/A
  4342.  
  4343.   o  HyperRing Classic 16/4
  4344.  
  4345.   Boards which use the TI chipset or busmastering DMA won't work with
  4346.   the current driver. However someone is working on a driver for the IBM
  4347.   busmaster adapters.
  4348.  
  4349.  
  4350.   13.3.  V.35 interface board
  4351.  
  4352.   V.35 is a C.C.I.T.T. standard interface that provides a high speed
  4353.   balanced serial interface suitable for speeds up to about 2 Mbps. The
  4354.   use of differential pair balanced transmission allows the V.35
  4355.   interface to support longer cables than can the more familiar
  4356.   V.24/RS232C type interface and higher data rates.
  4357.   13.3.1.  Internet Technologies International XNET-1
  4358.  
  4359.   Matti Aarnio <mea@mea.utu.fi> represents Internet Technologies
  4360.   International <mailto:intec@digiw.fi>.  They have an 8 bit X.21 card
  4361.   available called the XNET-1 which will work for V.35 with an
  4362.   appropriate cable. You can obtain information on the card itself from:
  4363.  
  4364.  
  4365.   Internet Technologies International OY,
  4366.   Helsinki, Finland  <intec@digiw.fi>
  4367.   Internet Technologies International OY (Ltd)
  4368.   PO BOX 51
  4369.   00641 Helsinki
  4370.   FINLAND
  4371.   Fax: +356-0-7523939
  4372.  
  4373.  
  4374.  
  4375.   The driver for the card is available from ftp.funet.fi
  4376.   <ftp://ftp.funet.fi/pub/Linux/kernel/xnet-sync-driver.tar.gz>
  4377.  
  4378.  
  4379.   13.3.2.  SDL Communications N2 card.
  4380.  
  4381.   SDL Communications <http://www.ici.net/cust_pages/sdl/sdl.html>
  4382.   produce a variety of controller cards supporting V.35 for ISA based
  4383.   machines.
  4384.  
  4385.   The beta release driver can be found at:
  4386.  
  4387.   ftp.sdlcomm.com
  4388.  
  4389.  
  4390.        /business/sdlcomm/n2/linux
  4391.  
  4392.  
  4393.  
  4394.  
  4395.   For further information you can contact Rubin Dhillon at SDL Sales
  4396.   <mailto:sales@sdlcomm.com>
  4397.  
  4398.  
  4399.  
  4400.   13.4.  IPX bridge program
  4401.  
  4402.   Vinod G Kulkarni <vinod@cse.iitb.ernet.in> has cowritten some software
  4403.   for linux that will allow it to act as an IPX bridge.
  4404.  
  4405.   The software is available from:
  4406.  
  4407.   sunsite.unc.edu
  4408.  
  4409.  
  4410.        /pub/Linux/Systems/Network/router/ipxbridge.tar.gz
  4411.  
  4412.  
  4413.  
  4414.  
  4415.  
  4416.   13.5.  IPX RIP and SAP support.
  4417.  
  4418.   Alex Liu <labrat@unitrx.com has written support for the Novell RIP and
  4419.   SAP protocols to allow your linux machine to act as a Novell router.
  4420.  
  4421.   This software is alpha and includes a kernel patch. Be warned that you
  4422.   should take the usual precautions when testing this software.
  4423.   You can obtain the software from:
  4424.  
  4425.   sunsite.unc.edu
  4426.  
  4427.  
  4428.        /pub/Linux/Incoming/ipxripd-002.tar.gz (until it is moved)
  4429.        /pub/Linux//system/Network/router/ipxripd-002.tar.gz
  4430.  
  4431.  
  4432.  
  4433.  
  4434.   A README file is included, and you should read this for installation
  4435.   and configuration details.
  4436.  
  4437.  
  4438.   13.6.  Demand Dial SLIP/PPP package
  4439.  
  4440.   Eric Schenk <schenk@cs.toronto.edu> has written a demand dial daemon
  4441.   that will work with either SLIP or PPP. It relies on you having a slip
  4442.   device configured which the daemon connects to via a pty. When your
  4443.   slip connection is not active all datagrams for non local hosts will
  4444.   be routed to this device, and the daemon will detect them, when it
  4445.   receives a datagram it executes a script to activate your network
  4446.   link, and then reroutes datagrams to that link.
  4447.  
  4448.   The software is available at:
  4449.  
  4450.   sunsite.unc.edu
  4451.  
  4452.  
  4453.        /pub/Linux/system/Network/serial/diald-0.7.tar.gz
  4454.  
  4455.  
  4456.  
  4457.  
  4458.   Note: You must configure your kernel so that it includes the slip
  4459.   driver, even if you only want to run PPP.
  4460.  
  4461.   The included documentation describes how to install and configure the
  4462.   software.
  4463.  
  4464.  
  4465.   13.7.  ISDN support
  4466.  
  4467.   There are various ISDN support efforts underway. The ones that I know
  4468.   of are:
  4469.  
  4470.  
  4471.   13.7.1.  3Com-Sonix PC/Arpeggio driver
  4472.  
  4473.   Alan Cox has started a driver for the 3Com arpeggio ISDN card. It is
  4474.   currently capable of supporting Async PPP only.
  4475.  
  4476.   sunsite.unc.edu
  4477.  
  4478.  
  4479.        /pub/Linux/kernel/patches/network/sonix.tgz
  4480.  
  4481.  
  4482.  
  4483.  
  4484.  
  4485.   13.7.2.  DIEHL SCOM card
  4486.  
  4487.   sunsite.unc.edu
  4488.  
  4489.   /pub/Linux/kernel/patches/network/isdndrv-0.1.1.tar.gz
  4490.  
  4491.  
  4492.  
  4493.  
  4494.  
  4495.   13.7.3.  ICN ISDN and/or Teles ISDN card and/or Creatix AVM ISDN board
  4496.  
  4497.   Fritz Elfert, Jan den Ouden and Thinking Objects have written a linux
  4498.   driver for the ICN ISDN card. Some of the documentation for this
  4499.   driver is in German.  There seem to be various versions of this driver
  4500.   around that apparently support other ISDN cards, if you obtain one and
  4501.   it doesn't support your card take a look at another of the sites. You
  4502.   can obtain them from:
  4503.  
  4504.   ftp.franken.de
  4505.  
  4506.  
  4507.        /pub/isdn4linux/
  4508.  
  4509.  
  4510.  
  4511.  
  4512.   or: ftp.gwdg.de
  4513.  
  4514.  
  4515.        /pub/linux/misc/isdn4linux/
  4516.  
  4517.  
  4518.  
  4519.  
  4520.  
  4521.   13.7.4.  Euro-ISDN card ?
  4522.  
  4523.   Matthias Urlichs <urlichs@smurf.noris.de> has developed some
  4524.   experimental Streams based ISDN support for Linux. The most recent
  4525.   version was for kernel version 1.3.* and is reported to work.
  4526.  
  4527.   It is available at:
  4528.  
  4529.   ftp.uni-stuttgart.de
  4530.  
  4531.  
  4532.        /pub/systems/linux/isdn/ftp.noris.de/
  4533.  
  4534.  
  4535.  
  4536.  
  4537.   Be warned, the documentation is in German, and the code is designed to
  4538.   support the european ISDN network. Matthias is working on a english
  4539.   version of the documentation.
  4540.  
  4541.  
  4542.   13.7.5.  Combinet's Everyware 1000 ISDN card
  4543.  
  4544.   Joel Katz <stimpson@panix.com> has developed a driver for Combinet's
  4545.   Everyware 1000 series of plug-in ISDN cards.
  4546.  
  4547.   It is available from: sunsite.unc.edu
  4548.  
  4549.  
  4550.        /pub/Linux/kernel/patches/network/combinet1000isdn-1.02.tar.gz
  4551.  
  4552.  
  4553.  
  4554.  
  4555.   13.7.6.  More information:
  4556.  
  4557.   Harald Milz has put together a World Wide Web page for Linux ISDN
  4558.   support and it is available at Linux ISDN Web Page
  4559.   <http://www.ix.de/ix/linux/linux-isdn.html>.  A more generic site
  4560.   containing information about ISDN is available at Dan Kegel's ISDN
  4561.   home page <http://alumni.caltech.edu/~dank/isdn/>.
  4562.  
  4563.  
  4564.   13.8.  System-V Streams
  4565.  
  4566.   The LiS (Linux Streams) project has formed to develop and implement
  4567.   System-V Streams for Linux. They have a World Wide Web page at Linux
  4568.   Streams Web Page <http://www.uc3m.es/~LiS/> where the status of the
  4569.   project can be obtained and where you can locate contact information
  4570.   and test code.
  4571.  
  4572.  
  4573.   13.9.  ATM (Asynchronous Transfer Mode) support.
  4574.  
  4575.   Werner Almesberger has put together a World Wide site on the topic of
  4576.   Linux support for ATM. It is available at lrcwww.epfl.ch
  4577.   <http://lrcwww.epfl.ch/linux-atm/>.  There is experimental software
  4578.   which supports raw ATM connections and some basic IP over ATM
  4579.   available at the pre-alpha stage and this can be obtained from the Web
  4580.   Site. The site contains a good deal of interesting information on ATM.
  4581.  
  4582.   A mail list has been establised to discuss ATM for Linux and you can
  4583.   subscribe by sending a mail message with the body subscribe linux-atm
  4584.   to: majordomo@vger.rutgers.edu
  4585.  
  4586.  
  4587.   13.10.  Appletalk support.
  4588.  
  4589.   If you have some Apple machines on your network that you'd like your
  4590.   linux machine to be able to share filesystems and printers with then
  4591.   the linux appletalk support is what you are after.
  4592.  
  4593.   The following information was supplied mostly by Cees de Groot
  4594.   <cg@tricbbs.fn.sub.org who compiled it from his own experience with
  4595.   assistance from Dana Basken <dana@millenium.tiac.net> and others on
  4596.   the net.
  4597.  
  4598.  
  4599.   13.10.1.  Building the kernel with Appletalk DDP support
  4600.  
  4601.   Alan Cox has developed some experimental and working support for the
  4602.   Apple Ethertalk specification. It is now a part of the later 1.2.*
  4603.   revision kernels and the new linux 1.3.* revision kernels so to build
  4604.   the kernel support for it you need only compile up a recent kernel,
  4605.   make sure you select the following configuration option:
  4606.  
  4607.  
  4608.  
  4609.        #
  4610.        # cd /usr/src/linux
  4611.        # make config
  4612.         ...
  4613.         ...
  4614.            Appletalk DDP ? y
  4615.         ...
  4616.         ...
  4617.        #
  4618.  
  4619.  
  4620.  
  4621.   13.10.2.  Building the Appletalk configuration tools and daemons.
  4622.  
  4623.   You will need some additional software as the kernel support only
  4624.   provides enough to do basic networking, none of the higher layer
  4625.   protocols are implented in the kernel.
  4626.  
  4627.   Wesley Craig <netatalk@umich.edu represents a team called the Research
  4628.   Systems Unix Group at the University of Michigan, and they have
  4629.   produced a package called netatalk which provides software that
  4630.   implements the Appletalk protocol stack and some useful utilities.
  4631.  
  4632.   You can obtain it from:
  4633.  
  4634.   University of Michigan
  4635.   <ftp://terminator.rs.itd.umich.edu/unix/netatalk/>
  4636.  
  4637.   you will need at least version 1.3.3b2 as earlier versions did not
  4638.   support Linux.
  4639.  
  4640.   To build and install that package something like:
  4641.  
  4642.  
  4643.  
  4644.        # cd /usr/src
  4645.        # tar xvfz .../netatalk
  4646.        - You may want to edit the `Makefile' at this point, specifically to change
  4647.          the DESTDIR variable which defines where the files will be installed later.
  4648.          Teh default of /usr/local/atalk is fairly safe.
  4649.        - You should then just have to make the software. My `uname' program wasn't
  4650.          in the /bin directory so I edited the Makefile to reflect this change too.
  4651.        # make
  4652.        - as root:
  4653.        # make install
  4654.  
  4655.  
  4656.  
  4657.  
  4658.   You should then end up with a whole range of new commands to play
  4659.   with.
  4660.  
  4661.  
  4662.   13.10.3.  Configuring the Appletalk software.
  4663.  
  4664.   The first thing you need to do to make it all work is add the contents
  4665.   of the services.atalk file to your /etc/services file, just append it
  4666.   to the end of the file.
  4667.  
  4668.   The next step is to create the appletalk configuration files in the
  4669.   /usr/local/atalk/etc directory (or whereever you installed the
  4670.   package).
  4671.  
  4672.   The first file to create is the /usr/local/atalk/etc/Atalkd.conf file.
  4673.   To start this file needs only one line that gives the name of the
  4674.   network device that support the network that your Apple machines are
  4675.   on:
  4676.  
  4677.  
  4678.  
  4679.        eth0
  4680.  
  4681.  
  4682.  
  4683.  
  4684.   The Appletalk daemon program will add extra details after it is run.
  4685.  
  4686.  
  4687.   13.10.4.  Exporting a Linux filesystems via Appletalk.
  4688.  
  4689.   You can export filesystems from your linux machine to the network so
  4690.   that Apple machine on the network can share them.
  4691.  
  4692.   To do this you must configure the
  4693.   /usr/local/atalk/etc/AppleVolumes.system file.
  4694.  
  4695.   Full details on how to do this and what the various options are can be
  4696.   found in the afpd man page.
  4697.  
  4698.   A sample would look like:
  4699.  
  4700.  
  4701.  
  4702.        /tmp Scratch
  4703.        /home/ftp/pub Public
  4704.  
  4705.  
  4706.  
  4707.  
  4708.   Which would export your /tmp filesystem as AppleShare Volume
  4709.   `Scratch', and your ftp public directory as AppleShare Volume
  4710.   `Public'.  The volume names are not mandatory, the daemon will choose
  4711.   some for you, but it won't hurt to specify them anyway.
  4712.  
  4713.  
  4714.   13.10.5.  Sharing your Linux printer across Appletalk.
  4715.  
  4716.   You can share your linux printer with your Apple machines quite
  4717.   simply.  You need to run the papd program which is the Appletalk
  4718.   Printer Access Protocol Daemon. When you run this program it will
  4719.   accept requests from your Apple machines and spool the print job to
  4720.   your local line printer daemon for printing.
  4721.  
  4722.   You need to edit the /usr/local/atalk/etc/papd.conf file to configure
  4723.   the daemon. The syntax of this file is the same as that of your usual
  4724.   /etc/printcap file. The name you give to the definition is registered
  4725.   with the Appletalk naming protocol, NBP.
  4726.  
  4727.   A sample configuration might look like:
  4728.  
  4729.  
  4730.  
  4731.        TricWriter:\
  4732.           :pr=lp:op=cg:
  4733.  
  4734.  
  4735.  
  4736.  
  4737.   Which would make a printer named `TricWriter' available to your
  4738.   Appletalk network, and all accepted jobs would be printed to the linux
  4739.   `lp' printer using lpd.
  4740.  
  4741.  
  4742.   13.10.6.  Starting the appletalk software.
  4743.  
  4744.   Ok, you should now be ready to test this basic configuration. There is
  4745.   an rc file supplied with the netatalk package that should work ok for
  4746.   you, so all you should have to do is:
  4747.  
  4748.  
  4749.  
  4750.        # /usr/local/atalk/etc/rc.atalk
  4751.  
  4752.  
  4753.   and all should startup and run ok. You should see no error messages
  4754.   and the software will send messages to the console indicating each
  4755.   stage as it starts.
  4756.  
  4757.  
  4758.   13.10.7.  Testing the appletalk software.
  4759.  
  4760.   To test that the software is functioning properly, go to one of your
  4761.   Apple machines, pull down the Apple menu, select the Chooser, click on
  4762.   AppleShare, and your Linux box should appear.
  4763.  
  4764.  
  4765.   13.10.8.  Caveats of the appletalk software.
  4766.  
  4767.  
  4768.   o  You may need to start the Appletalk support before you configure
  4769.      your IP network. If you have problems starting the Appletalk
  4770.      programs, or if after you start them you have trouble with your IP
  4771.      network, then try starting the Appletalk software before you run
  4772.      your /etc/rc.d/rc.inet1 file.
  4773.  
  4774.   o  The afpd (Apple Filing Protocol Daemon) severely messes up your
  4775.      hard disk. Below the mount points it creates a couple of
  4776.      directories: directory you access it will create a .AppleDouble
  4777.      below it so it can store resource forks, etc. So think twice before
  4778.      exporting /, you will have a great time cleaning up afterwards.
  4779.  
  4780.   o  The afpd program expects clear text passwords from the Macs.
  4781.      Security could be a problem, so be very careful when you run this
  4782.      daemon on a machine connected to the Internet, you have yourself to
  4783.      blame if somebody nasty does something bad.
  4784.  
  4785.   o  The existing diagnostic tools such as netstat and ifconfig don't
  4786.      support Appletalk. The raw information is available in the
  4787.      /proc/net/ directory if you need it.
  4788.  
  4789.  
  4790.   13.11.  IP_MASQUERADE - allow a number of hosts to pretend to be one.
  4791.  
  4792.   If you are one of the many people who have some sort of local network
  4793.   at home, whether it be a couple of machine connected via a
  4794.   slip/plip/ppp link to each other, or a number of machines connected to
  4795.   a private ethernet network who also has a dial-up Internet connection
  4796.   then you have probably at one time or another wanted the machines not
  4797.   directly connected to be able to communicate with the Internet. This
  4798.   is normally achieved by getting a valid register IP network address
  4799.   for your local network and asking your Internet Service Provider to
  4800.   kindly provide a network route to your network connection instead of
  4801.   the single host route they were previously providing. Unfortunately
  4802.   many Internet Service Providers will ask you to provide a good deal
  4803.   more dollars for the priveledge of better utilising the bandwidth of
  4804.   your connection and you probably don't much like that idea.
  4805.  
  4806.   IP_MASQUERADING provides a clever solution to this problem by making
  4807.   all of the machines on your network look like one very active
  4808.   networked machine.  It does this by performing real-time, on the fly
  4809.   address translations. Most of the code was authored by Pauline
  4810.   Middelink <middelin@polyware.iaf.nl>.
  4811.  
  4812.   Ken Eaves <keves@eves.com provided most the information contained
  4813.   below and also provides the facilities to run the `masq' mailing list,
  4814.   so if you find the following helpful, thank Ken.
  4815.  
  4816.  
  4817.  
  4818.  
  4819.   13.11.1.  Obtaining the `masq' software.
  4820.  
  4821.   The IP_Masquerade software currently comes as a patch to the later
  4822.   linux 1.2.* series kernels and a new version of the ipfw command.  The
  4823.   ipfw program that comes with the net-tools software releases to
  4824.   configure it does not yet have the `masquerade' option built into it.
  4825.   The kernel you are using must support the ip_firewalling option for
  4826.   ip_masquerade to work.
  4827.  
  4828.   The patch file is available from:
  4829.  
  4830.   ftp.eves.com
  4831.  
  4832.  
  4833.        /pub/masq
  4834.  
  4835.  
  4836.  
  4837.  
  4838.   In this directory you will find patch files, new versions of the ipfw
  4839.   command and Ken's original Masquerade FAQ on which this text is based.
  4840.  
  4841.   The patch file is called masq-patch.1.2.n, so you must retrieve it.
  4842.   The files ipfw and ipfw-for-1.3.10 are for kernel version 1.2.* and
  4843.   1.3.10 respectively.
  4844.  
  4845.  
  4846.   13.11.2.  How do I install and compile the patch ?
  4847.  
  4848.   Assuming you have the source to a recent 1.2.* version kernel
  4849.   installed in the /usr/src/linux directory you would do the following:
  4850.  
  4851.  
  4852.  
  4853.        #
  4854.        # cd /usr/src
  4855.        # patch -p0 <.../masq-patch.1.2.n 2>patch.errs
  4856.        - check the patch.errs file for the string `fail'. If you can't find
  4857.          it then the patch applied successfully. If you can find it then something
  4858.          may have gone wrong double check that you have the correct version of
  4859.          kernel source.
  4860.        # cd /usr/src/linux
  4861.        # make config
  4862.        - You must answer `y' to:
  4863.          ...
  4864.          IP: forwarding/gatewaying (CONFIG_IP_FORWARD) [y]
  4865.          IP: firewalling (CONFIG_IP_FIREWALL) [y]
  4866.          IP: masquerading (ALPHA) [y]
  4867.          ...
  4868.        - The rest of the options you should answer as you normally would.
  4869.        # make dep
  4870.        # make clean
  4871.        - Build as you normally would, normally this would be:
  4872.        # make zlilo
  4873.        #
  4874.  
  4875.  
  4876.  
  4877.  
  4878.   After making sure that you are actually running your newly built
  4879.   kernel you need only ensure that you have a working copy of the ipfw
  4880.   program.  ipfw is normally installed in the /sbin so after testing the
  4881.   masquerade version you can simply copy it to /sbin/ipfw.  This is all
  4882.   that is necessary to get the kernel support installed.
  4883.  
  4884.  
  4885.   13.11.3.  How do I configure the IP_MASQUERADE software ?
  4886.  
  4887.   How you configure the IP_MASQUERADE function depends completely on how
  4888.   your network is built. The general idea is as follows: all of your
  4889.   local machine that you want to have access to the Internet must have
  4890.   their network default route pointing to your linux machine supporting
  4891.   IP_MASQUERADE.  Secondly, you must have an entry in the linux firewall
  4892.   table that says that your local machines should be masqueraded.
  4893.  
  4894.   To configure the IP-MASQUERADE function you use the ipfw command.  The
  4895.   ipfw command is normally used to configure the Linux firewall facility
  4896.   and because your masquerading host is acting as a firewall of sorts
  4897.   ipfw has been modified to take on this additional function.
  4898.  
  4899.   I'll present two example configurations that will probably cover most
  4900.   situations, if you have anything more complicated than these designs
  4901.   then you probably have the experience to work it out for yourself.
  4902.  
  4903.   Two machines connected to each other by slip or ppp:
  4904.  
  4905.  
  4906.  
  4907.         .-------.             .-------.
  4908.         |       |    slip     | linux |   slip/ppp
  4909.         | local |-----//------| masq  |-----//-------> To ISP
  4910.         |       |             | svr   |
  4911.         ._______.             ._______.
  4912.  
  4913.                 ^            ^         ^
  4914.                 |            |         |
  4915.            192.168.0.2   192.168.0.1  dynamically assigned
  4916.  
  4917.  
  4918.  
  4919.  
  4920.  
  4921.   Your /etc/rc.d/rc.inet1 file would have something like the following
  4922.   appended:
  4923.  
  4924.  
  4925.  
  4926.         ...
  4927.         ...
  4928.        # Allow machine 192.168.0.2 to be masqueraded to everybody
  4929.        ipfw a m all from 192.168.0.2/32 to 0.0.0.0/0
  4930.         ...
  4931.         ...
  4932.  
  4933.  
  4934.  
  4935.  
  4936.   Note the iii.iii.iii.iii/nn syntax. You might wonder what the /nn
  4937.   means and how you calculate it. This syntax is a means of encoding
  4938.   both an ip address and a netmask. What this syntax says is all
  4939.   addresses in which the first nn bits match those of iii.iii.iii.iii.
  4940.   The above example is for a single host, so all bits must match, since
  4941.   there are 32 bits in an IP address the syntax is /32.
  4942.  
  4943.   A private ethernet network of machines sharing a single internet link:
  4944.  
  4945.  
  4946.  
  4947.  
  4948.  
  4949.  
  4950.  
  4951.    .-------.    _
  4952.    |       | .2 |
  4953.    | local |----|
  4954.    |       |    | <-- Ethernet lan
  4955.    ._______.    |     192.168.0.0 netmask 255.255.255.0
  4956.                 |
  4957.                 |
  4958.    .-------.    |        .-------.
  4959.    |       | .3 |     .1 | linux |   slip/ppp
  4960.    | local |----|--------| masq  |-----//-------> To ISP
  4961.    |       |    |        | svr   |
  4962.    ._______.    -        ._______.
  4963.  
  4964.                                   ^
  4965.                                   |
  4966.                                  dynamically assigned
  4967.  
  4968.  
  4969.  
  4970.  
  4971.   For this configuration you have a single entry that describes the
  4972.   whole network, so you would use something like:
  4973.  
  4974.  
  4975.  
  4976.         ...
  4977.         ...
  4978.        # Allow all machines on network 192.168.0.0 to be masqueraded to everybody
  4979.        ipfw a m all from 192.168.0.2/24 to 0.0.0.0/0
  4980.         ...
  4981.         ...
  4982.  
  4983.  
  4984.  
  4985.  
  4986.   Again note the relationship between the netmask (255.255.255.0) and
  4987.   the ipfw syntax. A class C network (255.255.255.0) has 24 bits in its
  4988.   netmask.
  4989.  
  4990.   To make the job a little easier for you, here is a table of common
  4991.   network masks against matching bits:
  4992.  
  4993.  
  4994.  
  4995.        netmask             ipfw
  4996.        ---------------     ----
  4997.        255.0.0.0           /8
  4998.        255.255.0.0.0       /16
  4999.        255.255.255.0       /24
  5000.        255.255.255.128     /25
  5001.        255.255.255.192     /26
  5002.        255.255.255.224     /27
  5003.        255.255.255.240     /28
  5004.        255.255.255.248     /29
  5005.        255.255.255.255     /32
  5006.  
  5007.  
  5008.  
  5009.  
  5010.  
  5011.   13.11.4.  Where is IP_MASQUERADE being discussed ?
  5012.  
  5013.   There is a support mailing list at masq@eves.com.  To sign up email to
  5014.   keves@eves.com and ask Ken to add you to the `masq' list. You can ask
  5015.   questions here or submit bug reports. When submitting bug reports
  5016.   please remember to include relevant details.
  5017.   13.12.  IPALIAS - multiple address per interface.
  5018.  
  5019.   If you are running a world wide web server and want to support
  5020.   multiple virtual servers, or your network support multiple subnets on
  5021.   the same piece of wire then you'll need to be able to have your
  5022.   machine respond to more than one address per interface.
  5023.  
  5024.   A facility called ipalias allows you to configure more than one
  5025.   address per interface.
  5026.  
  5027.   Robert Sanders <rsanders@mindspring.com> has written linux support for
  5028.   this feature. It comes as a set of patches against linux kernel
  5029.   version 1.2.1.
  5030.  
  5031.   You can obtain it from:
  5032.  
  5033.   ftp.procyon.com
  5034.  
  5035.  
  5036.        /pub/linux/ipalias
  5037.  
  5038.  
  5039.  
  5040.  
  5041.   To install it you need the 1.2.1 kernel source installed and then:
  5042.  
  5043.  
  5044.  
  5045.        # cd /usr/src/linux
  5046.        # patch -p1 .../alias-patch-1.2.1-v1
  5047.        # make config
  5048.        # make dep; make clean; make zlilo
  5049.  
  5050.  
  5051.  
  5052.  
  5053.   You will also need to get the alias-net-tools.tar.gz file as it
  5054.   contains new versions of the ifconfig and netstat commands.
  5055.  
  5056.  
  5057.   13.12.1.  Configuring ip aliases.
  5058.  
  5059.   To configure an ip alias use the new ifconfig command as follows:
  5060.  
  5061.  
  5062.  
  5063.        # ifconfig eth0 alias 198.71.200.5
  5064.  
  5065.  
  5066.  
  5067.  
  5068.   This presumes that you already have the device configured to operate
  5069.   on your network and that you want 198.71.200.5 configured as a second
  5070.   address.
  5071.  
  5072.  
  5073.   14.  Diagnostic tools - How do I find out what is wrong?
  5074.  
  5075.   In this section I'll briefly describe some of the commonly used
  5076.   diagnostic tools that are available for your Linux network, and how
  5077.   you might use them to identify the cause of your network problems, or
  5078.   to teach yourself a bit more about how tcp/ip networking works. I'll
  5079.   gloss over some of the detail of how the tools work because this
  5080.   document is not an appropriate forum for describing that sort of
  5081.   detail, but I hope I'll have presented enough information that you'll
  5082.   have an understanding of how to use the tool, and to better understand
  5083.   the relevant man page or other documentation.
  5084.  
  5085.  
  5086.   14.1.  ping - are you there?
  5087.  
  5088.   The ping tool is located in the NetKit-B distribution as detailed
  5089.   above in the `Network Applications' section. ping, as the name
  5090.   implies, allows you to transmit a datagram at another host that it
  5091.   will reflect back at you if it is alive and working ok and the network
  5092.   in between is also ok. In its simplest form you would simply say:
  5093.  
  5094.  
  5095.  
  5096.        # ping gw
  5097.        PING gw.vk2ktj.ampr.org (44.136.8.97): 56 data bytes
  5098.        64 bytes from 44.136.8.97: icmp_seq=0 ttl=254 time=35.9 ms
  5099.        64 bytes from 44.136.8.97: icmp_seq=1 ttl=254 time=22.1 ms
  5100.        64 bytes from 44.136.8.97: icmp_seq=2 ttl=254 time=26.0 ms
  5101.        ^C
  5102.  
  5103.        --- gw.vk2ktj.ampr.org ping statistics ---
  5104.        3 packets transmitted, 3 packets received, 0% packet loss
  5105.        round-trip min/avg/max = 22.1/28.0/35.9 ms
  5106.        #
  5107.  
  5108.  
  5109.  
  5110.  
  5111.   What ping has done is resolved the hostname to an address, and using
  5112.   the icmp protocol has transmitted an icmp echo request datagram to the
  5113.   remote host periodically. For each echo request that the remote host
  5114.   receives it will formulate an icmp echo reply datagram which it will
  5115.   transmit back to you. Each line beginning with `64 bytes from ...'
  5116.   represents an echo reply received in response to an echo request. Each
  5117.   line tells you the address of the host that sent you the reply, the
  5118.   sequence number to which the reply was for, the time to live field and
  5119.   the total round trip time that was taken. The round trip time is the
  5120.   time between when the echo request datagram is transmitted, and the
  5121.   corresponding echo reply is received. This can be used as a measure of
  5122.   how fast or slow the network connection between the two machines is.
  5123.  
  5124.   The last two lines tell you how many datagrams were transmitted, how
  5125.   many valid responses were received and what percentage of the
  5126.   datagrams were lost. The percentage lost figure is a measure of how
  5127.   good or error free the network connection is. High percentage lost
  5128.   figures indicate such problems as a high error rate on a link
  5129.   somewhere between the hosts, exhausted capacity on a router or link
  5130.   somewhere, or high collision rate on an ethernet lan. You can use ping
  5131.   to identify where this problem might be by running ping sessions to
  5132.   each of the routed points that make up the network path. When you find
  5133.   that you can ping somewhere without any datagram loss, but pinging
  5134.   anywhere past there causes you packet loss, you can deduce that the
  5135.   problem lies somewhere between those two points.
  5136.  
  5137.  
  5138.   14.2.  traceroute - How do I get there?
  5139.  
  5140.   The traceroute tool is found in the NetKit-A distribution detailed
  5141.   earlier. traceroute is primarily used for testing and displaying the
  5142.   path that your network connection would take to a destination host.
  5143.   traceroute also uses the icmp protocol, but it uses a clever trick to
  5144.   get each point along the path to send it back a reply as it creeps its
  5145.   way along. Its trick is to manually manipulate the time to live field
  5146.   of the datagrams it transmits. The time to live field is a mechanism
  5147.   that ensures that rogue datagrams do not get caught in a routing loop.
  5148.   Each time a datagram passes through a router it decrements the time to
  5149.   live field by one. If the time to live reaches zero then that router
  5150.   or host sends an icmp time to live expired message back to the host
  5151.   who transmitted the datagram to let it know the datagram has expired.
  5152.   traceroute uses this mechanism by sending a series of udp datagrams
  5153.   with the time to live beginning set at one, and incrementing each step
  5154.   it takes. By recording the addresses from the icmp time to live
  5155.   expired replies it receives in response to the datagrams dying it can
  5156.   determine the path taken to get to the destination.  An example of its
  5157.   use would look something like:
  5158.  
  5159.  
  5160.  
  5161.        # traceroute minnie.vk1xwt.ampr.org
  5162.        traceroute to minnie.vk1xwt (44.136.7.129), 30 hops max, 40 byte packets
  5163.         1  gw (44.136.8.97)  51.618 ms  30.431 ms  34.396 ms
  5164.         2  gw.uts (44.136.8.68) 2017.322 ms  2060.121 ms 1997.793 ms
  5165.         3  minnie.vk1xwt (44.136.7.129) 2205.335 ms  2319.728 ms  2279.643 ms
  5166.        #
  5167.  
  5168.  
  5169.  
  5170.  
  5171.   The first column tells us how many hops away (what the ttl value was),
  5172.   the second column is the hostname and address that responded if it
  5173.   could be resolved or just its address if it could not. The third,
  5174.   fourth and fifth columns are the round trip time for three consecutive
  5175.   datagrams to that point.  This tells us that the first hop in the
  5176.   network route is via gw.vk2ktj, and the three figures following are
  5177.   the round trip times to that router. The next hop was via
  5178.   gw.uts.ampr.org, and minnie.vk1xwt.ampr.org is one hop further away.
  5179.   You can deduce information about the network route by looking at the
  5180.   difference in times between each step in the route. You can see that
  5181.   the round trip times to gw are fairly fast, it is an ethernet
  5182.   connected host. gw.uts is substantially slower to get to than gw, it
  5183.   is across a low speed radio link, so you have the ethernet time plus
  5184.   the radio link time added together.  minnie.vk1xwt is only slightly
  5185.   slower than gw.uts, they are connected via a high speed network.
  5186.  
  5187.   If you perform a traceroute and you see the string !N appear after the
  5188.   time figure, this indicates that your traceroute program received a
  5189.   network unreachable response. This message tells you that the host or
  5190.   router who sent you the message did not know how to route to the
  5191.   destination address. This normally indicates that there is a network
  5192.   link down somewhere.  The last address listed is as far as you get
  5193.   before you find the faulty link.
  5194.  
  5195.   Similarly if you see the string !H this indicates that a host
  5196.   unreachable message has been received. This might suggest that you got
  5197.   as far as the ethernet that the remote host is connected to, but the
  5198.   host itself is not responding or is faulty.
  5199.  
  5200.  
  5201.   14.3.  tcpdump - capturing and displaying network activity.
  5202.  
  5203.   Adam Caldwell <acaldwel@103mort2.cs.ohiou.edu> has ported the tcpdump
  5204.   utlility to linux. tcpdump allows you to take traces of network
  5205.   activity by intercepting the datagrams on their way in and out of your
  5206.   machine. This is useful for diagnosing difficult to identify network
  5207.   problems.
  5208.  
  5209.   You can find the source and binaries at: 103mor2.cs.ohiou.edu
  5210.   <ftp://ftp.funet.fi/pub/OS/Linux/PEOPLE/Linus/net-
  5211.   source/tools/tcpdump-3.0.3.tar.gz>
  5212.  
  5213.   tcpdump decodes each of the datagrams that it intercepts and displays
  5214.   them in a slightly cryptic looking format in text. You would use
  5215.   tcpdump if you were trying to diagnose a problem like protocol errors,
  5216.   or strange disconnections, as it allows you to actually see what has
  5217.   happened on the network. To properly use tcpdump you would need some
  5218.   understanding of the protocols and how they work, but it is useful for
  5219.   simpler duties such as ensuring that datagrams are actually leaving
  5220.   your machine on the correct port if you are trying to diagnose routing
  5221.   problems and for seeing if you are receiving datagrams from remote
  5222.   destinations.
  5223.  
  5224.   A sample of tcpdump output looks like this:
  5225.  
  5226.  
  5227.  
  5228.        # tcpdump -i eth0
  5229.        tcpdump: listening on eth0
  5230.        13:51:36.168219 arp who-has gw.vk2ktj.ampr.org tell albert.vk2ktj.ampr.org
  5231.        13:51:36.193830 arp reply gw.vk2ktj.ampr.org is-at 2:60:8c:9c:ec:d4
  5232.        13:51:37.373561 albert.vk2ktj.ampr.org > gw.vk2ktj.ampr.org: icmp: echo request
  5233.        13:51:37.388036 gw.vk2ktj.ampr.org > albert.vk2ktj.ampr.org: icmp: echo reply
  5234.        13:51:38.383578 albert.vk2ktj.ampr.org > gw.vk2ktj.ampr.org: icmp: echo request
  5235.        13:51:38.400592 gw.vk2ktj.ampr.org > albert.vk2ktj.ampr.org: icmp: echo reply
  5236.        13:51:49.303196 albert.vk2ktj.ampr.org.1104 > gw.vk2ktj.ampr.org.telnet: S 700506986:700506986(0) win 512 <mss 1436>
  5237.        13:51:49.363933 albert.vk2ktj.ampr.org.1104 > gw.vk2ktj.ampr.org.telnet: . ack 1103372289 win 14261
  5238.        13:51:49.367328 gw.vk2ktj.ampr.org.telnet > albert.vk2ktj.ampr.org.1104: S 1103372288:1103372288(0) ack 700506987 win 2048 <mss 432>
  5239.        13:51:49.391800 albert.vk2ktj.ampr.org.1104 > gw.vk2ktj.ampr.org.telnet: . ack 134 win 14198
  5240.        13:51:49.394524 gw.vk2ktj.ampr.org.telnet > albert.vk2ktj.ampr.org.1104: P 1:134(133) ack 1 win 2048
  5241.        13:51:49.524930 albert.vk2ktj.ampr.org.1104 > gw.vk2ktj.ampr.org.telnet: P 1:28(27) ack 134 win 14335
  5242.  
  5243.         ..
  5244.        #
  5245.  
  5246.  
  5247.  
  5248.  
  5249.   When you start tcpdump without arguments it grabs the first (lowest
  5250.   numbered) network device that is not the loopback device. You can
  5251.   specify which device to monitor with a command line argument as shown
  5252.   above.  tcpdump then decodes each datagram transmitted or received and
  5253.   displays them, one line each, in a textual form. The first column is
  5254.   obviously the time the datagram was transmitted or received. The
  5255.   remainder of the line is then dependent on the type of datagram. The
  5256.   first two lines in the sample are what an arp request from
  5257.   albert.vk2ktj for gw.vk2ktj look like. The next four lines are two
  5258.   pings from albert.vk2ktj to gw.vk2ktj, note that tcpdump actually
  5259.   tells you the name of the icmp datagram transmitted or received. The
  5260.   greater-than (>) symbol tells you which way the datagram was
  5261.   transmitted, that is, from who, to who. It points from the sender, to
  5262.   the receiver. The remainder of the sample trace are the establishment
  5263.   of a telnet connection from albert.vk2ktj to gw.vk2ktj.
  5264.  
  5265.   The number or name at the end of each hostname tells you what socket
  5266.   number is being used. tcpdump looks in your /etc/services file to do
  5267.   this translation.
  5268.  
  5269.   tcpdump explodes each of the fields, and so you can see the values of
  5270.   the window and mss parameters in some of the datagrams.
  5271.  
  5272.   The man page documents all of the options available to you.
  5273.  
  5274.   Note for PPP users: The version of tcpdump that is currently available
  5275.   does not support the PPP suite of protocols. Al Longyear has produced
  5276.   a pair of patches to correct this, but these have not been built into
  5277.   a tcpdump distribution yet. The patch files are located in the same
  5278.   directory on sunsite.unc.edu as the tcpdump package.
  5279.  
  5280.  
  5281.   14.4.  icmpinfo - logs icmp messages received.
  5282.  
  5283.   ICMP then Internet Control Message Protocol conveys useful information
  5284.   about the health of your IP network. Often ICMP messages are received
  5285.   and acted on silently with you never knowing of their presence.
  5286.   icmpinfo is a tool that will allow you to view ICMP messages much like
  5287.   tcpdump does.  Laurent Demailly <dl@hplyot.obspm.fr> took the bsd ping
  5288.   source and modified it heavily.
  5289.  
  5290.   Version 1.10 is available from:
  5291.  
  5292.   hplyot.obspm.fr
  5293.  
  5294.  
  5295.        /net/icmpinfo-1.10.tar.gz
  5296.  
  5297.  
  5298.  
  5299.  
  5300.   Compilation is as simple as:
  5301.  
  5302.  
  5303.  
  5304.        # cd /usr/src
  5305.        # cd icmpinfo-1.10
  5306.        # gzip -dc icmpinfo-1.10.tar.gz | tar xvf -
  5307.        # make
  5308.  
  5309.  
  5310.  
  5311.  
  5312.   You must be SuperUser to run icmpinfo. icmpinfo can either decode to
  5313.   the tty it was called from or send its output to the syslog utility.
  5314.  
  5315.   To test out how it works, try running icmpinfo and starting a
  5316.   traceroute to a remote host. You will see the icmp messages that
  5317.   traceroute uses listed on the output.
  5318.  
  5319.  
  5320.  
  5321.   15.  Some Frequently Asked Questions, with brief Answers.
  5322.  
  5323.   Following are some questions and answers that are commonly asked.
  5324.  
  5325.  
  5326.   15.1.  General questions:
  5327.  
  5328.  
  5329.  
  5330.      I have only a dialin terminal access to a machine on the net, can I
  5331.         use
  5332.         this as a network connection ?"  Yes you can, take a look at
  5333.         TERM. TERM allows you you to run network connections over a
  5334.         normal terminal session. It requires some modifications to the
  5335.         network applications to work with it, but binaries and sources
  5336.         are available for the most common ones already. take a look at
  5337.         the TERM-HOWTO <http://sunsite.unc.edu/mdw/HOWTO/Term-
  5338.         HOWTO.html> for lots more information.
  5339.  
  5340.  
  5341.      When I telnet/ftp/rlogin to my machine it takes forever, why?
  5342.         You do not have your name resolver configured properly. Reread
  5343.         the section on /etc/resolv.conf. You must have at least a
  5344.         nameserver entry configured.
  5345.  
  5346.  
  5347.      I want to build my own standalone network, what addresses do I use
  5348.         ?
  5349.         RFC1597 has specifically reserved some IP addresses for private
  5350.         networks.  You should use these as they prevent anything nasty
  5351.         happening if you accidentally get connected to the Internet. The
  5352.         addresses reserved are:
  5353.  
  5354.  
  5355.           10.0.0.0        -   10.255.255.255
  5356.           172.16.0.0      -   172.31.255.255
  5357.           192.168.0.0     -   192.168.255.255
  5358.  
  5359.  
  5360.  
  5361.  
  5362.      Note, reserved network addresses are of classes A, B and C, so you
  5363.      are not restricted in your network design or size. Since you won't
  5364.      be connecting to the Internet it doesn't matter if you use the same
  5365.      address as some other group or network, just so long as the
  5366.      addresses you use are unique within your network.
  5367.  
  5368.  
  5369.      I want the machines on my local network to work via my dial-ip
  5370.         Internet connection, how do I do it?
  5371.         You have three options. They are as follows:
  5372.  
  5373.      o  Ask your Internet Service Provider to provide a network route to
  5374.         you instead of a host route. This is likely to be expensive but
  5375.         is the best performing and technical option.
  5376.  
  5377.      o  Set up your machine that supports your dial-up link as a `SOCKS'
  5378.         based firewall. This will inherently provide a proxy function
  5379.         where the outside world thinks it is your router machine doing
  5380.         the talking where in fact it is doing it on behalf of the
  5381.         machines on your network. Check the Firewall-HOWTO
  5382.         <http://sunsite.unc.edu/mdw/HOWTO/Firewall-HOWTO.html> for
  5383.         detailed information on how to do this. This will require the
  5384.         machines on your network to have client programs that support
  5385.         the SOCKS capability.
  5386.  
  5387.      o  Configure and run the IP-Masquerade software. This is probably
  5388.         the simplest way, as it is fairly straightforward to do and
  5389.         doesn't require special clients on your machines. This software
  5390.         very cleverly performs address translations that make the
  5391.         machines on your network look like they are the machine
  5392.         supporting your dial-up connection. There are some limitations
  5393.         to how well this will work, but it is much lighter-weight than
  5394.         running a full firewall gateway.
  5395.  
  5396.  
  5397.      If sunacm.swan.ac.uk is down, how do I get the files specified ?
  5398.         `sunacm' is mirrored on:
  5399.  
  5400.         ftp.Uni-Mainz.DE
  5401.  
  5402.  
  5403.           /pub/Linux/packages/Net2Debugged
  5404.  
  5405.  
  5406.  
  5407.  
  5408.      and/or:
  5409.  
  5410.      ftp.infomagic.com
  5411.  
  5412.  
  5413.      /pub/mirrors/linux/sunacm
  5414.  
  5415.  
  5416.  
  5417.  
  5418.  
  5419.      How do I know what version of kernel/net code I am running ?
  5420.         The network code and kernel now have synchronised version
  5421.         numbers, so try:
  5422.  
  5423.         uname -a
  5424.  
  5425.         or:
  5426.  
  5427.         cat /proc/version
  5428.  
  5429.  
  5430.      How do I change the message that telnet users are given at connect?
  5431.         The /etc/issue is the message that is given to normal getty
  5432.         users when they login. Some telnetd programs use a different
  5433.         file /etc/issue.net instead. So if you find that changing your
  5434.         issue file doesn't work, try changing the other.
  5435.  
  5436.  
  5437.  
  5438.   15.2.  Error messages:
  5439.  
  5440.  
  5441.  
  5442.      I keep getting the error `eth0: transmit timed out'. What does this
  5443.         mean?
  5444.         This usually means that your Ethernet cable is unplugged, or
  5445.         that the setup parameters for your card (I/O address, IRQ, etc.)
  5446.         are not set correctly.  Check the messages at boot time and make
  5447.         sure that your card is recognized with the correct Ethernet
  5448.         address. If it is, check that there is no conflict with any
  5449.         other hardware in your machine, eg you might have a soundblaster
  5450.         sharing the same IRQ or i/o control port.
  5451.  
  5452.  
  5453.      I get errors `check Ethernet cable' when using the network.
  5454.         You probably have your Ethernet card configured incorrectly.
  5455.         Double check the settings in /usr/src/linux/drivers/net/CONFIG.
  5456.         If this checks out ok, you may in fact have a cabling problem,
  5457.         check the cables are plugged in securely.
  5458.  
  5459.  
  5460.  
  5461.   15.3.  Routing questions:
  5462.  
  5463.  
  5464.  
  5465.      Why do I get the message `obselete route request' when I use the
  5466.         route command ?
  5467.         You are using a version of route that is older than your kernel.
  5468.         You should upgrade to a newer version of route. Refer to the
  5469.         "The network configuration tool suite" section of this document
  5470.         for information on where to obtain the tool set.
  5471.  
  5472.  
  5473.      Why do I get a `network unreachable' message when I try and net-
  5474.         work?
  5475.         This message means that yours, or some other, machine doesn't
  5476.         know how to route to the host that you are attempting to ping or
  5477.         connect to. If it occurs for all hosts that you try, then it is
  5478.         probable that you don't have your default route set up properly,
  5479.         reread the `routing' section.
  5480.  
  5481.  
  5482.      I can ping my server/gateway, but can't ping or connect to anyone
  5483.         remote.
  5484.         This is probably due to a routing problem. Reread the `routing'
  5485.         section in this document. If this looks ok, then make sure that
  5486.         the host you are attempting to connect to has a route to you. If
  5487.         you are a dialin user then this is a common cause of problems,
  5488.         ensure that your server is either running a routing program like
  5489.         gated or routed, or that it is `prox arping' for you, otherwise
  5490.         you will be able to get datagrams to the remote host, but it
  5491.         won't know how to return datagrams to you.
  5492.  
  5493.  
  5494.  
  5495.   15.4.  Using Linux with fileservers/NFS:
  5496.  
  5497.  
  5498.  
  5499.      How do I use my existing Novell fileserver with my Linux machine ?
  5500.         If you have the Novell NFS Daemon code then it is easy, just NFS
  5501.         mount the Novell volume that you wish to use. If you don't, and
  5502.         you are really desperate to be able to do this, and you have a
  5503.         spare pc machine laying about, you are in luck. You can run a
  5504.         program called Stan's Own Server on the spare PC. First,
  5505.         configure the pc as a novell workstation with maps to the
  5506.         directories you want to nfs mount, then run SOS, and export
  5507.         those drive maps.  SOS is available from
  5508.         spdcc.com:pub/sos/sossexe.zoo
  5509.  
  5510.  
  5511.      Files get corrupted when running NFS over a network.
  5512.         Certain vendors (Sun primarily) shipped many machines running
  5513.         NFS without UDP checksums. Great on ethernet, suicide otherwise.
  5514.         UDP checksums can be enabled on most file servers. Linux has it
  5515.         enabled by default from pl13 onwards - but both ends need to
  5516.         have it enabled...
  5517.  
  5518.  
  5519.      Why are my NFS files all read only ?
  5520.         The Linux NFS server defaults to read only. RTFM the `exports'
  5521.         and nfsd manual pages. With non Linux servers you may also need
  5522.         to alter /etc/exports
  5523.  
  5524.  
  5525.  
  5526.   15.5.  slip questions:
  5527.  
  5528.  
  5529.  
  5530.      What do I do if I don't know my slip servers address ?
  5531.         dip doesn't really need to know the address of your slip server
  5532.         for slip to function. The remote option was added as a
  5533.         convenience so that dip could automate the ifconfig and route
  5534.         commands for you. If you don't know, and cannot find out the
  5535.         address of your slip server then Peter D. Junger
  5536.         Junger@samsara.law.cwru.edu has suggested that he simply used
  5537.         his own address wherever a dip script called for a remote
  5538.         address. This is a small kludge but it works ok, as the server's
  5539.         address never actually appears in the slip headers anyway.
  5540.  
  5541.  
  5542.      `dip' only works for root. How do I make it work for others?
  5543.         dip needs to be setuid root to do some of the things it needs to
  5544.         do, such as modifying the routing table. Uri Blumenthal
  5545.         recommends the following:
  5546.  
  5547.      o  Create a new group called dip in your /etc/group file, and place
  5548.         each person who you want to allow dial out operation in it.
  5549.  
  5550.      o  Then when logged in as root, do the following:
  5551.  
  5552.         # chown root.dip /usr/bin/dip
  5553.         # chmod u=rx,g=x,o= /usr/bin/dip
  5554.         # chmod u+s /usr/bin/dip
  5555.  
  5556.  
  5557.  
  5558.      Dial-In users will be restricted in what they can do by what is
  5559.      contained in the /etc/diphosts file.
  5560.  
  5561.  
  5562.      I get `DIP: tty: set_disc(1): Invalid argument', why?
  5563.         This usually suggests that your kernel has not been compiled
  5564.         with slip support in it. Check that /proc/net/dev contains
  5565.         devices called sl0, sl1 etc. It could also mean that your
  5566.         version of dip is very old. You should upgrade to a newer
  5567.         version.
  5568.  
  5569.  
  5570.      When I ping a host I get `wrong data byte #17...', why?
  5571.         This generally means that you have your modem configured for
  5572.         XON/XOFF flow control. SLIP must have an eight bit clean line,
  5573.         so you cannot use XON/XOFF flow control. Hardware handshaking
  5574.         works better anyway, use it.
  5575.  
  5576.  
  5577.      With SLIP I can ping my server, and other hosts, but telnet or ftp
  5578.         don't
  5579.         work."  This is most likely caused by a disagreement on the use
  5580.         of header compression between your server and your machine.
  5581.         Double check that both ends either are, or are not, using
  5582.         compression. They must match.
  5583.  
  5584.  
  5585.      How can I hang up the phone line when I'm done using SLIP?
  5586.         If you use dip to dial out on the SLIP line, just `dip -k'
  5587.         should do the trick. If not, try to kill the dip process that is
  5588.         running. When dip dies it should hang up the call. To give it
  5589.         the best chance to clean up after itself, try killing the
  5590.         process in the following sequence: `kill <pid>', `kill -hup
  5591.         <pid>', and finally, if the dip process still refuses to die,
  5592.         try `kill -9 <pid>'. The same philosophy should be applied to
  5593.         all unix processes that you are attempting to kill.
  5594.  
  5595.  
  5596.      I see a lot of overrun errors on my slip port, why ?
  5597.         The older network tools incorrectly report number of packets
  5598.         compressed as the number of packets overrun. This has been
  5599.         corrected, and shouldn't occur of you are running the new
  5600.         version kernel and tools. If it still is it probably indicates
  5601.         that your machine isn't keeping up with the rate of data
  5602.         incoming. If you are not using 16550AFN UARTs then you should
  5603.         upgrade to them. 16450, or 8250 generate an interrupt for every
  5604.         character they receive and are therefore very reliant on the
  5605.         processor to be able to find time to stop what it is doing an
  5606.         collect the character from them to ensure none get lost. The
  5607.         16550AFN has a 16 character FIFO, and they only generate
  5608.         interrupts when the FIFO is nearly full, or when they have had
  5609.         character waiting, this means that less interrupts get generated
  5610.         for the same amount of data, and that less time is spent
  5611.         servicing your serial port. If you want to use multiple serial
  5612.         ports you should mandatorily upgrade to 16550AFN UARTs anyway.
  5613.  
  5614.  
  5615.      Can I use two slip interfaces ?
  5616.         Yes. If you have, for example, three machines which you would
  5617.         like to interconnect, then you most certainly could use two slip
  5618.         interfaces on one machine and connect each of the other machines
  5619.         to it. Simply configure the second interface as you did the
  5620.         first. NOTE that the second interface will require a different
  5621.         IP address to the first. You may need to play with the routing a
  5622.         bit to get it to do what you want, but it should work.
  5623.  
  5624.  
  5625.      I have a multiport i/o card, how do I use more than 4 slip ports ?
  5626.         The kernel slip comes with a default of a maximum of 4 slip
  5627.         devices configured, this is set in the
  5628.         /usr/src/linux/drivers/net/slip.h file.  To increase it, say to
  5629.         16, change the #define SL_NRUNIT to 16, in place of the 4 that
  5630.         will be there. You also need to edit
  5631.         /usr/src/linux/drivers/net/Space.c and add sections for sl4, sl5
  5632.         etc. You can copy the existing driver definition as a template
  5633.         to make it easier. You will need to recompile the kernel for the
  5634.         change to take effect.
  5635.  
  5636.  
  5637.  
  5638.   15.6.  PPP questions.
  5639.  
  5640.   You should refer to the PPP-HOWTO
  5641.   <http://sunsite.unc.edu/mdw/HOWTO/PPP-HOWTO.html> for a list of PPP
  5642.   questions and answers compiled by Al Longyear.
  5643.  
  5644.  
  5645.   16.  Quick Guide - SLIP Server
  5646.  
  5647.   Configuring your linux machine as a slip server is a deceptively
  5648.   simple thing to do. The actual process is simple, but there are a
  5649.   number of different aspects to the configuration and understanding how
  5650.   each of the stages interact with each other is what will help you
  5651.   diagnose any problems you experience.  Here are the steps that you
  5652.   must follow to configure your linux machine as a slip server:
  5653.  
  5654.  
  5655.   1. Assemble your hardware. Avoid IRQ and shared memory conflicts. Test
  5656.      each of the serial ports by connecting a dumb terminal to each of
  5657.      the ports and use a null modem cable and a comms program like
  5658.      minicom or seyon to talk to each. Make sure you can send and
  5659.      receive characters. If you intend running a number of serial ports
  5660.      then try to use a smart serial board or use 16550AFN UARTs. This
  5661.      will help ease some of the work of handling interrupts generated by
  5662.      the serial ports.
  5663.  
  5664.   2. Build your kernel, make sure it has networking configured, IP
  5665.      Forwarding enabled, and SLIP configured. Make sure you configure
  5666.      CSLIP if you wish to use it. Double check you have IP Forwarding
  5667.      enabled.
  5668.  
  5669.   3. Install your kernel. Test the kernel. Check the /proc/net/dev file
  5670.      and make sure that you have sl0 and other slip devices listed. If
  5671.      not then you have probably made some error in configuring your
  5672.      kernel, or you are not actually running your new kernel.
  5673.  
  5674.   4. Configure a getty on the serial port(s) that you wish to use for
  5675.      your incoming calls. You should refer to the Serial-HOWTO
  5676.      <http://sunsite.unc.edu/mdw/HOWTO/Serial-HOWTO.html> for a
  5677.      description of how to do this. Remember to configure your modem so
  5678.      that the DCD pin tracks received carrier, this is how your getty
  5679.      will detect an incoming call.
  5680.  
  5681.   5. Test the getty to make sure it works. It is important that you do
  5682.      this before you start worrying about the actual SLIP configuration.
  5683.      Try dialing into your system, you should get a login: prompt and be
  5684.      able to login normally.
  5685.  
  5686.   6. Decide how you want your server to allocate addresses. If you want
  5687.      your users to get the same address each time they call then you
  5688.      want a static server, if you want to minimise the number of
  5689.      addresses you use and don't care what address your users are
  5690.      allocated then you want a dynamic server.
  5691.  
  5692.   7. Decide how you are going to build the SLIP server, whether you are
  5693.      going to use sliplogin, dip or dslip. If you wish to use the
  5694.      sliplogin package then refer to the "Slip Server using Sliplogin"
  5695.      section. If you are going to use dip then refer to section "Slip
  5696.      Server using DIP". If you want to build your slip server using the
  5697.      dslip package then refer to section "Slip Server using dslip".
  5698.      Ensure you have the appropriate software, it is a recent version
  5699.      and compile the software if necessary.
  5700.  
  5701.   8. If the addresses you are allocating to you slip users are part of
  5702.      your ethernet network, then make sure you read the Proxy ARP
  5703.      section and configure a proxy arp for each address. You may do this
  5704.      in the /etc/sliplogin and /etc/sliplogout files if you are using
  5705.      the sliplogin package. If the addresses you are allocating are from
  5706.      a network seperate to your ethernet network then you can use either
  5707.      proxy arp or gated. If you use gated then refer to the "gated"
  5708.      section.
  5709.  
  5710.   9. Test your slip server.
  5711.  
  5712.  
  5713.  
  5714.   17.  Known Bugs.
  5715.  
  5716.   The Linux networking code is still an evolving thing. It still has
  5717.   bugs though they are becoming less frequently reported now. The Linux
  5718.   Networking News <http://iifeak.swan.ac.uk/NetNews.html> is a World
  5719.   Wide Web page maintained by Alan Cox which contains information on the
  5720.   status of the NET-3 networking code. You can obtain information on
  5721.   what is known and what isn't, by reading the
  5722.   /usr/src/linux/net/inet/README file that accompanies the kernel
  5723.   source, or by joining the linux-net channel.
  5724.  
  5725.  
  5726.   18.  Copyright Message.
  5727.  
  5728.   The NET-2-HOWTO is copyright by Terry Dawson and Matt Welsh. A
  5729.   verbatim copy of this document may be reproduced and distributed in
  5730.   any medium, physical or electronic without permission of the authors.
  5731.   Translations are similarly permitted without express permission if
  5732.   such translations include a notice stating who performed the
  5733.   translation, and that it is a translation.  Commercial redistribution
  5734.   is allowed and encouraged, however, the authors would like to be
  5735.   notified of any such distributions.
  5736.  
  5737.   Short quotes may be used without prior consent by the authors.
  5738.   Derivative works and partial distributions of the NET-2-HOWTO must
  5739.   include either a verbatim copy of this file, or make a verbatim copy
  5740.   of this file available.  If the latter is the case, a pointer to the
  5741.   verbatim copy must be stated at a clearly visible place.
  5742.  
  5743.   In short, we wish to promote dissemination of this information through
  5744.   as many channels as possible. However, we wish to retain copyright on
  5745.   this HOWTO document, and would like to be notified of any plans to
  5746.   redistribute it.  Further we desire that ALL information provided in
  5747.   this HOWTO be disseminated.
  5748.  
  5749.   If you have any questions relating to the conditions of this
  5750.   copyright, please contact Matt Welsh, the Linux HOWTO coordinator, at:
  5751.   mdw@sunsite.unc.edu
  5752.  
  5753.  
  5754.   19.  Miscellaneous, and Acknowledgements.
  5755.  
  5756.   There are so many people who have contributed comments and suggestions
  5757.   for this update that I have forgotten who you are. Thanks.
  5758.  
  5759.   Please, if you have any comments or suggestions then mail them to me.
  5760.   I'm fairly busy these days, so I might not get back to you straight
  5761.   away, but I will certainly consider any suggestion you have.
  5762.  
  5763.   The Linux networking code has come a long way, and it hasn't been an
  5764.   easy trip, but the developers, all of them, have done an excellent job
  5765.   in getting together something that is functional, versatile, flexible,
  5766.   and free for us to use. We all owe them a great debt of thanks. Linus,
  5767.   Ross, Fred, Alan, the Alpha/Beta testers, the tools developers, and
  5768.   those offering moral support have all contributed to the code as it is
  5769.   today.
  5770.  
  5771.   For those that have an itch they want to scratch, happy hacking, here
  5772.   it is.
  5773.  
  5774.  
  5775.   regards Terry Dawson, vk2ktj.
  5776.  
  5777.   <terryd@extro.ucc.su.oz.au>, or <terry@orac.dn.telecom.com.au>
  5778.