home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 13 / CDA13.ISO / DOC / HOWTO / MINI / PLIP < prev    next >
Encoding:
Text File  |  1996-01-30  |  11.9 KB  |  323 lines

  1.             LINUX PLIP MINI-HOWTO
  2.  
  3. Last Update: 08/01/1996 (dd/mm/yyyy date format) 
  4. Copyright: 1996 by Andrea Controzzi <controzz@cli.di.unipi.it> 
  5.        See the copyright message below.
  6.  
  7. This HOWTO will hopefully let you build and use a Parallel Line Interface
  8. Protocol.
  9. For any question, error correction, comment and/or suggestion, my E-Mail
  10. address is: controzz@cli.di.unipi.it. Feel free to mail me any time you
  11. need help.
  12. First of all, most of these information come from the net-2-HOWTO, by
  13. Terry Dawson. This mini-HOWTO is not supposed to cover other aspects and/or 
  14. replace the net-2-HOWTO: my goal is to give you a way to install a PLIP
  15. permanent connection quickly, *ONLY* this.
  16. Read the net-2-HOWTO and the other docs for the general information about
  17. the network and the config files I suggest to change.
  18. Last, but not least, look at my quick PLIP installation paragraph.
  19. The following is the index of the contents; you can quickly find the right
  20. paragraph searching for the string __nn__ where nn is the paragraph number.
  21.  
  22. INDEX
  23. =====
  24.  
  25. 0) Introduction: what is PLIP and why should I use it?
  26. 1) Hardware required to use PLIP.
  27. 2) Reconfigure the kernel.
  28. 3) Setting up the configuration files. 
  29. 4) Kernel messages at boot time. 
  30. 5) Common troubles.
  31. 6) A quick PLIP installation.
  32. 7) Questions? Comments? Send me feedback.
  33. 8) Where to find new releases of this mini-howto.
  34. 9) Copyright message.
  35.  
  36.  
  37. __0__ INTRODUCTION: WHAT IS PLIP AND WHY SHOULD I USE IT?
  38.  
  39. There are many ways to create a connection between multiple hosts. PLIP,
  40. like SLIP, allow a local connection between two machines via the parallel
  41. ports.
  42. A PLIP connection is very similar to the SLIP (with a leased cable) one,
  43. but uses parallel ports instead of the serial ports. Parallel ports
  44. transfer more than one bit at a time, this means it is possible to
  45. achieve higher speeds than with a serial interface.
  46. The PLIP interface is fast enough to allow some decent tcp/ip
  47. functions, like NFS. So, you may have a computer with all your Linux stuff
  48. and another with only the minimal system, where you can mount all the rest
  49. from the main machine.
  50. The disadvantage is that most users have only one parallel port, this means
  51. that you won't be able to print and use PLIP together. Even with two or more 
  52. parallel ports, using PLIP and the printer is impossible without using
  53. the kernel modules. Indeed, to use PLIP you must *NOT* have a kernel with
  54. printer support enabled (see the kernel section for more info).
  55. In order to use printer, you must create a printer module.
  56.  
  57.  
  58. __1__ HARDWARE REQUIRED TO USE PLIP
  59.  
  60. The hardware required to set up a PLIP interface is (obviously) a free
  61. parallel port in both the machines and the cable.
  62. About the cable, this is what is written in the plip.c file, in the kernel
  63. 1.2.13 source:
  64.  
  65.   The cable used is a de facto standard parallel null cable -- sold as
  66.   a "LapLink" cable by various places.  You'll need a 12-conductor cable to
  67.   make one yourself.  The wiring is:
  68.     SLCTIN      17 - 17
  69.     GROUND      25 - 25
  70.     D0->ERROR   2 - 15          15 - 2
  71.     D1->SLCT    3 - 13          13 - 3
  72.     D2->PAPOUT  4 - 12          12 - 4
  73.     D3->ACK     5 - 10          10 - 5
  74.     D4->BUSY    6 - 11          11 - 6
  75.   Do not connect the other pins.  They are
  76.     D5,D6,D7 are 7,8,9
  77.     STROBE is 1, FEED is 14, INIT is 16
  78.     extra grounds are 18,19,20,21,22,23,24
  79.  
  80. In my opinion you should avoid to build your own parallel null cable. A 
  81. self-made cable may save very little money, but can add lots of headaches.
  82. If you wish to build your parallel cable, remember that you're doing it at
  83. your own risk, I reported exactly what is written in plip.c but I don't give
  84. warranties.
  85.  
  86.  
  87. __2__ RECONFIGURE THE KERNEL
  88.  
  89. You're supposed to already know how to configure and compile the kernel,
  90. otherwise you must get some doc (kernel-howto or other guides).
  91. Anyway, for the sake of completeness, here is a quick summary of what you 
  92. must do:
  93.  
  94. NOTE: This is true for the kernel 1.2.13, the configuration may change in
  95.       the 1.3.xx kernel series.
  96.  
  97. Cd to the directory where there are the kernel sources
  98.  
  99.   #cd /usr/src/linux   
  100.  
  101. And start the configuration
  102.  
  103.   #make config
  104.  
  105. During the configuration, make sure to answer y *at least* to the following
  106. questions:
  107.  
  108.   Networking support (CONFIG_NET) [y] y
  109.   TCP/IP networking (CONFIG_INET) [y] y
  110.   Network device support? (CONFIG_NETDEVICES) [y] y
  111.   PLIP (parallel port) support (CONFIG_PLIP) [n] y
  112.  
  113. You may want to answer yes also to the following questions:
  114.  
  115.   IP forwarding/gatewaying (CONFIG_IP_FORWARD) [n]
  116.   IP multicasting (CONFIG_IP_MULTICAST) [n]
  117.   IP firewalling (CONFIG_IP_FIREWALL) [n]
  118.   IP accounting (CONFIG_IP_ACCT) [n]
  119.   NFS filesystem support (CONFIG_NFS_FS) [y]
  120.  
  121. You MUST finally answer no to the following question:
  122.  
  123.   Parallel printer support? [y] n
  124.  
  125. Finally compile with
  126.  
  127.   #make dep ; make clean
  128.   #make zlilo
  129.  
  130. This will make your printer unusable, but you can still use the kernel
  131. modules. Please refer to the kernel guides and the kernel-HOWTO.
  132.  
  133.  
  134. __3__ SETTING UP THE CONFIGURATION FILES
  135.  
  136. First of all remember to backup all the files you will change, 
  137.  
  138.   #cp rc.inet1 rc.inet1.BACKUP 
  139.  
  140. may be a good idea.
  141. Now, if you don't have it done already, you must choose the IP addresses of
  142. the two machines. 
  143. In my examples I'll use a couple of example IPs for the IPs that you'll write,
  144. in the standard xxx.xxx.xxx.xxx format.
  145.  
  146.   In the /etc/rc.d/inet1.rc file of both the machines add this (better if in 
  147. the last part of the file):
  148.  
  149. /sbin/route add -net ${NETWORK} netmask ${NETMASK}
  150.  
  151. Where NETWORK and NETMASK should be set up previously. If you don't know how 
  152. to do it, please read the NET-2-HOWTO. 
  153. You may safely ignore these variables only in the following case.
  154. If you only want to connect two machines on a standalone network, you may 
  155. pick-up any IP address, say 200.0.0.1 and 200.0.0.2 respectively.
  156. In this case you can safely put NETWORK="200.0.0.0" and NETMASK="255.255.255
  157. .0". These are the example IPs that I use in my Quick PLIP Installation (see
  158. below).
  159.  
  160.   In the file /etc/hosts of both the machines you should add the entries with
  161. the IP of the machines that you connect via PLIP. In my example, the entries
  162. are:
  163.  
  164. 200.0.0.1       one             # this is the "one" IP address
  165. 200.0.0.2       two             # this is the "two" IP address
  166.  
  167. Where one and two are the names of the two hosts.
  168.  
  169.   If you want to activate the NFS, beside answering yes during the kernel
  170. configuration, you must add in /etc/exports the entries that describe the
  171. directories that you wish to export. In my example, to be able to mount
  172. the directory /usr, you should add this entry:
  173.  
  174.  /usr                          two (ro)
  175.  
  176.   Finally, these are the commands, that must be executed with root rights, 
  177. that activate the PLIP interface (of course the cable must be already plugged 
  178. correctly).
  179. Again I use the name one and two, as example. On "one" you must type:
  180.  
  181.   #ifconfig plip1 one pointopoint two up
  182.   #route add two
  183.  
  184. And, if you want also the NFS:
  185.  
  186.   #rpc.portmap
  187.   #rpc.mountd
  188.   #rpc.nfsd
  189.  
  190. On "two" the commands are the same, but you must write one instead of two 
  191. and vice versa.
  192.   One of your machines is likely to have only the PLIP connection, if this is
  193. true, you may also type:
  194.  
  195.   #route add default gw one
  196.  
  197. on that machine. In my example above, two is a laptop with only a PLIP
  198. connection with one, so I type the above line on two.
  199.  
  200.   Of course you may want to have all these commands automatically done
  201. by a script or at boot time. You must only create a script that execute these
  202. commands: now you may invoke it as root when you need, or you may add a 
  203. command (in /etc/rc.d/rc.inet2) that calls it at boot time.
  204. If you want to use my Quick PLIP Installation, you will find all the config
  205. files and the script.
  206.  
  207. __4__ KERNEL MESSAGES AT BOOT TIME
  208.  
  209. After you've reconfigured and compiled the kernel with PLIP support enabled,
  210. examine the messages with the dmesg (8) command.
  211. You should get something like this:
  212.  
  213. NET3 PLIP version 2.0 gniibe@mri.co.jp
  214. plip1: Parallel port at 0x378, using assigned IRQ 7.
  215.  
  216. You *must not* get a message like:
  217.  
  218. lp_init: lp1 exists, using polling driver
  219.  
  220. This means that you compiled the kernel with printer support enabled.
  221.  
  222.  
  223. __5__ COMMON TROUBLES
  224.  
  225. So far this section is incomplete, since I'm lucky enough not to have many
  226. problem with PLIP. This section will be (hopefully) filled with *your*
  227. problems that I may solve.
  228.  
  229.   List of common troubles
  230.   ------------------------
  231.  
  232. The trouble is listed with a =, the solution(s) with a -
  233.  
  234. = I get these messages at boot time:
  235.     SIOCSIFADDR: No such device
  236.     SIOCADDRT: Network is unreachable
  237.   and when I try to set up the link as written above, I get again error
  238.   messages like:
  239.     SIOCSIFADDR: No such device
  240.     SIOCSIFDSTADDR: No such device
  241.     SIOCADDRT: Network is unreachable
  242.     mount clntudp_create: RPC: Port Mapper failure - RPC: Unable to send
  243. - The kernel, for some reason, hasn't PLIP support enabled. This could be
  244.   due to:
  245.    . You didn't answer yes to "PLIP support? " during kernel configuration.
  246.    . You answered yes to "Printer support? " during kernel configuration.
  247.    . You compiled PLIP as a module, so you must load it. 
  248.  
  249. = I have created the script that connects my 2 computers. I set up the
  250.   link automatically in my rc.inet2, where I call a script that creates
  251.   the link and enables VFS.
  252.   My "two" hosts mounts some "one"'s directories; I have added the 
  253.   correct entries in "two"'s /etc/fstab.
  254.   If I boot "two" when "one" is down, "two" halts for some minutes 
  255.   on the "mounting remote file systems...".
  256. - This happens because "two" waits to mount the "one" filesystems, but
  257.   if "one" is down you must wait until "two" is bored of waiting.
  258.   To avoid this, you may:
  259.    . Comment out in rc.inet2 the command that mounts the remote filesystems
  260.    . Remove the entry in "two"'s /etc/fstab and mount the remote filesystems
  261.      manually when and if you need.
  262.  
  263.  
  264. __6__ A QUICK PLIP INSTALLATION
  265.  
  266. Before doing this mini-HOWTO, I created a quick PLIP installation set of
  267. files. 
  268. In few minutes, beside compiling the kernel, you should be able to set up
  269. a PLIP interface.
  270. The tarred and gzipped set of files may be found on my Home Page, at
  271.  
  272. http://www.cli.di.unipi.it/~controzz/intro.html
  273.  
  274. Perhaps someone will let my files available at some ftp site.
  275.  
  276.  
  277. __7__ QUESTIONS? COMMENTS? SEND ME FEEDBACK
  278.  
  279. For any questions and comments you can find me via e-mail at the address
  280. controzz@cli.di.unipi.it
  281. Feedback is welcome, any error report is precious.
  282. The next release should have a (your) FAQ section. So far I have put
  283. only a common troubles section.
  284.  
  285.  
  286. __8__ WHERE TO FIND NEW RELEASES OF THIS MINI-HOWTO
  287.  
  288. This mini-HOWTO is maintained by the HOWTO coordinators and is posted
  289. monthly on comp.os.linux.answers and can be found in the HOWTO directory
  290. at sunsite and at sunsite's mirrors.
  291.  
  292. Another way to find the mini-HOWTO (and to contact me) is on my Home Page,
  293.  
  294. http://www.cli.di.unipi.it/~controzz/intro.html
  295.  
  296.  
  297. __9__ COPYRIGHT MESSAGE
  298.  
  299. Unless otherwise stated, Linux HOWTO documents are copyrighted by
  300. their respective authors. Linux HOWTO documents may be reproduced and
  301. distributed in whole or in part, in any medium physical or electronic,
  302. as long as this copyright notice is retained on all copies. Commercial
  303. redistribution is allowed and encouraged; however, the author would
  304. like to be notified of any such distributions.
  305.  
  306. All translations, derivative works, or aggregate works incorporating
  307. any Linux HOWTO documents must be covered under this copyright notice.
  308. That is, you may not produce a derivative work from a HOWTO and impose
  309. additional restrictions on its distribution. Exceptions to these rules
  310. may be granted under certain conditions; please contact the Linux
  311. HOWTO coordinator at the address given below.
  312.  
  313. In short, we wish to promote dissemination of this information through
  314. as many channels as possible. However, we do wish to retain copyright
  315. on the HOWTO documents, and would like to be notified of any plans to
  316. redistribute the HOWTOs.
  317.  
  318. If you have questions, please contact Greg Hankins, the Linux HOWTO
  319. coordinator, at
  320. gregh@sunsite.unc.edu via email, or at +1 404 853 9989.
  321.  
  322. --- END ---
  323.