|
Документ взят из кэша поисковой машины. Адрес
оригинального документа
: http://rtm-cs.sinp.msu.ru/manual/howto/mini/PLIP.html
Дата изменения: Thu May 4 20:25:19 2000 Дата индексирования: Mon Oct 1 21:23:27 2012 Кодировка: |
controzz@cli.di.unipi.it
This is a new release. There are many changes and lots of enhancements, but there will be still grammar and spelling errors (english is not my native language) and, unlikely but possible, some wrong or outdated info. PLEASE let me know about any errors to help me provide the correct information for everybody.
The biggest changes in the release are:
For any question, error correction, comment and/or suggestion, my E-Mail address is: controzz@cli.di.unipi.it. Feel free to mail me any time you need help. Sometimes I won't answer immediately, but I'll answer. If it happens that you don't receive anything from me after 2 weeks, this means that our mail system has trouble: do not hesitate to mail me again, it's my duty to help you. I can guarantee I'll solve your problems, but I'll try. If after many mails you don't receive answer, check your return address. Several times my answers did not arrive due to delivery problems, usually because the return address was root@myhost.
Before sending mail read the FAQ, my answer to a question already present in the FAQ will not be better (but likely worse or less complete) than the answer you can already read.
For questions about PLIP with DOS and Win95 please send mail to the authors of these chapters, I can't help you.
First of all, a lot of technical information come from the net-2-HOWTO, by Terry Dawson. This mini-HOWTO is not supposed to cover other aspects and/or replace the net-2-HOWTO: my goal is to give you a way to install a PLIP permanent connection quickly, *ONLY* this. All the other info come from my personal experience and the help of many users that sent me comments and information.
Read the net-2-HOWTO and the other docs for the general information about the network and the config files I suggest to change.
There are many ways to create a connection between multiple hosts. PLIP, like SLIP, allow a local connection between two machines, but uses the parallel ports.
Parallel ports transfer more than one bit at a time, this means it is possible to achieve higher speeds than with a serial interface.
The speed achieved depends completely on your hardware (CPU and parallel port) and system load, in general it may be from 5 Kb/sec up to even 40 Kb/sec.
The PLIP interface is fast enough to allow some decent tcp/ip functions, like NFS. So, you may have a computer with all your Linux stuff and another with only the minimal system, where you can mount all the rest from the main machine.
The disadvantage is that most users have only one parallel port, this means that you won't be able to print and use PLIP together. Even with two parallel ports it is impossible to print and use PLIP without using kernel modules.
This disvantage can be also eliminated, if you have two or more parallel ports, applying a patch that you can find in this Mini-HOWTO.
Finally I am now able to give a hopefully good way to set up a PLIP link between DOS and Linux.
I won't stress it enough: so far nobody reported a successful link between Linux and Windows95.
The hardware required to set up a PLIP interface is (obviously) a free parallel port in both the machines and the cable. If you can configure it with your BIOS, set it at least as "bi-directional", but if possible in ECP or EPP mode.
About the cable, this is what is written in the plip.c file, in the kernel 2.0.33 source:
The cable used is a de facto standard parallel null cable -- sold as
a "LapLink" cable by various places. You'll need a 12-conductor cable to
make one yourself. The wiring is:
SLCTIN 17 - 17
GROUND 25 - 25
D0->ERROR 2 - 15 15 - 2
D1->SLCT 3 - 13 13 - 3
D2->PAPOUT 4 - 12 12 - 4
D3->ACK 5 - 10 10 - 5
D4->BUSY 6 - 11 11 - 6
Do not connect the other pins. They are
D5,D6,D7 are 7,8,9
STROBE is 1, FEED is 14, INIT is 16
extra grounds are 18,19,20,21,22,23,24
But I strongly advice you to read the /usr/src/linux/drivers/net/README1.PLIP
and README2.PLIP files for more info about the cable.
In my opinion you should avoid building your own parallel null cable. A self-made cable may save very little money, but can add lots of headaches. If you wish to build your parallel cable, remember that you're doing it at your own risk, I reported exactly what is written in plip.c but I don't give warranties.
A final word about cable length: long cables (i.e. more than 10 feet or 3 meters) may bring problems due to radio interference. If you need long cables you should use good and well shielded cables, but very long cables are not recommended: I think the maximal cable lenght should be 15 meters (50 feet).
Anyway, someone mailed me that his/her 100 feet (30 meters) cable works fine; if someone really wants to try a PLIP connection between the office and his/her home (200 meters away), and has the money to spend, can try it, but is at his/her risk.
You're supposed to already know how to configure and compile the kernel, otherwise you must get some doc (kernel-howto or other guides). Thanks to the cool work made by the kernel guys, recompiling the last kernels is a really easy jobs also for "common" people, so just do it. Anyway, for the sake of completeness, here is a quick summary of what you must do:
NOTE: I suppose you are using the 2.0.xx kernel series. Now there is no need to keep the 1.2.xx kernels. There are no istructions about the 2.1.xx kernel series, since they are for development.
I will suppose that you use menuconfig to set up the kernel options, but the other tools are equivalent. I'll show how to do it with menuconfig:
#make menuconfig
I strongly advice to select
Loadable module support --->
and enable the
[*] Enable loadable module support
and, if possible (i.e. you have modules.2.0.0) the
[*] Kernel daemon support (e.g. autoload of modules)
Then go back and choose
Networking options --->
where you should choose at least
[*] Network firewalls
[*] TCP/IP networking
[*] IP: forwarding/gatewaying
The go back and choose at least
[*] Network device support
<M> PLIP (parallel port) support
If you use modules I definitely advice you to set up PLIP as a module. If you do so you can also, if you need to use a printer, go to
Character devices --->
and set up as a module the
<M> Parallel printer support
Now you have enabled the kernel support for PLIP. If it's the first time that you compile the kernel look at all the other options then save and exit.
Finally compile with
#make dep ; make clean
#make zlilo
And, if you use modules
# make modules
# make modules_install
Now reboot your system.
After you've reconfigured and compiled the kernel with PLIP support enabled, when you boot the system, if the kernel supports PLIP directly, or when you load (later, see below) the PLIP module if you compiled PLIP as modules, you should get something like this (numbers may differ):
NET3 PLIP version 2.2 gniibe@mri.co.jp
plip1: Parallel port at 0x378, using assigned IRQ 7.
Depending upon your klogd and syslogd configuration the plip message could have been stored in your system log files: don't panic if you don't see the above message. If you compiled PLIP as a module and lsmod shows that the plip module is loaded, then it's enough.
Please take notice of the interface name. Usually is plip1, but may be plip0 or even plip2, plip3, and so on. It depends on the IO Address.
NOTE: Some distributions, like Debian, use different config files. If you have a standard installation and you don't find the rc.inet* files, look for (different) config files in the /etc/init.d directory.
First of all remember to backup all the files you will change,
#cp rc.inet1 rc.inet1.BACKUP
may be a good idea.
Now, if you don't have it done already, you must choose the IP addresses of the two machines. In my examples I'll use a couple of example IPs for the IPs that you'll write, in the standard xxx.xxx.xxx.xxx format.
In the /etc/rc.d/inet1.rc file of both the machines add this (better if in the last part of the file):
/sbin/route add -net ${NETWORK} netmask ${NETMASK}
Where NETWORK and NETMASK should be set up previously. If you don't know how to do it, please read the NET-2-HOWTO.
If after this route command you get a message like this:
SIOCADDRT: network unreachable
then use this instead:
/sbin/route add -net ${NETWORK} netmask ${NETMASK} dev plip1
where, as usually, you'll have to use the interface name reported by the kernel messages (see above).
You may safely ignore these variables only in the following case:
If you only want to connect two machines on a standalone network, you may pick-up any IP address, say 200.0.0.1 and 200.0.0.2 respectively. In this case you can safely put NETWORK="200.0.0.0" and NETMASK="255.255.255 .0". These are the example IPs that I use in my Quick PLIP Installation (see below).
NOTE: 200.0.0.1 and 200.0.0.2 are only example IPs, I advice not to use these numbers definitively because they could be the addresses of real hosts on Internet!
I strongly advice to choose your address between the "private address" intervals:
10.0.0.0 - 10.255.255.255
172.16.0.0 - 172.31.255.255
192.168.0.0 - 192.168.255.255
In the file /etc/hosts of both the machines you should add the entries with the IP of the machines that you connect via PLIP. In my example, the entries are:
200.0.0.1 one # this is the "one" IP address 200.0.0.2 two # this is the "two" IP address
Where one and two are the names you have chosen for the two hosts.
If you want to activate the NFS, beside answering yes during the kernel configuration, you must add in /etc/exports the entries that describe the directories that you wish to export. In my example, to be able to mount the directory /usr, you should add this entry:
/usr two (ro)
For more informations about NFS, please read the specific documentation; don't report me problems with the NFS, I won't be able to help.
Now reboot your system.
Finally, these are the commands, that must be executed with root rights, that activate the PLIP interface (of course the cable must be already plugged correctly).
NOTE: If something unexpected happens, please doublecheck the cable and the spelling of the commands. If you followed the istructions correctly but the are still errors, read the FAQ paragraph, a lot of answers are already available.
First of all confirm that there is no lp device present:
# cat /proc/devices
You mustn't see any reference to lp like this:
6 lp
If you see it, please remove (temporanely) the lp device before going on, if PLIP works then you can try it with lp later. To remove the lp device you'll have to use the rmmod if it's a module; if instead it's built in the kernel, you'll need to recompile the kernel with lp as a module (a much wiser idea).
Again I use the name one and two, as example. On one you'll have to do the following steps.
If you don't have the module automounter daemon and you compiled PLIP as a module, you must mount it:
# insmod plip
NOTE: if your parallel port is on an IRQ different from 7 and/or is on a IO Address different from 0x378, then you'll have to tell it to insmod. Find your real IRQ and IO Address (the DOS command MSD is likely to be ok, but don't trust it too much) and write something like this:
# insmod plip io=0x278 irq=5
Usually IRQ is 7 or 5, while IO Address is 0x378, 0x278 or 0x3bc. It is important that you check that the address and IRQ match the hardware settings (jumpers on old boards, BIOS on modern motherboards).
If you are paranoic check that the module has been loaded with:
# lsmod
Module: #pages: Used by:
plip 3 0
Take notice of the interface name (plip0, plip1, and so on; for more details read the kernel messages chapter above), then set up the PLIP interface:
# ifconfig plip1 one pointopoint two up
NOTE: if your parallel port is on an IRQ different from 7 and/or is on a IO Address different from 0x378, then you'll have to tell it to ifconfig. Use the same IRQ and IO Address reported by the kernel messages and write something like this:
# ifconfig plip1 irq 7
# ifconfig plip1 io_addr 0x3bc
Usually IRQ is 7 or 5, while IO Address is 0x378, 0x278 or 0x3bc.
Now check that it worked...
# ifconfig
.....
.....
plip1 Link encap:10Mbps Ethernet HWaddr FC:FC:C8:00:00:01
inet addr:200.0.0.1 P-t-P:200.0.0.2 Mask:255.255.255.0
UP POINTOPOINT RUNNING NOARP MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0
TX packets:0 errors:0 dropped:0 overruns:0
Interrupt:7 Base address:0x378
Add the route to two...
# route add two plip1
And, if you want also the NFS for two:
# rpc.portmap
# rpc.mountd
# rpc.nfsd
On "two" the commands are the same, but you must write one instead of two and vice versa.
One of your machines is likely to have only the PLIP connection, if this is true and that machine is two, you may also type:
# route add default gw one
on that machine. In my example above, two is a laptop with only a PLIP connection with one, so I type the above line on two.
Finally check with a
# ping two
from one and a
# ping one
from two to see that all is working.
Of course you may want to have all these commands automatically done by a script or at boot time. You must only create a script that execute these commands: now you may invoke it as root when you need, or you may add a command (in /etc/rc.d/rc.inet2) that calls it at boot time.
To tune your PLIP, you can use the plipconfig command, see the man page for more informations.
To shutdown PLIP, you need only to do:
# ifconfig plip1 down
which removes also the route entries. If you don't have the automounter daemon, then remove also the module:
# rmmod plip
This section will (hopefully) solve your problems. If you have any other question, feel free to mail me anytime.
SIOCSIFADDR: No such device
SIOCADDRT: Network is unreachable
and when I try to set up the link as written above, I get again error
messages like:
SIOCSIFADDR: No such device
SIOCSIFDSTADDR: No such device
SIOCADDRT: Network is unreachable
mount clntudp_create: RPC: Port Mapper failure - RPC: Unable to send
if ping -c 5 one ; then
mount one:/.....
fi
plip1: timed out (1, 89)
or similar messages.
plip1: timed out (1, 89)
or similar messages.
RFC1597 has specifically reserved some IP addresses for private
networks. You should use these as they prevent anything nasty
happening if you accidentally get connected to the Internet. The
addresses reserved are:
10.0.0.0 - 10.255.255.255
172.16.0.0 - 172.31.255.255
192.168.0.0 - 192.168.255.255
The best way to make PLIP and LP live together is to use kernel modules: you can load plip.o and unload it when you need to print or vice versa. If you do really need to use both PLIP and LP, try the following patches.
If for some reason you wish PLIP and LP supported directly by the kernel, you can try these patches.
You must modify the following pieces of code, but backup the files before:
******** modifications to linux/drivers/char/lp.c ***********************
struct lp_struct lp_table[] = {
{ 0x3bc, 0, 0, LP_INIT_CHAR, LP_INIT_TIME, LP_INIT_WAIT, NULL,
NULL, },
/* { 0x378, 0, 0, LP_INIT_CHAR, LP_INIT_TIME, LP_INIT_WAIT, NULL,
NULL, },
{ 0x278, 0, 0, LP_INIT_CHAR, LP_INIT_TIME, LP_INIT_WAIT, NULL,
NULL, },
*/
};
#define LP_NO 1
******** modifications to linux/drivers/net/Space.c ********************
#if defined(PLIP) || defined(CONFIG_PLIP)
extern int plip_init(struct device *);
static struct device plip2_dev = {
"plip2", 0, 0, 0, 0, 0x278, 2, 0, 0, 0, NEXT_DEV, plip_init, };
static struct device plip1_dev = {
"plip1", 0, 0, 0, 0, 0x378, 7, 0, 0, 0, &plip2_dev, plip_init, };
/* static struct device plip0_dev = {
"plip0", 0, 0, 0, 0, 0x3BC, 5, 0, 0, 0, &plip1_dev, plip_init, };
*/
# undef NEXT_DEV
# define NEXT_DEV (&plip1_dev)
#endif /* PLIP */
Of course there is the standard disclaimer: I received these patches and I put them "as I got them". This means that you try them at your own risk. Anyway, your biggest trouble should be only restore the original files and recompile.
If you have at least 2 parallel ports you can try these patches, that should allow you to use PLIP on a port and LP on the other.
struct lp_struct lp_table[] = {
{ 0x3bc, 0, 0, LP_INIT_CHAR, LP_INIT_TIME, LP_INIT_WAIT, NULL, NULL, },
{ 0x378, 0, 0, LP_INIT_CHAR, LP_INIT_TIME, LP_INIT_WAIT, NULL, NULL, },
/* { 0x278, 0, 0, LP_INIT_CHAR, LP_INIT_TIME, LP_INIT_WAIT, NULL, NULL, }, */
};
3 -> 2
PLIP (parallel port) support (CONFIG_PLIP) [n] y
Parallel Printer support [y] y
lp1 at 0x0378, using polling driver
.....
NET3 PLIP version 2.0 gniibe@mri.co.jp
plip2: Parallel port at 0x278, using assigned IRQ 5.
Again the standard disclaimer, like section 8.1.
After the first release of this Mini-HowTo many people wrote for info about a link between Linux and DOS (or Windows) computer. The general interest lead me to add this chapter, I hope will be of help to everybody.
This section comes from an article I've found on Linux Gazzette by James McDuffie <mcduffie@scsn.net> . It covers the basic installation of a PLIP link between Linux and a DOS computer using Windows and Trumpet WinSock and gives the address of a cool program that let's you run X-Windows programs on Windows.
The last section is an addendum sent by James Vahn jvahn@short.circuit.com where he describes deeply how to set up this link and how to solve many problems.
For any questions about this chapter please contact him, not me.
I suppose you have already set up properly the PLIP support on the Linux side and you have got the right cable, else go back to the previous chapters.
Now, for the DOS side, you need first of all a packet driver. It can be found here:
ftp://ftp.crynwr.com/drivers/plip.zip
The program runs under DOS and acts like a Ethernet Packet driver. If you want to use PLIP with Windows you need also Trumpet Winsock. This serves as the TCP/IP interface. Otherwise, you can probably find TCP/IP software for DOS.
Now go back to the Linux c