Bring BSD-licensed ext2fs from FreeBSD
[ikiwiki.git] / docs / handbook / handbook-network-plip.mdwn
1 \r
2 \r
3 ## 19.15 Parallel Line IP (PLIP) \r
4 \r
5 PLIP lets us run TCP/IP between parallel ports. It is useful on machines without network cards, or to install on laptops. In this section, we will discuss:\r
6 \r
7
8 * Creating a parallel (laplink) cable.\r
9
10 * Connecting two computers with PLIP.\r
11 \r
12 ### 19.15.1 Creating a Parallel Cable \r
13 \r
14 You can purchase a parallel cable at most computer supply stores. If you cannot do that, or you just want to know how it is done, the following table shows how to make one out of a normal parallel printer cable.\r
15 \r
16  **Table 19-1. Wiring a Parallel Cable for Networking** \r
17 \r
18 [[!table  data="""
19 | A-name | A-End | B-End | Descr. | Post/Bit 
20  DATA0<<BR>> -ERROR | 2<<BR>> 15 | 15<<BR>> 2 | Data | 0/0x01<<BR>> 1/0x08 
21  DATA1<<BR>> +SLCT | 3<<BR>> 13 | 13<<BR>> 3 | Data | 0/0x02<<BR>> 1/0x10 
22  DATA2<<BR>> +PE | 4<<BR>> 12 | 12<<BR>> 4 | Data | 0/0x04<<BR>> 1/0x20 
23  DATA3<<BR>> -ACK | 5<<BR>> 10 | 10<<BR>> 5 | Strobe | 0/0x08<<BR>> 1/0x40 
24  DATA4<<BR>> BUSY | 6<<BR>> 11 | 11<<BR>> 6 | Data | 0/0x10<<BR>> 1/0x80 
25  GND | 18-25 | 18-25 | GND | - |\r
26 """]]\r
27 ### 19.15.2 Setting Up PLIP \r
28 \r
29 First, you have to get a laplink cable. Then, confirm that both computers have a kernel with [lpt(4)](http://leaf.dragonflybsd.org/cgi/web-man?command#lpt&section4) driver support:\r
30 \r
31     \r
32     # grep lp /var/run/dmesg.boot\r
33     lpt0: &lt;Printer&gt; on ppbus0\r
34     lpt0: Interrupt-driven port\r
35 \r
36 \r
37 The parallel port must be an interrupt driven port. You should have a line similar to the following in your kernel configuration file:\r
38 \r
39     \r
40     device ppc0 at isa? irq 7\r
41 \r
42 \r
43 Then check if the kernel configuration file has a `device plip` line or if the `plip.ko` kernel module is loaded. In both cases the parallel networking interface should appear when you directly use the [ifconfig(8)](http://leaf.dragonflybsd.org/cgi/web-man?command#ifconfig&section8) command.\r
44 \r
45     \r
46     # ifconfig lp0\r
47     lp0: flags=8810&lt;POINTOPOINT,SIMPLEX,MULTICAST&gt; mtu 1500\r
48 \r
49 \r
50 Plug in the laplink cable into the parallel interface on both computers.\r
51 \r
52 Configure the network interface parameters on both sites as `root`. For example, if you want connect the host `host1` with `host2`:\r
53 \r
54     \r
55                      host1 &lt;-----&gt; host2\r
56     IP Address    10.0.0.1      10.0.0.2\r
57 \r
58 \r
59 Configure the interface on `host1` by doing:\r
60 \r
61     \r
62     # ifconfig lp0 10.0.0.1 10.0.0.2\r
63 \r
64 \r
65 Configure the interface on `host2` by doing:\r
66 \r
67     \r
68     # ifconfig lp0 10.0.0.2 10.0.0.1\r
69 \r
70 \r
71 You now should have a working connection. Please read the manual pages [lp(4)](http://leaf.dragonflybsd.org/cgi/web-man?command#lp&section4) and [lpt(4)](http://leaf.dragonflybsd.org/cgi/web-man?command=lpt&section=4) for more details.\r
72 \r
73 You should also add both hosts to `/etc/hosts`:\r
74 \r
75     \r
76     127.0.0.1               localhost.my.domain localhost\r
77     10.0.0.1                host1.my.domain host1\r
78     10.0.0.2                host2.my.domain\r
79 \r
80 \r
81 To confirm the connection works, go to each host and ping the other. For example, on `host1`:\r
82 \r
83     \r
84     # ifconfig lp0\r
85     lp0: flags=8851&lt;UP,POINTOPOINT,RUNNING,SIMPLEX,MULTICAST&gt; mtu 1500\r
86             inet 10.0.0.1 --&gt; 10.0.0.2 netmask 0xff000000\r
87     # netstat -r\r
88     Routing tables\r
89     \r
90     Internet:\r
91     Destination        Gateway          Flags     Refs     Use      Netif Expire\r
92     host2              host1              UH          0       0       lp0\r
93     # ping -c 4 host2\r
94     PING host2 (10.0.0.2): 56 data bytes\r
95     64 bytes from 10.0.0.2: icmp_seq#0 ttl255 time=2.774 ms\r
96     64 bytes from 10.0.0.2: icmp_seq#1 ttl255 time=2.530 ms\r
97     64 bytes from 10.0.0.2: icmp_seq#2 ttl255 time=2.556 ms\r
98     64 bytes from 10.0.0.2: icmp_seq#3 ttl255 time=2.714 ms\r
99     \r
100     --- host2 ping statistics ---\r
101     4 packets transmitted, 4 packets received, 0% packet loss\r
102     round-trip min/avg/max/stddev = 2.530/2.643/2.774/0.103 ms\r
103 \r
104 \r
105 \r
106 \r
107 CategoryHandbook\r
108 CategoryHandbook-advancednetworking\r