home *** CD-ROM | disk | FTP | other *** search
/ Current Shareware 1994 January / SHAR194.ISO / misc / linhowto.zip / NET-2.HOW < prev    next >
Text File  |  1993-10-08  |  55KB  |  1,229 lines

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