There are quite a few web pages that contain information on configuring a
LapLink connection between two Linux machines, but none of them contain all
the information needed. I had to rummage around quite a bit to get
everything working, so I decided to write it all down so others might get
PLIP activated more easily.
Hardware
To get a PLIP connection working, you need a LapLink cable, which is
basically a parallel cable with male connectors on either end. You can get
more information on building your own cable (although I suggest buying one –
they’re not that expensive) in the PLIP mini-HOWTO. Of course, you need two
computers with free parallel ports to make this work. If you want to also
use a parallel printer, then things get a bit more complicated. I’ll not
talk much about that, since I did not need such an installation. The normal
steps presented here will only need minor modifications, though, so read on.
Before doing anything else, please check and write down the I/O address and
IRQ of the parallel port on both machines. This information is in the BIOS
setup screen. If you haven’t enabled IRQ support, do that now, since without
it the transfer speed will really crawl.
Loading and configuring the modules
First of all you need to load the appropriate modules into the kernel. I
suggest using modules instead of building the code into the kernel, as
you’ll have an easier time changing the settings if need be.
There are basically two possible module configurations. In the kernel
configuration you’ll have to make the following selections:
- General setup
- CONFIG_PARPORT: Y (to get the parallel port support)
- CONFIG_PARPORT_PC: Y (if you’re using a PC machine – for other you probably
need CONFIG_PARPORT_OTHER)
- Network device support
- CONFIG_NETDEVICES: Y (well, if you want to have any kind of
networking) - CONFIG_PLIP: M/Y (for PLIP support; M for module gives you more
flexibility)
- CONFIG_NETDEVICES: Y (well, if you want to have any kind of
After configuration run a “make dep;make modules;make modules_install” and
you should have in /lib/modules/…/misc/ either the modules “parport.o” and
“parport_pc.o” or just “parport_probe.o”, depending on your kernel version.
If you have the two modules parport and parport_pc, you’ll need to load them
into memory. Start with parport_pc and give it the correct I/O and IRQ
values:
insmod parport_pc io=0x37b irq=7
After this just load parport without any parameters. If you have
parport_probe, just load it without any parameters.
When you have the parallel port module(s) loaded, load the plip module:
insmod plip
If you get an error message like this:
/lib/modules/2.2.10/net/plip.o: init_module: Device or resource busy parport: Device or resource busy
Then you basically need to tell plip the IRQ of the parallel port. You
cannot give it as a module parameter (which is weird), so you’ll need to
specify it in the /proc file system:
echo 7 >/proc/parport/0/irq
(assuming the IRQ is 7 and you’re using the first parallel port). After this
change (check with “cat /proc/parport/0/irq” that the change actually is
there) you should probably unload the parallel port modules (with rmmod) and
then reload them with insmod and retry loading the plip module.
When your modules load without errors, you might want to enter their
configurations into /etc/modules.conf. In Debian you should add a file for
each module into /etc/modutils and then run update-modules, which will
create the modules.conf file. So for each module that you need to specify
parameters for, add an option line, like this:
options parport_pc io=0x37b irq=7
If you need any special command entered before or after a module load, you
can use the pre-install, post-install, pre-remove and post-remove commands:
pre-install parport_pc echo 7 >/proc/parport/0/irq
Network interface specification
When the modules are loaded without error (on both machines) you just need
to activate the plip network interface and set up routing rules. Defining a
network interface depends quite a bit on your distribution. On SuSE you can
use yast to specify the interface. On Debian you’ll get the basic interface
information in /etc/network/interfaces.
The basic commands to activate the interface and routing are as follows.
Replace [CLIENT] and [SERVER] with the IP addresses of the client machine
(whose only network connection is the plip interface) and the server (that
provides the plip connection and has connections to other networks as well).
#on the client machine: ifconfig plip0 CLIENT pointopoint SERVER route add default gw SERVER # #on the server machine: ifconfig plip0 SERVER pointopoint CLIENT
After the ifconfig command, running “ifconfig plip0” should produce an
output resembling this:
plip0 Link encap:Ethernet HWaddr FC:FC:C0:A8:01:62 inet addr:192.168.1.98 P-t-P:192.168.1.99 Mask:255.255.255.255 UP POINTOPOINT RUNNING NOARP MTU:1500 Metric:1 RX packets:110956 errors:0 dropped:68 overruns:0 frame:0 TX packets:184524 errors:602 dropped:0 overruns:0 carrier:602 collisions:26 txqueuelen:10 Interrupt:7 Base address:0x378
Troubleshooting
Error “Device or resource busy” when trying to
load the plip module.
You either have the module loaded already or (more likely) the IRQ setting
is missing. Apparently setting it into the /proc system is only needed in
kernels 2.2.x. The older 2.0.x kernels work fine without it. So execute
echo 7 >/proc/parport/0/irq
before loading the parallel port modules.
Error “Unkown host” etc. when trying to connect to a server using http
etc.
If you can access a host using its IP address instead of its host name, your
DNS configuration is faulty. The easiest way (if you’re not running your own
named) is to add the IP address of the name server into /etc/resolv.conf:
nameserver xxx.xxx.xxx.xxx
Error “Network unreachable”
This usually points to a routing problem. Make sure you’ve specified in the
client machine that all traffic should go through the plip interface. Check
out the sample configuration commands above.
Nothing happens when trying to use the network.
First of all start a ping from the client machine to the plip server. If
this works, then the problem is somewhere else. If this also fails (gives an
error or does nothing), then the plip connection has a problem.
Execute the command “screen -d ifconfig plip0” on both plip machines in one
virtual terminal (or x-terminal). This will keep displaying the plip0
interface information and highlighting any changes. The lines you’ll want to
keep an eye on are the RX and TX lines and their error counts.
Now start a ping from the client machine and see what happens. If you get a
carrier error for each ping, then you’ve loaded the plip module, but the
parport_probe module is not loaded. The fix is to shutdown the plip0
interface (“ifconfig plip0 down”), unload plip (“rmmod plip”) and then
install the parallel port module(s), load plip and start the interface again.
In conclusion
This document contained just the information I had to use to make my
connection work. For additional information, search for other pages with
suitable keywords. The information is there, you just have to find it.
My plip connection works quite nicely with a speed of around 40 kBps. The
connection produces “receive timeouts” on the client machine, but that
hasn’t caused any problems on network use.
Leave a Reply