home *** CD-ROM | disk | FTP | other *** search
/ Current Shareware 1994 January / SHAR194.ISO / misc / linuxhow.zip / NET_2.HOW < prev   
Internet Message Format  |  1993-09-14  |  64KB

  1. Path: nlbbs!jaxsat!pagesat!decwrl!concert!samba.oit.unc.edu!sunSITE!mdw
  2. From: mdw@sunsite.unc.edu (Matt Welsh)
  3. Newsgroups: comp.os.linux.announce,comp.os.linux.
  4. elp,comp.os.linux.admin,news.answers,comp.answers
  5. Subject: Linux NET-2 HOWTO
  6. Summary: HOWTO on configuration of TCP/IP networking and SLIP under Linux.
  7. Keywords: Linux, Networking, TCP/IP, NET-2, SLIP
  8. Message-ID: <270f0k$slo@samba.oit.unc.edu>
  9. Date: 13 Sep 1993 00:31:16 GMT
  10. Followup-To: poster
  11. Organization: Linux. It's not just for breakfast anymore.
  12. Lines: 1221
  13. Approved: linux-announce@tc.cornell.edu (Matt Welsh)
  14. NNTP-Posting-Host: calypso.oit.unc.edu
  15. Originator: mdw@sunSITE
  16.  
  17. Archive-name: linux/howto/networking
  18. Last-modified: 28 August 1993
  19.  
  20.         This is the Linux NET-2 HOWTO (previously known as the NET-2-FAQ).    
  21.  
  22.         This document explains how to configure TCP/IP and SLIP with the new 
  23.         ``NET-2'' networking code in Linux kernels 0.99.pl10 and above. 
  24.         Please mail me if you have questions or comments. --mdw
  25.  
  26. This is the Linux NET-2 HOWTO v1.6, 28 August 1993
  27. By Matt Welsh <mdw@sunsite.unc.edu> and Terry Dawso
  28.  <terryd@extro.ucc.su.oz.au>
  29.  
  30. *** FTP site maintainers: This document should be stored in the docs/HOWTO
  31. *** directory on your Linux archive as ``NET-2-HOWTO''. You may also wish
  32. *** to link this file to ``NET-2-FAQ'' (its previous name). This document
  33. *** also supercedes the old Linux NET-FAQ.
  34.  
  35. "Real Programmers don't write documentation." --Ancient Proverb
  36.  
  37. 0. Introduction
  38.         This is the NET-2 HOWTO, which is a rewrite of the earlier NET-FAQ for
  39.         the new NET-2 TCP/IP code in Linux kernels 0.99.pl10 and above. 
  40.  
  41.         The NET-2 code is the new kernel-based networking support for Linux,
  42.         written by Fred van Kempen <waltje@uwalt.nl.mugnet.org>. It is based 
  43.         on the NET-1 code by Ross Biro <bir7@leland.stanford.edu>, device 
  44.         drivers by Donald Becker <becker@super.org>, SLIP drivers by 
  45.         Laurence Culhane <loz@holmes.demon.co.uk>, and the D-Link driver by
  46.         Bj0rn Ekwall <bj0rn@blox.se>. Many others too numerous to mention have
  47.         provided support, bug fixes, and help. 
  48.  
  49.         This NET-2 HOWTO is by Matt Welsh and Terry Dawson. It covers setup 
  50.         and configuration of TCP/IP under Linux using NET-2. It also hopefully
  51.         answers some of the many questions about the NET-2 code and common
  52.         problems that people have. It does not cover using TCP/IP (i.e.
  53.         using telnet, FTP, etc.) I'd like to keep this document as short as
  54.         possible... :)
  55.  
  56. 0.1 Disclaimer
  57.         The NET-2 code is currently under development, which means that it may
  58.         not be as stable and easy to configure as you may like it to be. The 
  59.         code is relatively new and bug fixes are being posted every day, so if
  60.         you run into a large number of problems just hang in there. The 
  61.         software has stabilized greatly over the last few weeks (evidenced by 
  62.         the fact that it's included in Linus' standard kernel). 
  63.  
  64.         NOTE: In this document, ``NET-2'' does not refer to the Berkeley
  65.         Software Distribution NET-2 release of BSD UNIX. Yes, the names
  66.         are conflicting. In this HOWTO, ``NET-2'' refers only to the new
  67.         generation of TCP/IP code in the Linux kernel.
  68.  
  69. 0.2 Questions already?
  70.         If you have questions about the NET-2 code, please READ this document
  71.         first and then join the NET channel of the Linux-activists mailing lis
  72.         by sending mail to
  73.                 linux-activists-request@niksula.hut.fi
  74.         with the line
  75.                 X-Mn-Admin: join NET
  76.         at the top of the message body (not the subject). Note that the SLIP
  77.         channel of the mailing list has been disabled and the NET channel 
  78.         should be used for SLIP discussions as well. Furthermore keep in mind
  79.         that the NET channel is for development discussions only. If you have
  80.         general configuration questions you can mail the authors of this 
  81.         document (mdw@sunsite.unc.edu and terryd@extro.ucc.su.oz.au) or post 
  82.         to the newsgroup comp.os.linux. Please do NOT bug the NET-2 
  83.         developers directly unless you have a development-related issue 
  84.         (especially Fred: he has to pay $$$ for his e-mail access). :)
  85.  
  86. 0.3 Related documentation
  87.         There is a forthcoming book from the Linux Documentation Project 
  88.         entitled ``Linux Network Administration Guide'' by Olaf Kirch. It 
  89.         covers all aspects of setting up and using networking under Linux, 
  90.         including TCP/IP, UUCP, mail, news, etc. Once this book is officially
  91.         released, it should supplement the NET-2 HOWTO  and cover all of the
  92.         other aspects of using TCP/IP. This guide simply covers setup of 
  93.         NET-2, i.e., "How to put your machine on the net."
  94.  
  95.         You should read the Ethernet HOWTO (from sunsite.unc.edu:
  96.         /pub/Linux/docs/HOWTO) if you are using an Ethernet network
  97.         with NET-2. The Ethernet HOWTO explains all of the ins and outs
  98.         of using and configuring Ethenet devices for Linux.
  99.  
  100.         This NET-2 HOWTO supercedes the earlier ``Linux NET-FAQ'' by Phil
  101.         Copeland and Matt Welsh. The NET-FAQ is for Linux kernels previous
  102.         to 0.99.pl10, running the older version of the TCP/IP code.
  103.  
  104.         This document used to be called the NET-2-FAQ, before the Linux HOWTO
  105.         project was underway. Thus, the NET-2-FAQ and the NET-2 HOWTO are
  106.         the same.
  107.  
  108. 0.4 New versions of this document
  109.         New versions of this document can be retrieved via anonymous
  110.         FTP from sunsite.unc.edu:/pub/Linux/docs or directly from me
  111.         (mdw@sunsite.unc.edu). It will also be posted to the newsgroups 
  112.         comp.os.linux.announce, comp.os.linux, and news.answers. 
  113.  
  114.         You can find news.answers FAQ postings, including this one, archived
  115.         on rtfm.mit.edu:/pub/usenet.
  116.  
  117. 0.5 Feedback
  118.         Please send any comments, updates, suggestions, money, or small
  119.         household pets to mdw@sunsite.unc.edu. The sooner I get feedback
  120.         about this document, the sooner I can update and correct it. If you
  121.         find any problems with it, please mail me, instead of posting to
  122.         one of the newsgroups. I may miss your corrections. Thanks.
  123.  
  124.  
  125. 1. NET-2 Supported Functionality
  126.         The NET-2 code is a complete kernel implementation of TCP/IP for
  127.         Linux, including many features not found in the original networking
  128.         code. NET-2 supports many popular Ethernet cards, real IP routing,
  129.         and SLIP (Serial Line IP) for TCP/IP connections over the phone line
  130.         via modem. 
  131.  
  132. 1.1 Supported Ethernet cards
  133.         NET-2 supports the following Ethernet cards:
  134.  
  135.         3com 3c503, 3c503/16
  136.         Novell NE1000, NE2000
  137.         Western Digital WD8003, WD8013
  138.         Hewlett Packard HP27245, HP27247, HP27250 (these drivers could
  139.           do with more testing)
  140.  
  141.         The following clones are reported to work:
  142.         WD-80x3 clones: LANNET LEC-45
  143.         NE2000 clones: Alta Combo, Artisoft LANtastic AE-2, Asante Etherpak
  144.           2001/2003, D-Link Ethernet II, LTC E-NET/16 P/N 8300-200-002,
  145.           Network Solutions HE-203, SVEC 4 Dimension Ethernet, 4-Dimension
  146.           FD0490 EtherBoard 16, D-Link DE-600, SMC Elite 16.
  147.  
  148.         Please see the Ethernet HOWTO for more complete information.
  149.  
  150.         As mentioned above NET-2 also supports SLIP in the kernel. Therefore
  151.         if you don't have an Ethernet connection you can do TCP/IP over the
  152.         phone line, provided you have a SLIP server nearby (many universities
  153.         and businesses provide SLIP access to employees/students) and a
  154.         compatible modem (usually 14.4 v.42bis, depending on your SLIP server)
  155.         Two possible modems are the US Robotics Sportster, or the Infotel
  156.         144DF Internal. 
  157.  
  158.  
  159. 2. Getting the NET-2 Software
  160.         Before you can configure TCP/IP on your system you need to get the
  161.         appropriate software. This includes the current version of the Linux
  162.         kernel (0.99.pl10 or above), TCP/IP configuration programs and files
  163.         (e.g., /etc/ifconfig, /etc/hosts), and finally a set of network
  164.         application programs (such as telnet, ftp, rlogin, etc.). 
  165.  
  166.         You may already have all of the items below. Check and make
  167.         sure that you do. For example, SLS 1.03 comes with all of the NET-2
  168.         configuration files, binaries, libraries, and kernel installed, 
  169.         so there's no reason to get the following files.
  170.  
  171.         If you DO have the NET-2 software already, skip to section 3 on
  172.         configuration. If you do NOT have the NET-2 software, follow the
  173.         directions below.
  174.  
  175.  
  176.         The current kernel version is found in
  177.         nic.funet.fi:/pub/OS/Linux/PEOPLE/Linus/linux-0.99.12.tar.gz. 
  178.         This is a gzipped tar file; .gz is the new extension used by gzip.
  179.         If you have the old version of gzip, "zcat foo.gz | tar xvf -" works.
  180.  
  181.         The current libraries (libc-4.4.1), found in 
  182.         sunsite.unc.edu:/pub/Linux/GCC/image-4.4.1.tar.z. (You'll probably 
  183.         want to install the include files in inc-4.4.1.tar.z as well! See the 
  184.         READMEs there for details.)
  185.  
  186.         The current NET-2 configuration file distribution is in
  187.         tsx-11.mit.edu:/pub/linux/packages/net/net-2/sources/net/net-010.tar.z
  188.  
  189.         The TCP/IP application binaries and setup files are found in
  190.         tsx-11.mit.edu:/pub/linux/packages/net/net-2/binaries. 
  191.         Get the three files in this directory: net-base.tar.z, net-std.tar.z, 
  192.         and net-ext.tar.z.
  193.  
  194.         If you use shadow password (most SLS users do) you need to get the
  195.         shadow-passwd enabled net binaries in addition to the above. Get them
  196.         from pub/Linux/system/Network/net2-shadow-bin.tgz on sunsite.unc.edu.
  197.         
  198.  
  199. 2.1 Unpacking the software
  200.         You don't need to unpack any of the following if you already have all
  201.         of the NET-2 software installed.
  202.         
  203.         First, unpack the kernel sources in /usr/src. This will put all
  204.         of the kernel sources under /usr/src/linux (the usual place).
  205.                 # cd /usr/src
  206.                 # zcat linux-0.99.12.tar.z | tar xvf -
  207.  
  208.         Next, unpack the libraries. 
  209.                 # cd /
  210.                 # zcat image-4.4.1.tar.z | tar xvf -
  211.         Now, make the links to the new libraries in /lib. BE VERY CAREFUL
  212.         that you do not delete the previous links. Do everything in
  213.         one step, as so:
  214.                 # ln -sf /lib/libc.so.4.4.1 /lib/libc.so.4
  215.                 # ln -sf /lib/libm.so.4.4.1 /lib/libm.so.4
  216.  
  217.         Next, unpack the net-base package, which contains the basic
  218.         utils and configuration files in /etc. Note that net-base makes
  219.         symlinks in /etc for all of your TCP/IP configuration files to /conf.
  220.  
  221.         Therefore, BE WARNED: Before you unpack the following tar files,
  222.         make a backup of your files in /etc. Unpacking net-base will overwrite
  223.         many of the files in /etc with symbolic links to other places.
  224.         For example, /etc/hosts is a symlink to /conf/net/hosts. Why is this
  225.         done? Because Fred's Linux/PRO distribution of Linux keeps all
  226.         machine-specific configuration files in /conf. And because this is
  227.         the way he does it, we may as well too. In general it makes things
  228.         easier to locate. If you want to keep all of your net files in 
  229.         /etc, that's fine, but you'll have to put them there by hand.
  230.  
  231.         ANOTHER WARNING: On SLS distributions, /usr/etc is a symlink to
  232.         /etc. You need to delete this link if you have it. So, run the
  233.         command
  234.                 # rm /usr/etc
  235.  
  236.         Do NOT use "rm -r" which will delete everything in /etc as well.
  237.         Just use "rm /usr/etc" to delete the link. If /usr/etc is just
  238.         a directory (as it should be), or if you don't have a /usr/etc 
  239.         at all, there's no need to touch it.
  240.  
  241.         Make a backup of everything in /etc before you unpack net-base. 
  242.         Then unpack it from / (the root directory):
  243.                 # cd /
  244.                 # zcat net-base.tar.z | tar xvvofp -
  245.  
  246.         Also, unpack net-std.tar.z, which contains the network clients and
  247.         daemons (e.g., telnet and telnetd). Unpack it from / as well:
  248.                 # cd /
  249.                 # zcat net-std.tar.z | tar xvvofp -
  250.  
  251.  
  252.         If you wish to use tin (a newsreader), or DIG (the DARPA Internet
  253.         Groper), unpack the net-ext package from /:
  254.                 # cd /
  255.                 # zcat net-ext.tar.z | tar xvvofp -
  256.  
  257.  
  258.         Finally, unpack the net-010 package, which contains the sources
  259.         for the TCP/IP setup programs (ifconfig, arp, route, etc.) and the
  260.         configuration files. This is unpacked into /usr/src/net-010.
  261.                 # mkdir /usr/src/net-010
  262.                 # cd /usr/src/net-010
  263.                 # zcat net-010.tar.z | tar xvvofp -
  264.  
  265.         If you use shadow passwd, you need to unpack the net2-shadow-bin
  266.         package from the root directory (/) after unpacking the software
  267.         above.
  268.                 # cd /
  269.                 # zcat net2-shadow-bin.tgz | tar xvvofp -
  270.         
  271.  
  272. 2.2 Putting things in the right place
  273.         With the standard NET-2 distribution, all of the configuration files
  274.         are in /conf/net, with links in /etc. For example, /etc/hosts
  275.         is a link to /conf/net/hosts. However, if you are using a 
  276.         standard pre-packaged distribution of Linux such as SLS, /conf/net
  277.         probably isn't used... that is, /etc/hosts is just /etc/hosts.
  278.         So, when I say "/conf/net/hosts", I mean "/etc/hosts", and vice
  279.         versa.
  280.  
  281.         Just keep in mind that the TCP/IP software only looks in /etc and
  282.         /usr/etc for configuration files. Therefore, it makes sense to
  283.         keep all of your files in /etc and /usr/etc as they should be.
  284.         HOWEVER, Fred has decided to put the files in /conf/net with LINKS
  285.         in /etc. Either way, it doesn't matter. When we say "/etc/hosts",
  286.         it doesn't matter if /etc/hosts is an actual file or a link to
  287.         /conf/net/hosts.
  288.  
  289.  
  290.         If you just unpacked NET-2 above (i.e. you don't already have the
  291.         files from installing SLS), then you don't have the configuration
  292.         files in /conf/net (you only have the symlinks in /etc). 
  293.         The easiest way to get the configuration files in /conf/net is
  294.         to copy them from the net-010 distribution:
  295.                 # mkdir -p /conf/net
  296.                 # chown -R root.root /conf; chmod -R 755 /conf
  297.                 # cp /usr/src/net-010/etc/* /conf/net
  298.  
  299.         You should make sure that all of the symlinks to /conf/net in /etc
  300.         can be resolved (that is, try to "more" or "cat" each file, make
  301.         sure you don't get any errors). Also note that some files will
  302.         be duplicated: for example, /etc/inetd.conf is a symlink to 
  303.         /usr/etc/inetd.conf. However, from the cp command above you also
  304.         have a /conf/net/inetd.conf, which can be deleted (remember that
  305.         all of the programs still look in /etc, not /conf. So whatever is
  306.         in /etc is the file which is actually being used).
  307.  
  308.  
  309. 2.3 Creating the device interfaces
  310.         You'll need to create several device special files in /dev for
  311.         use by NET-2. These are all created (as root) with the "mknod"
  312.         command. This command is given 4 arguments: the name of the
  313.         device interface (i.e. "/dev/net"), the type of device ("c" for
  314.         character, "b" for block, etc.), and the major and minor numbers
  315.         of the device driver (specified in the kernel).
  316.  
  317.         For example, to create the device /dev/net, major 16, minor 0, use
  318.         the command
  319.                 # mknod /dev/net c 16 0
  320.  
  321.         NET-2 requires you to create several device driver interfaces in 
  322.         /dev if you do not already have them. The commands below will
  323.         create these devices. You may not need all of them, but it can't
  324.         hurt to create them anyway.
  325.  
  326.                 # mknod /dev/net  c 16 0
  327.                 # mknod /dev/arp  c 16 1
  328.  
  329.                 # mknod /dev/unix c 17 0
  330.  
  331.                 # mknod /dev/inet c 18 0
  332.                 # mknod /dev/ip   c 18 1
  333.                 # mknod /dev/icmp c 18 2
  334.                 # mknod /dev/tcp  c 18 3
  335.                 # mknod /dev/udp  c 18 4
  336.  
  337.                 # mknod /dev/wd0  c 20 0
  338.                 # mknod /dev/wd1  c 20 1
  339.                 # mknod /dev/wd2  c 20 2
  340.                 # mknod /dev/wd3  c 20 3
  341.  
  342.                 # mknod /dev/ec0  c 20 8
  343.                 # mknod /dev/ec1  c 20 9
  344.                 # mknod /dev/ec2  c 20 10
  345.                 # mknod /dev/ec3  c 20 11
  346.  
  347.                 # mknod /dev/ne0  c 20 16
  348.                 # mknod /dev/ne1  c 20 17
  349.                 # mknod /dev/ne2  c 20 18
  350.                 # mknod /dev/ne3  c 20 19
  351.  
  352.  
  353. 3. Building the Kernel
  354.         You're now ready to build the new 0.99.pl10 kernel with the NET-2
  355.         code enabled. 
  356.  
  357. 3.1 Configuring the NET-2 kernel code
  358.         First, you need to read and modify the file
  359.                 /usr/src/linux/net/inet/CONFIG
  360.         which specifies the drivers used by the NET-2 code in the kernel.
  361.         Also see the various README files in /usr/src/linux/net/inet which
  362.         explain the format of these files.
  363.  
  364.         One important line is the "CARDS=" definition, where you define
  365.         the drivers to compile into the kernel. For example, if you're
  366.         using the WD8003/WD8013 driver and the 3c503 driver, you'd set
  367.         the CARDS line to
  368.                 CARDS = -DWD80x3 -DEL2
  369.         For SLIP, you'd set it to
  370.                 CARDS = -DSLIP
  371.  
  372.         You can also combine use of SLIP with some ethernet cards. With
  373.         creative use of routing, you could route packets between two networks
  374.         with a SLIP connection and an Ethernet card, or two Ethernet cards,
  375.         etc. Eventually this NET-2 HOWTO will go into more detail about that.
  376.  
  377.         You also need to set the "OPTS" and "WD_OPTS" lines to the
  378.         appropriate values. WD and SMC cards need to set EI8390 to your
  379.         base address (ex. -DEI8390=0x280) and EI8390_IRQ to your card's
  380.         IRQ (ex. -DEI8390_IRQ=15). One of the most common problems when using
  381.         network cards is an IRQ conflict. The IRQ and base address are
  382.         generally modifyable by jumpers on your card. Make sure that you're
  383.         not using an IRQ used by any other card in your machine.
  384.  
  385.         Furthermore for WD and SMC cards you need to set WD_SHMEM to the
  386.         shared memory address. This is all very self-explanatory when you
  387.         look at the CONFIG file.
  388.  
  389.         For all other cards, you can set EI8390 and EI8390_IRQ to 0, which
  390.         tells the driver to autoprobe for the IRQ and base address. If 
  391.         this doesn't seem to work for you try defining them directly.
  392.  
  393.         See the file CONFIG for a list of the other available options for
  394.         SLIP and other drivers. I don't want to go into too much detail 
  395.         here since this tends to change from release to release. If you have
  396.         questions you can mail me (mdw@sunsite.unc.edu).
  397.  
  398.         The Ethernet HOWTO also contains much useful information for
  399.         configuring Ethernet devices in the kernel.
  400.  
  401. 3.2 Building the kernel
  402.         After the /usr/src/linux/net/inet/CONFIG file is set up correctly,
  403.         you can build the kernel as you normally would (see the file
  404.         /usr/src/linux/README if you've never done this before). Essentially
  405.         this entails editing /usr/src/linux/Makefile to set root device and
  406.         default display mode. (*Note: keyboard is now handled by loadable
  407.         keymaps as of 0.99.pl10; grab the file keytable.tar.z from your 
  408.         nearest Linux ftp site). 
  409.  
  410.         Next run make config. Make sure you answer "yes" to all three of
  411.         "TCP/IP Networking?", "NFS Support?" and "/proc filesystem support?".
  412.  
  413.         Finally do 'make dep' and 'make'. You now have a new 0.99.10 kernel 
  414.         with NET-2 set up. I wouldn't reboot it quite yet as we still have
  415.         to configure the NET-2 programs before it will work correctly.
  416.  
  417. 4. Configuring NET-2 TCP/IP
  418.         The final step is to modify the various setup files to get NET-2
  419.         working. After this is ready you can boot your new kernel and 
  420.         go happily netting (if all goes well).
  421.  
  422.         NOTE TO SLS USERS: You MUST configure all of the files below BY HAND 
  423.         in order to report bugs or problems to me. DO NOT use the SLS
  424.         "syssetup" program if you want to be able to ask me (or anyone else)
  425.         for help with configuring NET-2. If you simply tell me that you ran 
  426.         syssetup, and then things don't work, you're on your own. Instead of 
  427.         running syssetup you should do the configuration by following the 
  428.         instructions below.
  429.  
  430.         In this section I'll describe each of the major TCP/IP setup files,
  431.         what they do, and what you need to do to configure them. 
  432.  
  433.         If you're using SLIP, see section 5.0 on configuring SLIP. The
  434.         discussion below is for Ethernet connections only. SLIP users
  435.         should FIRST read all of section 4.0 and then apply the changes
  436.         discussed in section 5.0.
  437.  
  438. 4.1 Before you begin
  439.         Before you can configure NET-2 TCP/IP, you need to find out
  440.         the following information about your network setup. Your network
  441.         admins can tell you most of these things.
  442.         
  443.         * IP address: this is the unique machine address in dotted-decimal
  444.           format. An example is 128.253.153.54. Your network admins will 
  445.           provide you with this number. 
  446.           
  447.           If you're only configuring loopback mode (i.e. no SLIP, no ethernet 
  448.           card, just TCP/IP connections to your own machine---called 
  449.           "loopback") then your IP address is 127.0.0.1.
  450.  
  451.         * Your network mask ('netmask'). Again, your network admins will
  452.           supply this. Most networks are class C subnetworks which use
  453.           255.255.255.0 as their netmask. Other Class B networks use
  454.           255.255.0.0. If one of these doesn't work, try the other. If this
  455.           doesn't work, ask your local net guru for help.
  456.  
  457.           If you're only using loopback, you don't have a netmask.
  458.  
  459.         * Your network address. This is your IP address masked with th
  460.  netmask.
  461.           For example, if your netmask is 255.255.255.0, and your IP address
  462.           is 128.253.154.32, your network number (IP addr AND netmask) is 
  463.           128.253.154.0. With a netmask of 255.255.0.0, 
  464.           this would be 128.253.0.0. 
  465.  
  466.           If you're only using loopback, you don't have a net address.
  467.  
  468.         * Your broadcast address. This is your IP address masked with the
  469.           netmask, and then possibly ANDed with 0.0.255.255 or 0.0.0.255
  470.           (depending on your network setup). For example, if your IP address 
  471.           is 128.253.154.32, netmask 255.255.255.0, then your broadcast
  472.           address is probably either 128.253.154.0 (same as network address,
  473.           above) or 128.253.154.255. Your net admins will be able to tell
  474.           you if you need to use a broadcast address or not, and which one
  475.           to use.
  476.  
  477.           If you're only using loopback, you don't have a broadcast address.
  478.  
  479.         * Your gateway address. This is the address of the machine which
  480.           is your "gateway" to the outside world (i.e. machines not on your
  481.           subnet). In general the gateway machine has an IP address identical
  482.           to yours but with a ".1" in the last position; e.g. if your IP
  483.           address is 128.253.154.32, your gateway might be 128.253.154.1.
  484.           Your network admins will provide you with the IP address of your
  485.           gateway.
  486.  
  487.           If you're only using loopback, you don't have a gateway address.
  488.         
  489.         * Your nameserver address. Most machines on the net have a name
  490.           server which translates hostnames into IP addresses for them. 
  491.           Your network admins will tell you the address of your name server.
  492.           You can in fact run a nameserver on your own machine by running
  493.           named, in which case the nameserver address is 127.0.0.1. However,
  494.           But it is not required that you run named at all; see section
  495.           4.2.2.1.
  496.  
  497.           If you're only using loopback, you don't have a nameserver
  498.           address. (After all, you're only connecting to yourself.)
  499.         
  500.  
  501.         NET-2 supports full routing, with proxy ARP, multiple routes, 
  502.         subnetworking, the whole nine yards. The above describes most basic 
  503.         TCP/IP configurations. Yours may be quite differnent: when in doubt, 
  504.         consult your local network gurus and check out the man pages for 
  505.         "route" and "ifconfig" included with the net-010 package. Configuring 
  506.         TCP/IP networks is very much beyond the scope of this document; the 
  507.         above should be enough to get most people started.
  508.  
  509.  
  510. 4.2 /etc/rc.d/rc.inet1 and /etc/rc.d/rc.inet2
  511.         For the non-UNIX wizard: "rc" files are run at bootup time by the
  512.         "init" program and start up all of the basic system programs, such
  513.         as sendmail, cron, etc. as well as the NET-2 daemons (such as inetd).
  514.         For NET-2 the rc files are found in /etc/rc.d. It doesn't really
  515.         matter where you keep them, as long as init can find them. (We'll
  516.         go into this later). 
  517.  
  518.         First things first. The file /etc/rc.d/rc.inet1 configures the basic
  519.         TCP/IP interface to your machine, using two programs: /etc/ifconfig
  520.         and /etc/route. These two programs tell the kernel how to route and
  521.         manage TCP/IP connections to your system, by setting things such as
  522.         the IP address, network mask, and so on.
  523.  
  524.         Note that in the previous NET-1 code, the "config" program was
  525.         used. However, the "standard" for UNIX system TCP/IP configuration
  526.         is to use ifconfig and route, and this has been implemented with NET-2
  527.         
  528.         THEREFORE: Get rid of your old "rc.net" if you have one. You
  529.         should only run rc.inet1 and rc.inet2 at boot time. If you run your ol
  530.         "rc.net" instead, you'll get error messages about "old-style ioctl"
  531.         and things probably won't work at all.
  532.  
  533.         NOTE: SLS uses "rc.net" instead of "rc.inet1" and "rc.inet2". Just
  534.         make sure that your "rc.net" uses "ifconfig" and "route" instead
  535.         of the old "config" program. In other words, be sure that your
  536.         rc.net is a new, NET-2 style rc.net. If it is not, get rid of it
  537.         and replace it with rc.inet1 and rc.inet2, as described below.
  538.         If you run SLS, the file "rc.net" contains the code for both rc.inet1 
  539.         and rc.inet2.
  540.  
  541.         Below you're going to edit rc.inet1 to use the correct ifconfig and
  542.         route commands for your machine. But first, you need to know the
  543.         information about your network setup in section 4.1, above.
  544.  
  545. 4.2.1 Editing rc.inet1
  546.         Edit the file /etc/rc.inet1. This file uses the "ifconfig" and
  547.         "route" commands to configure your network interface at boot time.
  548.         Remember that SLS uses just rc.net.
  549.  
  550.         You may need to do some heavy surgery on this file to get it to look
  551.         right; it may be easier to delete it and start from scratch. Given
  552.         the information above, a possible rc.inet1 should look like:
  553.  
  554. #!/bin/sh
  555. # rc.inet1: configure the network interface
  556.  
  557. HOSTNAME=`hostname`
  558.  
  559. # Attach the loopback device. 
  560. /etc/ifconfig lo 127.0.0.1  
  561. /etc/route add 127.0.0.1
  562.  
  563. # IF YOU HAVE AN ETHERNET CONNECTION, use these lines below to configure the 
  564. # eth0 interface. If you're only using loopback or SLIP, don't include the
  565. # rest of the lines in this file.
  566.  
  567. # Edit for your setup.
  568. IPADDR="128.253.154.32"  # REPLACE with YOUR IP address!
  569. NETMASK="255.255.255.0"  # REPLACE with YOUR netmask!
  570. NETWORK="128.253.154.0"  # REPLACE with YOUR network address!
  571. BROADCAST="128.253.154.255"  # REPLACE with YOUR broadcast address, if you
  572.                              # have one. If not, leave blank and edit below.
  573. GATEWAY="128.253.154.1"  # REPLACE with YOUR gateway address!
  574.  
  575. /etc/ifconfig eth0 ${IPADDR} netmask ${NETMASK} broadcast ${BROADCAST}
  576. # If you don't have a broadcast address, change the above line to just:
  577. # /etc/ifconfig eth0 ${IPADDR} netmask ${NETMASK} 
  578.  
  579. /etc/route add ${IPADDR}
  580. /etc/route add ${NETWORK}
  581. /etc/route add default gw ${GATEWAY} metric 1
  582.  
  583. # End of rc.inet1
  584.  
  585.  
  586.         This is a basic rc.inet1 to run the ifconfig and route commands
  587.         needed to set up a basic TCP/IP connection. Edit this for your setup.
  588.         To ensure that this will be run at boot time, make sure that you
  589.         include the command
  590.                 /bin/sh /etc/rc.d/rc.inet1
  591.         in your /etc/rc, or in your /etc/inittab (if you're running the
  592.         sysvinit package). In general, make sure that rc.inet1 is run
  593.         BEFORE rc.inet2 at boot time. You may wish to run rc.inet1 and
  594.         rc.inet2 from /etc/rc or /etc/rc.local. Or you can run them from
  595.         /etc/inittab. Either way is fine, but don't run one without the other.
  596.  
  597.  
  598. 4.2.2 Editing rc.inet2
  599.         The rc.inet2 script is also run at boot time, AFTER rc.inet1.
  600.         It starts up various TCP/IP daemons such as inetd, portmapper, 
  601.         and so on. Remember that SLS uses just rc.net.
  602.  
  603.         You will probably want to comment out most of this file, especially
  604.         if you're not planning on using NFS (Network File System). You 
  605.         MUST leave the stanza to run inetd and syslogd uncommented. Note
  606.         that if you DON'T uncomment everything but inetd and syslogd, 
  607.         you may run into network problems at first. The best bet is to 
  608.         comment all of these things out, get yourself on the network, and
  609.         then worry about configuring the rest of the clients in rc.inet2.
  610.  
  611.         If you're not going to be using NFS, you can comment out the lines
  612.         to run: rpc.portmap, ugidd, mountd, routed, nfsd, pcnfsd, and bwnfsd.
  613.         You can comment out the stanza to run "umail" unless you have that 
  614.         package. In general, most of the things found in rc.inet2 are "sold 
  615.         separately". I would only start up inetd and syslog at first until you
  616.         get everything going.
  617.  
  618. 4.2.2.1 "To named or not to named... that is the question."
  619.         Named is the nameserver daemon that runs under TCP/IP. It allows
  620.         your machine to serve the name lookup requests of other machines...
  621.         that is, if a machine wants to find the IP address for 
  622.         "goober.norelco.com", and you have this machine's IP address in your
  623.         named database, then you can service the request and tell other
  624.         machines what goober's address is. 
  625.  
  626.         Under older implementations of Linux TCP/IP, to create aliases for
  627.         machine names (even for your own machine), you were required to run 
  628.         named on your Linux box to store name->IP address translations. The
  629.         problem with this is that named is generally difficult to setup and
  630.         maintain. To solve this problem, a program called "hostcvt.build"
  631.         was made available on Linux systems to translate your /etc/hosts file
  632.         (see section 4.3) into named database files. However, even with
  633.         this problem out of the way, running named on your system will cause
  634.         some amount of CPU load and network traffic. 
  635.  
  636.         The bottom line is this: You DO NOT need to run named on your 
  637.         Linux system. The SLS instructions will probably tell you to run
  638.         hostcvt.build to set up named. This is simply unnecessary, UNLESS
  639.         you want to make your Linux system a nameserver for some reason.
  640.         Now, instead of putting hostnames into the named database, you can
  641.         simply include them in the file /etc/hosts (section 4.3). When
  642.         looking up names, your Linux system will first look in /etc/hosts
  643.         and then ask the nameserver out on the net (if you have one).
  644.  
  645.         The only reason you may want to run named would be if:
  646.           a) You're setting up a network of machines, and need a nameserver
  647.              for one of them (and don't have a nameserver out on the net
  648.              elsewhere);
  649.           b) Your network admins want you to run your Linux system as a
  650.              nameserver for some reason; or,
  651.           c) You have a slow SLIP connection, and want to run a small
  652.              cache-only nameserver on your Linux machine so that you don't
  653.              have to go out on the phone line every time a name lookup
  654.              occurs. (If you are only going to lookup a small number of
  655.              machine names, and you know what they are, you can put their 
  656.              addresses in /etc/hosts instead.) Generally name lookup isn't
  657.              that slow, and should work fine over most SLIP connections.
  658.           d) You want to run a nameserver for fun and excitement.
  659.  
  660.         In general, you DO NOT need to run named: this means that you
  661.         can comment it out from rc.inet2, and you don't have to run
  662.         hostcvt.build. If you want to alias machines, for example you want
  663.         to refer to "loomer.vpizza.com" just as "loomer", you can add an
  664.         alias in /etc/hosts instead. There is no reason to run named unless
  665.         you truly want a full nameserver on your machine. If you already
  666.         have a nameserver (most machines on the Internet do, and your net
  667.         admins will tell you its address), don't bother running named.
  668.  
  669.         If you're only using loopback, you can run named and set your
  670.         nameserver address to 127.0.0.1, but that's pointless. (No pun
  671.         intended.) You don't need a nameserver at all if you use only
  672.         loopback; the only hostname you know is your own, and it's in
  673.         /etc/hosts (see section 4.3, below).
  674.  
  675. 4.3 /etc/hosts
  676.         /etc/hosts contains a list of IP addresses and the hostnames they 
  677.         map to. In this way, you can refer to other machines on the network
  678.         by name, as well as by IP address. Using a nameserver (see section 4.1
  679.         also allows you to do the name->IP address translation automatically.
  680.         (Running named allows you to run your own nameserver on your Linux
  681.         box. See section 4.2.2.1 above.)
  682.  
  683.         This file needs to contain at least an entry for 127.0.0.1 with 
  684.         the name "localhost". If you're not only using loopback, you need
  685.         to contain an antry for your IP address, with your full hostname
  686.         (such as loomer.vpizza.com).  You may also wish to include entries 
  687.         for your gateway and network addresses. 
  688.  
  689.         For example, if "loomer.vpizza.com" has the IP address 
  690.         "128.253.154.32", my /etc/hosts file would look like:
  691.  
  692. # /etc/hosts: List of hostnames and IP addresses
  693. 127.0.0.1               localhost
  694. 128.253.154.32          loomer.vpizza.com loomer
  695.  
  696.         Once again, edit this for your own needs. If you're only using 
  697.         loopback, the only line in /etc/hosts should be for 127.0.0.1, with
  698.         both "localhost" and your hostname after it.
  699.         
  700.         Note that in the second line, above, there are two names for 
  701.         128.253.154.32: "loomer.vpizza.com" and just "loomer". The first name 
  702.         is the full hostname of the machine. The second is an alias---it 
  703.         allows me to just use "rlogin loomer" without having to type in the 
  704.         entire name.
  705.  
  706. 4.3.1 Important note
  707.         The line "%%IP%%        %%HOST%% %%ALIAS%%" needs to be deleted from 
  708.         this file! This is a "tag" line used by Fred's experimental net
  709.         config scripts. I'm now writing a new set of scripts which don't
  710.         use these lines. In any of these files, you see curious lines with
  711.         entries such as "%%NAME%%", these lines MUST be deleted. If you
  712.         don't delete them, you may have lots of strange errors and overflowing
  713.         syslog files (right Erik?).
  714.  
  715. 4.4 /etc/networks
  716.         The file /etc/networks contains known network addresses, much like
  717.         /etc/hosts contains known IP addresses. In general you only need 
  718.         network addresses for loopback and your own local network (your
  719.         network address). For example, my network address is 128.253.154.0,
  720.         thus my /etc/networks looks like:
  721.  
  722. loopback        127.0.0.0 
  723. localnet        128.253.154.0
  724.  
  725.         You don't need a localnet line if you're only using loopback.
  726.         
  727. 4.5 /etc/host.conf
  728.         This file specifies how your system will lookup names. 
  729.         It should contain the two lines:
  730.                 order hosts,bind
  731.                 multi
  732.  
  733.         These two lines tell the resolve libraries to first check the 
  734.         /etc/hosts file for any names to lookup, and then ask the nameserver
  735.         (if one is present). The "multi" entry allows you to have multiple
  736.         IP addresses for a given machine name in /etc/hosts.
  737.  
  738.         This file comes from the implementation of the resolv+ bind 
  739.         library for Linux. You can find further documentation in the
  740.         resolv+(8) man page (if you have the man page available).
  741.  
  742.  
  743. 4.6 /etc/resolv.conf
  744.         This file contains two types of entires: The addresses of your
  745.         nameservers (if any), and the name of your domain (if you have one).
  746.         If you're running your own nameserver (i.e., you're running named
  747.         on your Linux machine: see section 4.2.2.1), then the address of
  748.         your nameserver is just 127.0.0.1 (the loopback address).
  749.  
  750.         Your domain name is your fully-qualified hostname (if you're a
  751.         registered machine on the Internet, for example), with the hostname
  752.         chopped off. That is, if your full hostname is loomer.vpizza.com,
  753.         your domain name is just "vpizza.com", without the hostname ("loomer")
  754.  
  755.         For example, if your machine is goober.norelco.com, and has a
  756.         nameserver at the address 128.253.154.5, your /etc/resolv.conf would 
  757.         look like:
  758.  
  759.                 domain norelco.com
  760.                 nameserver 127.253.154.5
  761.  
  762.         You can specify more than one nameserver (up to three?). Each one
  763.         must have a "nameserver" line of its own in resolv.conf.
  764.  
  765.         If you're only using loopback, you don't have a nameserver.
  766.  
  767. 4.7 /etc/HOSTNAME
  768.         This is a new file; it contains the full hostname of your machine 
  769.         (with the domain name). For example, the machine above would have 
  770.         the file /etc/HOSTNAME:
  771.                 goober.norelco.com
  772.         That's all.
  773.  
  774. 4.8 /etc/rc.local
  775.         Change the line in /etc/rc.local (or /etc/rc, depending on your
  776.         setup) which sets your system's hostname, to 
  777.                 /bin/hostname -S
  778.  
  779.         (You have a new hostname in /bin.) This sets your hostname from
  780.         the name found in /etc/HOSTNAME. If you don't like this (personally
  781.         I don't), just do:
  782.                 /bin/hostname -S <your-hostname>
  783.  
  784.         For example,
  785.                 /bin/hostname -S loomer.vpizza.com
  786.  
  787.         It IS important that you give a full hostname (with domain name)
  788.         in /etc/HOSTNAME. This allows the hostname command to set the
  789.         host AND domainname in one shot. 
  790.  
  791.         IMPORTANT: The hostname found in /etc/HOSTNAME *must* be a valid
  792.         hostname. This means that it must be found in /etc/hosts (or that
  793.         your nameserver must be able to resolve it, but you should put it
  794.         in /etc/hosts in case your nameserver is down).
  795.  
  796. 4.9 Other files
  797.         There are of course many other files in /etc which you may need to
  798.         dabble with later on. Instead of going into them here, I'm going to
  799.         provide the bare minimum to get you on the net. More information will
  800.         be provided in later versions of the NET-2 HOWTO.
  801.  
  802.         Once you have all of the files set up, and everything in the 
  803.         right place, you should be able to reboot your new kernel and
  804.         net away to your heart's content. However, I strongly suggest
  805.         that you keep a bootable copy of your old kernel and even possibly
  806.         a "recovery disk" (say, the SLS a1 disk) in case you hosed your
  807.         /etc/rc files, for example, and can't login when you boot. 
  808.  
  809.  
  810. 5. Configuring SLIP
  811.         SLIP (Serial Line Internet Protocol) allows you to use TCP/IP 
  812.         over the phone line, with a modem (no need for an Ethernet card).
  813.         Of course, to use SLIP you'll need access to a dial-in SLIP server
  814.         in your area. Many universities and businesses provide SLIP access
  815.         all over the world. 
  816.  
  817.         Configuring SLIP is much like configuring an Ethernet interface
  818.         (please read section 4.0 above). However, there are a few key
  819.         differences. 
  820.  
  821.         First of all, dialing in and connecting to your SLIP server is 
  822.         usually done at boot time, usually by a program called "dip" 
  823.         (found in the "dip" subdir of the net-010 package). "Dip" not only 
  824.         dials and logs you into the SLIP server, but it also initiates the 
  825.         SLIP connection and runs the appropriate ifconfig and route commands 
  826.         to initialize the device. Therefore, the only lines needed in 
  827.         /etc/rc.d/rc.inet1 are the two commands to initilize the loopback 
  828.         connection at the top (see section 4.2.1 above).
  829.  
  830.         If you're not using DIP, you may indeed have to edit rc.inet1 for
  831.         your SLIP parameters.
  832.  
  833.         Also, there are two types of SLIP servers: Dynamic IP address
  834.         servers and static IP address servers. Dynamic servers allocate
  835.         a new, different IP address to you every time you dialin and
  836.         initiate a connection. Static servers give you the same address
  837.         every time. Almost every SLIP server will also prompt you for
  838.         a username and password when dialing in: DIP can handle logging
  839.         you in automatically.
  840.  
  841.         Essentially, configuring a SLIP connection is just like configuring
  842.         for loopback or ethernet. The main differences are discussed below.
  843.         Read section 4.0 above for information on configuring your TCP/IP
  844.         files, and apply the changes below.
  845.  
  846. 5.1 Static SLIP server connections
  847.         If you have a static-allocation server (same IP address every time),
  848.         then you may want to put entries for your hostname and IP address
  849.         (since you know what your IP address is!) in /etc/hosts. You should
  850.         also configure the other files listed in section 4.0: rc.inet2, 
  851.         host.conf, resolv.conf, /etc/HOSTNAME, and rc.local). Remember that
  852.         when configuring rc.inet1, you don't need to run the ifconfig and
  853.         route commands other than the two for the loopback interface (if
  854.         you're using DIP to dial your connection).
  855.  
  856.         In general, your gateway is the IP address of your SLIP server.
  857.         Because DIP handles the configuration of the route, you probably
  858.         don't need to know this, but in some cases you might have to run the
  859.         appropriate ifconfig or route commands in /etc/rc.d/rc.inet1 to
  860.         get it to work correctly. Instead of using "eth0" as your interface 
  861.         name, SLIP connections use "sl0".  Keep in mind that you can't
  862.         ifconfig sl0 until you have dialed the connection and connected to
  863.         the SLIP server.
  864.  
  865.         Also, you may need to use the "pointopoint" argument to ifconfig if
  866.         DIP does not do it correctly. For example, if your SLIP server's 
  867.         address is 44.136.8.5, and your IP address is 128.253.154.32, you may 
  868.         need to run the command 
  869.                 # /etc/ifconfig sl0 128.253.154.32 pointopoint 44.136.8.5
  870.  
  871.         See the man pages for ifconfig in the net-010 package.
  872.  
  873. 5.2 Dynamic SLIP server connections
  874.         If your SLIP server allocates a new IP address to you every time
  875.         you dialin, you don't know your IP address at all, so you can't
  876.         include an entry in /etc/hosts for your machine. (If you want, you 
  877.         can place your hostname in /etc/hosts with the address 127.0.0.1). 
  878.  
  879.         Most dynamic SLIP servers tell you your IP address when you initiate 
  880.         the connection. For example, it may print a string such as, "Your IP 
  881.         address is 128.253.154.10. Server address is 128.253.154.1." DIP will 
  882.         need to know these numbers when it configures the connection. See 
  883.         section 5.3 below on using DIP.
  884.  
  885.         If you use DIP, it does all of the work of configuring the 
  886.         connection when you dialin, so rc.inet1 only needs the two lines
  887.         to configure the loopback address (see section 4.2.1 above). 
  888.         Also, see section 5.1 above. You need to configure all of
  889.         the files listed in section 4.0. Your gateway address (should you
  890.         need to know it) will be the address of the SLIP server. Also,
  891.         you may need to run ifconfig on sl0 using the SLIP server's address
  892.         as the "pointopoint" argument (see section 5.1 above). However, if 
  893.         you use DIP, it should be able to do all of the ifconfig and route 
  894.         commands for you.
  895.  
  896.         One good way to figure out how to configure SLIP on your machine is
  897.         to find someone else who uses the SLIP server (it can be on a PC,
  898.         Mac, UNIX box, whatever) and find out what numbers they use. 
  899.  
  900.  
  901. 5.3 Using DIP
  902.         DIP can simplify the process of dialing into the SLIP server, logging
  903.         in, starting the connection, and configuring the sl0 device with
  904.         the appropriate ifconfig and route commands. 
  905.  
  906.         Essentially, to use DIP you'll write a "chat script" which is 
  907.         basically a list of commands to send to DIP along with commands for
  908.         logging in, starting the connection, and so on. See "sample.dip"
  909.         in the net-010 package for an explanation. DIP is quite a powerful
  910.         program, with many options. Instead of going into all of them here
  911.         you should look at the READMEs and the sample files from tsx-11 and
  912.         the net-010 distribution.
  913.  
  914.         You may notice that the sample.dip script assumes that you're using
  915.         a static SLIP server, so you know what your IP address is beforehand.
  916.         For dynamic SLIP servers, you'll probably need to use the command 
  917.         "dip -t" and use the DIP "local" and "remote" commands by hand after
  918.         the SLIP server prints your IP address. For example,
  919.  
  920. loomer:~% dip -t
  921. DIP>port cua0      (My modem is on /dev/cua0.)
  922. DIP>speed 57600    (Set the baud rate.)
  923. DIP>reset          (Reset modem and terminal line.)
  924. DIP>send att\r\n   (Send modem init string...)
  925. DIP>dial 2446000   (Dial SLIP server.)
  926. DIP>term           (Enter interactive mode.)
  927.  
  928. Welcome to Annex Server...
  929. Annex login: mdw1
  930. Annex password: 
  931.  
  932. User mdw1 authenticated.
  933. Annex> slip       (From SLIP server prompt, give "slip" command to start 
  934.                    SLIP connection.)
  935.  
  936. SLIP inititated. 
  937. Your IP address is 128.254.254.10, server address is 128.254.254.1.
  938.  
  939. ^] (Hit DIP break key to get back to DIP prompt.)
  940. DIP> local 128.254.254.10  (Give local command to specify my IP address.)
  941. DIP> remote 128.254.254.1  (Specify server's IP address.)
  942. DIP> mtu 1500              (Set SLIP MTU value.)
  943. DIP> mode SLIP             (Start the SLIP mode from DIP.)
  944.  
  945. loomer:~%
  946.  
  947.         Now we're running in SLIP mode, and everything should work. The comman
  948.                 # /etc/ifconfig sl0
  949.         will tell you the current interface parameters; you may need to set 
  950.         some of these by hand if DIP didn't get the correctly. Also, some have
  951.         found that they need to use the route command to change their operatin
  952.         parameters. DIP sets a route for the address of your SLIP server, but 
  953.         you may need to delete this route and add it as your gateway instead. 
  954.         For example, with a SLIP server address of 128.253.154.1, use the 
  955.         commands:
  956.                 # /etc/route del 128.253.154.1
  957.                 # /etc/route add default gw 128.253.154.1 
  958.  
  959.         It should be simple to modify the code for DIP in the file attach.c
  960.         to run the route and ifconfig commands that work for you automatically
  961.  
  962.         Of course, typing all of those DIP commands may be time consuming. It 
  963.         may be possible to write a DIP chat script to run all of the commands 
  964.         up through dialing the connection and logging in, and then "exit" the 
  965.         script to let you type the "local" and "remote" commands by hand.
  966.  
  967.         Furthermore, there are patches for DIP by Paul Mossip 
  968.         (mossip@vizlab.rutgers.edu) which modify the "get" command to grab
  969.         the IP address of your host and the server from the output of 
  970.         the SLIP server. This should allow you to do all of the dialing and
  971.         configuration within a chat script just as you would with static
  972.         SLIP servers. This patch was recently posted to comp.os.linux.announce
  973.         (Check the c.o.l.a archives on sunsite.unc.edu.)
  974.  
  975.         Fred is planning to modify DIP for easier use by those with dynamic
  976.         SLIP servers (including the above patch) soon. 
  977.  
  978.         You'll have to play with various values for your routes and gateways 
  979.         to get everything going correctly. If you have any information on how 
  980.         you configured your SLIP interface, please drop me a note 
  981.         (mdw@sunsite.unc.edu). Include info on your SLIP address, server 
  982.         address, gateway, and so on, and what commands you used to set up 
  983.         SLIP. There are various possible configurations for SLIP servers and 
  984.         I'd like to update this NET-2 HOWTO with as many hints as possible. :)
  985.  
  986. 6. Are You Stuck?
  987.         Really? Then you should read the man pages for ifconfig and route, 
  988.         included in the net-010 package, and understand their functions. These
  989.         commands have a lot of flexibility, and because everyone's network 
  990.         setup is different, you may find a way to use ifconfig and route to
  991.         get your connection working. If you do, feel free to send me some mail
  992.         so I can include it in the next update of the NET-2 HOWTO. Because of
  993.         my limited amount of experimental data, most of the discussion above
  994.         is about my own setup, and I'd like to generalize it as much as 
  995.         possible.
  996.  
  997.         I'm currently writing a set of scripts to simplify NET-2 configuration
  998.         You can pick up the pre-alpha release from tc.cornell.edu, in the file
  999.         /pub/mdw/netconf-0.3.tar.z. These scripts maintain a small database of
  1000.         network configuration info, and allow you to easily modify and 
  1001.         configure your network interface. The scripts are far from complete:
  1002.         I've been waiting until the NET-2 interface itself stabilizes a bit
  1003.         more before upgrading it further. 
  1004.  
  1005.         Another good place to look for help on setting up NET-2 is the 
  1006.         O'Reilly and Associated book ``TCP/IP Network Administration''...
  1007.         the one with the crab on the cover. Keep in mind that NET-2 is now
  1008.         a "standard" implementation of TCP/IP---this means that ifconfig
  1009.         and route work the same under Linux as they do on other UNIX systems.
  1010.  
  1011.         Also keep in mind that NET-2 _is_ developing very rapidly---it's
  1012.         one of the newest additions to the Linux kernel. Thus, all of the
  1013.         bugs haven't been worked out yet, so there may be some problems.
  1014.         However, a good rule of thumb is that if you were able to get TCP/IP
  1015.         working under kernels before 0.99.pl10, you should be able to get it
  1016.         working under NET-2 as well. There are still some issues dealing with
  1017.         performance to be fixed, but overall the system works. And, as with
  1018.         everything in Linux development, time will cure what ails NET-2. 
  1019.         If it's absolutely unusable to you, go back to an earlier kernel 
  1020.         version, and wait until things develop further. The code is still
  1021.         very new.
  1022.  
  1023. 7. Common Problems and Solutions
  1024.         Now that the NET-2 HOWTO has been out for a while, I've been
  1025.         able to gather some common problems (and answers!). Here are
  1026.         some things which I have learned from hearing from readers.
  1027.         If you run into a problem which should be included here,
  1028.         please send it along (even if you have the solution!). I can
  1029.         only go by reader feedback, because NET-2 always works perfectly
  1030.         for me. (Just kidding, Fred!)
  1031.  
  1032.         
  1033.         QUESTION: Whan I try to use the network, or use SLIP, I get the
  1034.         error message "Network not reachable". What should I do?
  1035.  
  1036.         ANSWER: Well, this is usually an indication that your ifconfig
  1037.         or route commands are wrong. You can look at the status of your
  1038.         ifconfig by using the command "ifconfig" by itself. This should
  1039.         tell you what NET-2 thinks your IP address, netmask, etc. are.
  1040.         You can use the command "route" by itself to get routing information.
  1041.         This will tell you what routes you have set up and what gateways
  1042.         (if any).
  1043.  
  1044.         The best way to test a SLIP or network connection is to use "ping"
  1045.         with IP addresses only. If you use hostnames, as in "ping loomer",
  1046.         if some part of name lookup isn't working you'll have trouble.
  1047.         To test just the network, NOT name lookup, use only IP addresses,
  1048.         as in "ping 128.253.154.32".
  1049.  
  1050.         For SLIP connections the best thing to do is to ping your
  1051.         SLIP server. If nothing comes back, then something is wrong. Try
  1052.         using "dip -v" which will print debugging information while DIP
  1053.         is dialing the server. Remember that for some SLIP connections you
  1054.         may need to use the commands
  1055.                 # route del <your slip server address>
  1056.                 # route add default gw <your slip server address>
  1057.         To get SLIP talking to the server. Once you can talk to the
  1058.         server, everything SHOULD work (if your server is set up correctly!).
  1059.  
  1060.         For Ethernet connections, try pinging your gateway. If you can talk
  1061.         to your gateway, you should be able to talk to the outside world.
  1062.         You may need more than one route (that is, more than one gateway).
  1063.         For example, some universities use one gateway for on-campus
  1064.         networks and another for off-campus networks. 
  1065.  
  1066.         But this "network not reachable" message means that you can't
  1067.         talk to your gateway. This can be due to several things:
  1068.                 a) Wrong route or ifconfig commands
  1069.                 b) Ethernet card problems (see below)
  1070.                 c) You didn't compile the kernel correctly (see below).
  1071.  
  1072.  
  1073.  
  1074.         QUESTION: I keep getting the error "eth0: transmit timed out".
  1075.         What does this mean?
  1076.  
  1077.         ANSWER: This usually means that your Ethernet cable is unplugged,
  1078.         or that the setup parameters for your card (I/O address, IRQ, etc.)
  1079.         are not set correctly. Check the messages at boot time and make
  1080.         sure that your card is recognized with the correct Ethernet address.
  1081.  
  1082.  
  1083.         QUESTION: I get errors "check Ethernet cable" when using the network.
  1084.  
  1085.         ANSWER: You probably have your Ethernet card configured incorrectly.
  1086.         For Etherlink cards, in the file /usr/src/linux/net/inet/CONFIG,
  1087.         change the line
  1088.                 EL_OPTS         = -UEL2_AUI
  1089.         to
  1090.                 EL_OPTS         = -DEL2_AUI
  1091.  
  1092.         This tells the card to use the AUI cable interface. 
  1093.         Just make sure that all of the options for your card are set
  1094.         correctly in the CONFIG file, and rebuild your kernel.
  1095.  
  1096.  
  1097.         QUESTION: When I use NET-2, I get a "General protection" error
  1098.         or a panic from the kernel. How can I fix this?
  1099.  
  1100.         ANSWER: Remember that the NET-2 code is still on the buggy side, 
  1101.         just because it's in mid-development. If you get a kernel panic
  1102.         while using NET-2, write down the EIP address (and the other
  1103.         information given in the panic message). The EIP is the address
  1104.         where the kernel paniced, usually of the form 0008:xxxxxxxx
  1105.         where "0008" is the segment descriptor for the kernel text, and
  1106.         "xxxxxxxx" is the offset into that segment (80386 programmers will
  1107.         know what this means).
  1108.  
  1109.         Use the command 
  1110.                 nm /usr/src/linux/tools/system | sort -n
  1111.         or 
  1112.                 nm /usr/src/linux/tools/zSystem | sort -n
  1113.         depending on whether or not you use a compressed kernel (zImage).
  1114.         This will print a listing of all symbols in the kernel text, 
  1115.         simply scan down the list and look for the function that contains
  1116.         the EIP address in the kernel dump. There's the culprit.
  1117.  
  1118.         However, in some cases the EIP can be misleading; the kernel
  1119.         may panic at a place which is complete irrelevant to where the
  1120.         actual problem occurred. However, it is a good starting place;
  1121.         first, locate the function which contains the EIP address, and
  1122.         then check out the kernel code to see what might be wrong.
  1123.  
  1124.         Keep in mind that this will only work if you compile your own
  1125.         kernel and have the "system" file associated with it. 
  1126.  
  1127.         
  1128.         QUESTION: How can I hang up the phone line when I'm done using
  1129.         SLIP?
  1130.  
  1131.         ANSWER: If you use dip to dial out on the SLIP line, just
  1132.         "kill -9" the dip process itself (dip won't die unless you kill
  1133.         it with SIGKILL or some other signal). When dip dies, the line
  1134.         should hang up. 
  1135.  
  1136.         If you don't use dip to dial out, either instruct your dialing
  1137.         program to hang up the line, or kill the dialing process.
  1138.  
  1139.  
  1140.         QUESTION: With SLIP, I get a connection open, but no data flows.
  1141.  
  1142.         ANSWER: This could be a number of things. First, check your routes
  1143.         and be sure that the gateway is set correctly. Attempt to ping
  1144.         your gateway; if you can't, then something is wrong with the routes.
  1145.         
  1146.         Another problem could be that your system and the SLIP server 
  1147.         disagree about header compression. With 0.99.pl11 and above, 
  1148.         SLIP automatically compresses packet headers. To turn off header
  1149.         compression, look in slip.c for the function sl_encaps(). Comment
  1150.         out the line that calls sl_compress(). That should be all that's
  1151.         needed.
  1152.  
  1153.  
  1154.         QUESTION: With SLIP, I get a connection, but after sending a small
  1155.         amout of data, the connection hangs.
  1156.  
  1157.         ANSWER: Probably an MTU problem. The MTU is the maximum packet
  1158.         size available for the network. For SLIP, your MTU is set in
  1159.         your dip dialing script with the "MTU" command. The default value
  1160.         is 1500, which means that the system can send packets of up to
  1161.         1500 bytes in size. However, some SLIP servers (Berkeley SLIP,
  1162.         for example), use a smaller MTU (around 1006). If your MTU is
  1163.         too large, the SLIP server will fragment the packets, and currently
  1164.         (NET-2d), IP packet fragmentation isn't supported (see next section).
  1165.         The solution is to set a smaller MTU (around 512, or lower) in
  1166.         your dip chat script. 
  1167.  
  1168.         Another thing to check if you are having erratic SLIP problems is
  1169.         flow control. You need to use hardware (RTS/CTS) flow control
  1170.         on your modem, and your modem and your computer must agree. XON/XOFF
  1171.         flow control is not practical for SLIP.
  1172.  
  1173.  
  1174.  
  1175. 8. Known bugs 
  1176.         There are several known bugs with the NET-2 software. Note that these
  1177.         may or may not be fixed with a newer version of the NET-2 code;
  1178.         therefore, I leave them here. 
  1179.         
  1180.         The bugs here are for NET-2d, found in kernels 0.99.pl10, pl11, 
  1181.         and pl12 (alpha). NET-2e (currently in alpha), when released, may
  1182.         or may not have fixed these bugs. 
  1183.  
  1184.         * Bug with route guessing code. If you ifconfig the "lo"
  1185.           interface before the "eth0" interface in rc.inet1, whenever you
  1186.           add a route, it will be added to "lo" instead of "eth0". 
  1187.           (Simply use the "route" command by itself; it will display all
  1188.           of your routes. If your "default" route, which should be out
  1189.           on the ethernet, is for device "lo" instead of "eth0", then you're
  1190.           seeing this bug.) 
  1191.           
  1192.           This is just a problem with the route guessing code. Several
  1193.           things can fix it: 1) ifconfig/route on "eth0" before "lo" in
  1194.           rc.inet1; or, 2) Set your netmask to 255.0.0.0 (which is reported
  1195.           to work, but I can't guarantee it). This should be fixed in NET-2e.
  1196.  
  1197.         * Missing IP packet fragmentation. Packet fragmentation allows the
  1198.           various protocol layers to "chop up" packets into smaller packets
  1199.           if the MTU (maximum tranfer unit) of one network differs from
  1200.           another. NET-2e should contain packet fragmentation/defragmentation
  1201.           code, but NET-2d currently does not.
  1202.  
  1203.         * Weak NFS support. There have been a number of success stories with
  1204.           NFS under Linux, however, not all of the support is there. For
  1205.           one thing, the current NFS buffer size is much smaller---and 
  1206.           therefore much slower---than other implementations of NFS. From
  1207.           what I understand, this problem is related to the lack of packet
  1208.           fragmentation code, above.
  1209.  
  1210.  
  1211.  
  1212. 9. Miscellaneous
  1213.         I'm sure that I've missed something. This NET-2 HOWTO was thrown 
  1214.         together with the help of Terry Dawson and Jeff Uphoff. (A vain
  1215.         attempt to spread the blame.) Hopefully it will help someone
  1216.         out there get going with networking under Linux. 
  1217.  
  1218.         Future plans for the NET-2 HOWTO include a section on setting up
  1219.         your own Linux LAN (with SLIP and/or Ethernet), adventures in
  1220.         routing, and the use of netstat and other network administration
  1221.         under Linux. For now, the information here should be more than 
  1222.         enough. :)
  1223.         
  1224.         If you have questions about setting up NET-2, feel free to mail me, or
  1225.         if you have any corrections, additions, or errata for this NET-2 HOWTO
  1226.  
  1227.         send me any and all changes (cdiffs are nice, but I'm flexible). 
  1228.  
  1229.         Of course, thanks to Fred, Linus, Ross, Phil, Paul, Don, and everyone 
  1230.         else who helped to develop the NET-2 code and work on previous 
  1231.         versions of TCP/IP for Linux and the NET-FAQ. (Sorry, Phil, I lost 
  1232.         your phone number.) Finally, Linux has a complete implementation of 
  1233.         TCP/IP. It may not be for everyone yet. But for those who want to
  1234.         do some hacking---here it is.
  1235.  
  1236.         Cheers,
  1237.  
  1238.         Matt Welsh, mdw@sunsite.unc.edu
  1239.  
  1240. -- 
  1241. Send submissions for comp.os.linux.announce to: linux-announce@tc.cornell.edu
  1242.