old-www/LDP/LG/issue43/bennet.html

300 lines
22 KiB
HTML

<!--startcut ==========================================================-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<title>PLIP: Laplink Cable Install of Debian 2.1 LG #43</title>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#A000A0"
ALINK="#FF0000">
<!--endcut ============================================================-->
<H4>
"Linux Gazette...<I>making Linux just a little more fun!</I>"
</H4>
<P> <HR> <P>
<!--===================================================================-->
<center>
<H1><font color="maroon">PLIP: Laplink Cable Install of Debian 2.1</font></H1>
<H4>By <a href="mailto:bbennet@mb.sympatico.ca">Bill Bennet</a></H4>
</center>
<P> <HR> <P>
<center><h2><font color=blue>This installs linux via the parallel port</font></h2></center>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Have you got a machine that is ready for linux but it has no CDROM drive? Is it also missing a modem or a network card? If you have a running linux box (with CDROM drive) available to you, then you can easily install linux via the good old laplink cable that plugs into the parallel port. Even old neglected machines come with a parallel port somewhere, so this method will guarantee that you can walk into any installing situation and be ready to roll.<br>
<h2><font color="blue">Debian 2.1 can do this thing</font></h2>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Just about all linux distributions can do this little PLIP console connection. There is a lot of good <a href="#pliphow">information</a> available for you as well, but if it is only for RedHat, then as a Debian user you may feel left out. Even worse, too many times an article will assume that you know what you are doing.
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Heck, I do not know what I am doing, but I got this PLIP thing to install Debian 2.1 because I needed a good peer to peer network game player that fits on a small hard disk. Good old Debian has the small purposeful ".deb" packages that you can put in one at a time to make a very small yet powerful server. This article fires up Debian 2.1 and installs a PLIP peer to peer network system with <a href="#xme">X</a> Windows so we can play <a href="#netmaz">netmaze</a> head to head versus a small, bloodthirsty nephew or niece.
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The target system is a "Frankenstein"; a 486/DX66 with no CDROM, no modem, no network card, 16 MB RAM, a 1.44 MB floppy and two tiny hard disks, 110 and 170 megabytes small.
<p>We begin at the running linux box that will serve us our CD through the <a href="#laplink">laplink</a> cable.
<h2><font color="blue">Server for the PLIP</font></h2>
<p>We need to login as root and edit these files:<ul>
<li><a href="#initd">/etc/init.d/network</a>
<li><a href="#networks">/etc/networks</a>
<li><a href="#hosts">/etc/hosts</a>
<li><a href="#deny">/etc/hosts-deny</a>
<li><a href="#allow">/etc/hosts-allow</a>
<li><a href="#exports">/etc/exports</a>
<li><a href="#fstab">/etc/fstab</a>
</ul>
<br>
<h2><font color="blue">Scripting is the mojo for linux</font></h2>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Those wacky HOWTO writers are always letting you copy their hard work by giving you a little script to run on your machine.
<p>We need to create this little executable script:
<pre>
#!/bin/sh
killall -HUP /usr/sbin/rpc.mountd
killall -HUP /usr/sbin/rpc.nfsd
echo re-exported file systems
</pre>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Fire up mcedit (it comes with Midnight Commander. You do have it, yes?). Go to the <a href="#NFShowto">NFS-HOWTO</a> and block out the exportfs script with the F3 toggle and then F9 copy it to the ~/.cedit/cooledit.clip file. Exit with F10.
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Then type mcedit your-new-file-name. It will give you a nice blank page to F9 insert the ~/.cedit/cooledit.clip file. Edit it in your personal way and F2 save it, or F9 save it as your-new-script-command-name.
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Then type chmod 755 your-new-file-name to make it executable. Copy it to /usr/sbin just for fun, but also to make it live in the path.
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;For easy mnemonics and to honour the author, we should call it exportfs. Done.
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Huh? What does it do? It exports the currently mountable NFS directories in case you make a change.
<a name="initd"><h3><font color="blue">/etc/init.d/network</font></h3></a>
<p>We simply need to tell the machine about the plip1 device and who it connects with via pointopoint networking.
<pre>
#! /bin/sh
ifconfig lo 127.0.0.1
route add -net 127.0.0.0
IPADDR=192.168.1.5
NETMASK=255.255.255.0
NETWORK=192.168.1.0
BROADCAST=192.168.1.255
GATEWAY=
#ifconfig eth0 ${IPADDR} netmask ${NETMASK} broadcast ${BROADCAST}
#route add -net ${NETWORK}
[ "${GATEWAY}" ] && route add default gw ${GATEWAY} metric 1
ifconfig plip1 CHGUY pointopoint Salma up
route add -net ${NETWORK} netmask ${NETMASK} dev plip1
</pre>
<h3><font color="blue"><a name="networks">/etc/networks</a></font></h3>
<p>The networks your machine knows about:
<pre>
loopback 127.0.0.0
localnet 192.168.1.0
</pre>
<h3><font color="blue"><a name="hosts">/etc/hosts</a></font></h3>
<p>Well? Who is on this network anyway?
<pre>
127.0.0.1 localhost
192.168.1.5 CHGUY.chguy.net CHGUY
192.168.1.3 Salma.chguy.net Salma
</pre>
<h3><font color="blue"><a name="deny">/etc/hosts.deny</a></font></h3>
<p>Kind of like being doorman at 54, eh?
<pre>
ALL: PARANOID: DENY
</pre>
<h3><font color="blue"><a name="allow">/etc/hosts.allow</a></font></h3>
<p>Salma gets in every time.
<pre>
ALL: 192.168.1.3: ALLOW
</pre>
<h3><font color="blue"><a name="exports">/etc/exports</a></font></h3>
<p>The NFS server will only give out the directories in the exports file.
<pre>
/cdrom *.chguy.net
</pre>
<h3><font color="blue"><a name="fstab">/etc/fstab</a></font></h3>
<p>This will let ordinary users mount the CDROM drive, which is not a problem at a home LAN (Local Area Network. Yes, that is right, your linux CD gives you a replacement for NT).
<pre>
# (file system) (mount point) (type) (options) (dump) (pass)
/dev/cdrom /cdrom iso9660 users,exec,ro 0 0
</pre>
<br>
<h2><font color="blue">Turn it on</font></h2>
<p>Time to turn on PLIP on this CD server <a href="#plipon">machine</a>:
<pre>
ifconfig plip1 CHGUY pointopoint Salma up
route add Salma dev plip1
</pre>
<p>All is ready for the installation.
<ul><li>we will allow the new machine onto the system
<li>we have assigned a network address to each machine
<li>we will export the /cdrom directory when the installer mounts the CD
</ul>
<h2><font color="blue">Client for the PLIP</font></h2>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The target for the installation is the client of your server. However, this is PLIP peer to peer networking, so both of the machines act as a server. For this installation we will refer to the target machine as the client, code named Salma.
<h3><font color="blue">Make two install diskettes</font></h3>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Back at the server, mount the <a href="#CHGUY">B1</a> CD (B2 for a laptop) and make your two installation floppies.
<p>Simply cd deep into the CD:
<br>
<pre>
cd /debian/dists/slink/main/disks-i386/current
dd if=resc1440.bin of=/dev/fd0
dd if=drv1440.bin of=/dev/fd0
</pre>
<h2><font color="blue">Salma Laptop</font></h2>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The resc1440.bin is the generic PC booter; resc1440tecra.bin is made for laptops.
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Place your floppy in the drive and power up Salma for the installation.
<br>
<h2><font color="blue">She boots your machine</font></h2>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;You get a nice menu of jobs with the Debian installer. Please read all of your <a href="#fdisk">options</a> and stay loose!
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The Debian installation will go through the usual motions of assigning mount points for "/" (root), "/swap", and your custom placements.
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Now it is time to "Install Operating System Kernel and Modules" and that is how we will enable PLIP on Salma.
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;After the kernel is ready to PLIP we can install the base system, which is a nice little ten MB file that fits on seven floppies. Yes, that is right, you can just make seven more floppies and get it on, no need to use PLIP.
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;We are here to play <a href="#netmaz">netmaze</a> and make a peer to peer network, so read on.
<br>
<h2><font color="blue">From the floppy</font></h2>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The installer will ask you how you are going to install the kernel and modules, and even though you are going to use the CD in a minute, you must tell it you are going to install from a floppy.
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;In almost every case you will be selecting /dev/fd0: it is the first floppy drive.
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Then it will ask for the resc1440.bin diskette so that you can make a live file system to work from. It booted, so it is already in the drive.
<h3><font color="blue">Kernel Modules</font></h3>
<p><i>You have landed on Community Chest: FOLLOW INSTRUCTIONS ON TOP CARD</i>. <i>Your card says a driver is a kernel module</i>. <i>You no longer will ask for drivers</i>. <i>You will now ask for kernel modules</i>. <i>Do not pass GO</i>.
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;When the resc1440.bin diskette is done loading, the installer will ask you to place the Drivers floppy in the drive. It is the drv1440.bin diskette.
<h2><font color="blue">Configure for PLIP</font></h2>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Now the installer wants to jump ahead to Make Linux Bootable Directly From Hard Disk. This is a confounder and we need a volunteer to fix it.
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;You need to go down the menu and select "Configure Device Driver Modules". You need your set of modules to be installed in your kernel so that you can network to the CD server.
<h2><font color="blue">The set of modules</font></h2>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;There is a basic set of modules needed for your machine. It varies from user to user of course, and the following list is only a suggestion.
<h3><font color="blue">&nbsp;&nbsp;&nbsp;&nbsp;Group&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Module</font></h3>
<ul><li>block----no, you do not need <strong>paride</strong> right now. Compile it into your custom kernel in future if you want to use external devices, like CDROM drives, etc.
<li>cdrom---no, you will not be controlling the server's CDROM. Get the right one from here if you buy a proprietary CDROM drive in future.
<li>fs------YES, please get <strong>nfs</strong> so you can NFS and export files to your network.
<li>fs------YES, please get <strong>nls_iso8859_1</strong> for the nice character set to read.
<li>fs------YES, please get <strong>vfat</strong> so you can muck about in the DOS file system and see long filenames.
<li>ipv4----YES, please get <strong>rarp</strong> just in case your network tools need it. I do not know; better safe than sorry.
<li>misc----no, you do not use <strong>lp</strong> right now. Compile it into your custom kernel in future if you want to switch from PLIP to printing. If you have two parallel ports then go ahead.
<li>misc----YES, please get <strong>serial</strong> so you can use the serial port for an external modem in future.
<li>misc----YES, please get <strong>psaux</strong> if you are trying to use USB and it craps out as usual. Then you can still use your ps/2 mouse.
<li>net-----YES, please get <strong>dummy</strong> just in case your network tools need it. I do not know; better safe than sorry.
<li>net-----YES, please get <strong>plip</strong> so that you can do pointopoint networking via the laplink cable.
<li>net-----YES, please get <strong>ppp</strong> for future hookups to your ISP.
<li>scsi----no, you might not have any scsi devices. Here is where you get that <strong>ppa</strong> module for your external Zip drive.
</ul>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;When you install the modules and the installer gives you a new screen for parameters, you can usually just press Enter to go ahead.
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The plip module will already have the io port address and irq of the parallel port assigned to it, so just press Enter at the parameters page.
<h2><font color="blue">Configure the Network</font></h2>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The installer wants to make linux bootable again, but ignore it and select "Configure the Network".
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;It wants the host name of your system, so type in Salma to match the examples in this article.
<br>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Now it wants to know if you are on a network, so answer yes. The domain name is "chguy.net", just like in the examples.
<h2><font color="blue">The IP address</font></h2>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The IP address can be the default (automatic) numbers thrown up on the screen. These are the numbers for a Class C network, the type you have at home.
<p><strong>Your IP address, according to the examples, is 192.168.1.3 for your hostname of Salma.</strong>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The rest of the numbers are automatic and good ones to use for your network. We have used them for the example and it saves you a lot of typing and checking.
<p><strong>Netmask = 255.255.255.0</strong>
<p><strong>IP Broadcast address = 192.168.1.255</strong>
<p><strong>Gateway</strong> = whatever... If you have a modem on the other machine, then make a gateway. Or a Dell, or a Netwinder, your choice.
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Normally from home you will be making a gateway to the internet through your ISP.
<p><strong>Domain Name Service</strong> = your ISP nameserver. Here at home, there is no modem on the two PLIP machines, so I have each machine look at its local address and also on the other nameserver.
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;So, for the example, all we put in the nameserver places are the two IP addresses of the two PLIP machines.
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;We tell the installer that "Another system will be the DNS server".
<p><strong>Nameserver = 127.0.0.1&nbsp;&nbsp;&nbsp;192.168.1.5</strong>
<h3><font color="blue">Execute a Shell</font></h3>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A LeftAlt-F2 will light up a new console for you. A LeftAlt-F3 will show the error messages from your plip attempts. You could also just select "Execute a shell" from that wacky menu.
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;At the prompt you can immediately type in the ifconfig command to see what is running.
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Again with the ifconfig, you set up PLIP on Salma with this:
<pre>
ifconfig plip1 192.168.1.3 pointopoint 192.168.1.5 up
</pre>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Wait, you are not set up yet. You better set a route to the CD server machine.
<pre>
route add 192.168.1.5 dev plip1
</pre>
<h2><font color="blue">Install the Base System</font></h2>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The menu wants to make linux bootable again. Please select "Install the Base System".
<h2><font color="blue">Choose Network Interface</font></h2>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Now we can select "plip: Parallel-line IP" from the menu of interfaces.
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Yikes! The friendly installer now tells us that it will not create a complete PLIP configuration.
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The installer does not know that you just did it with the ifconfig and route commands. Maybe we can get another volunteer to set up the script to see this step.
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Now we are asked to select the installation medium. Yes, it is "nfs: NFS (network filesystem)".
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The installer will ask you for the address of the server and the directory where the debian archive lives.
<h2><font color="blue">"push de button and make it go"</font></h2>
<p><ul><li>the CD is going to be NFS mounted on Salma on /instmnt
<li>you have already mounted the CD on /cdrom on the server
<li>you have /cdrom listed in /etc/exports and now the installer can find it and use the CD.
</ul>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Type in the IP address of the CD server with a colon and the NFS export directory of the mounted CDROM. The screen prompt says "Choose Debian NFS filesystem":
<pre>
192.168.1.5:/cdrom/debian
</pre>
<h2><font color="blue">We are going live to chguy.net</font></h2>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;On your screen is a little window called "Choose Debian archive path". It only shows up when you are connected and online with the CD server machine. The installer is asking you for the location of the Debian archive directory in the mounted NFS filesystem.
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The answer is /debian. Always is.
<br>
<br>
<h3><a name="pliphow"><font color="blue">Reference reading and links:</font></a></h3>
<p>BootPrompt-HOWTO - required reading for all linuxians
<p>PLIP-mini-HOWTO - you need the kernel configuration tips and troubleshooter
<p>Kernel-HOWTO - you might need to make a custom kernel with a PLIP module
<p><a name="NFShowto">NFS-HOWTO</a> - you absolutely need the exportfs script and this HOWTO
<p><a href="http://debian.org">The Installation Guide</a> for Debian 2.1 - good basic stuff here
<p><a name="loadlin">"Loadlin.exe</a> Installer", LG#34 - step by step for booting from a logical drive
<h3><a name="CHGUY"><font color="blue">linux on CD</font></a></h3>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Your CHGUY Debian 2.1 CD set is labeled B1, B2, S1 and S2. The B1 CD (#1 of 4) is the installer for a regular desktop machine. The B2 CD (#2 of 4) is slightly tweaked for installing Debian 2.1 on your laptop machine. For installing via dselect, either one can go in the CDROM drive. Those wacky hackers are ready for anything.
<h3><a name="xme"><font color="blue">X Windows is compact</font></h3>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;When you install the Standard Server package it only fills up 50 megabytes on your hard disk. Add in 32 megabytes for a swap partition and you have only used 80 megabytes from a small, old hard disk. That will leave you enough room for the xbase ".debs" plus your video-card-specific xserver and the rest of the XFree86 window system.
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Both 486s have Apache webserver, anonymous FTP, the TrueType fontserver, full networking, full use of the video card, blazing fast ping times on the PLIP cable (5.2 milliseconds) plus my choice of hot window managers like AfterStep and the icewm.
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Total installed ".deb" space taken up on either machine is 127 megabytes; including sharp little network games like Freeciv, netmaze and crossfire. Who needs bloated systems? Certainly not the linuxians.
<h3><a name="plipon"><font color="blue">New PLIP commands</font></a></h3>
<p>You can make this into an executable script called plipon with:
<pre>
chmod 755 plipon
</pre>
<p>This is the new command plipon:
<pre>
#! /bin/sh
ifconfig plip1 CHGUY pointopoint Salma up
route add Salma dev plip1
</pre>
<p>The above script runs on the CD server CHGUY. Reverse it for Salma.
<p>The new plipoff command:
<pre>
#! /bin/sh
ifconfig plip1 down
</pre>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;You can copy it to /usr/sbin just for fun and so that it lives in the path.
<h3><a name="netmaz"><font color="blue">Bloodthirsty Midgets</font></h3>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;My six years old nephew Brady "the Mighty Naturta" and his almost-twin cousin Jesse "the NO-baby" absolutely love to play netmaze. It installs in seconds through the laplink cable and it plays for hours. The package is called netmaze and all you do is run the server on one machine and the netmaze client on both. You can even add a few robots to chase you down. The players you see are smiley face spheres. Heaps of fun!
<h3><a name="fdisk"><font color="blue">Three primary and one extended</font></a></h3>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Please use GNU/linux fdisk to make your new primary partition for "/" (root). Too many of you are too excited to get going and you place linux on an <a href="#loadlin">extended</a> partition. Just a reminder, the PC design allows you to get up to four primary partitions per hard disk drive, or three primary and one extended (which you can load up with lots of logical partitions). Do NOT use DOS fdisk if you have just one hard disk. DOS fdisk is disabled so that it will only make one primary partition if you only have one hard disk.
<h3><a name="laplink"><font color="blue">Laplink vs USB</font></a></h3>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get this: A recent advertisement for USB home networking between two machines was crowing over the fact that all you do is plug it in and you can enjoy full networking of two machines. It was "only" $85.00 for your set of newfangled doodads. *Limit of twelve feet of cable.
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;I began to think that this was madness! You can get a laplink cable and hook up your two machines for full network connection; plus it is probably a "free" cable that was paid for a long time ago. *Limit of fifty feet, unless you begin to pick up radio signals.
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;You plug the laplink cable into the parallel port of each machine; yes, the same place where your printer should go. Your laptop can use this PLIP method to share files with your desktop at work and at home. Plus it is hard-boiled, rock-solid networking through a cable; completely under your control. Methinks this USB thing was just a ploy to sell new machines.
<hr>
<p><center><strong><font color="blue">made with mcedit on an i486 <BR>
running Debian 2.1 Linux 2.0.36<BR>
No systems were frozen or crashed during the testing of these procedures.<BR>
All references to Salma Hayek are purely lascivious.</font></strong></center>
<!--===================================================================-->
<P> <hr> <P>
<center><H5>Copyright &copy; 1999, Bill Bennet <BR>
Published in Issue 43 of <i>Linux Gazette</i>, July 1999</H5></center>
<!--===================================================================-->
<!--startcut ==========================================================-->
<P> <hr> <P>
<A HREF="index.html"><IMG ALIGN=BOTTOM SRC="../gx/indexnew.gif"
ALT="[ TABLE OF CONTENTS ]"></A>
<A HREF="../index.html"><IMG ALIGN=BOTTOM SRC="../gx/homenew.gif"
ALT="[ FRONT PAGE ]"></A>
<A HREF="lg_tips43.html"><IMG SRC="../gx/back2.gif"
ALT=" Back "></A>
<A HREF="carlson.html"><IMG SRC="../gx/fwd.gif" ALT=" Next "></A>
<P> <hr> <P>
</BODY>
</HTML>
<!--endcut ============================================================-->