📄 network-plip.html
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta name="generator" content="HTML Tidy, see www.w3.org" /><title>Parallel Line IP (PLIP)</title><meta name="GENERATOR" content="Modular DocBook HTML Stylesheet Version 1.7" /><link rel="HOME" title="FreeBSD Handbook" href="index.html" /><link rel="UP" title="Advanced Networking" href="advanced-networking.html" /><link rel="PREVIOUS" title="Network Address Translation" href="network-natd.html" /><link rel="NEXT" title="IPv6" href="network-ipv6.html" /><link rel="STYLESHEET" type="text/css" href="docbook.css" /></head><body class="SECT1" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#840084"alink="#0000FF"><div class="NAVHEADER"><table summary="Header navigation table" width="100%" border="0" cellpadding="0"cellspacing="0"><tr><th colspan="3" align="center">FreeBSD Handbook</th></tr><tr><td width="10%" align="left" valign="bottom"><a href="network-natd.html"accesskey="P">Prev</a></td><td width="80%" align="center" valign="bottom">Chapter 24 Advanced Networking</td><td width="10%" align="right" valign="bottom"><a href="network-ipv6.html"accesskey="N">Next</a></td></tr></table><hr align="LEFT" width="100%" /></div><div class="SECT1"><h1 class="SECT1"><a id="NETWORK-PLIP" name="NETWORK-PLIP">24.9 Parallel Line IP(PLIP)</a></h1><p>PLIP lets us run TCP/IP between parallel ports. It is useful on machines withoutnetwork cards, or to install on laptops. In this section, we will discuss:</p><ul><li><p>Creating a parallel (laplink) cable.</p></li><li><p>Connecting two computers with PLIP.</p></li></ul><div class="SECT2"><h2 class="SECT2"><a id="NETWORK-CREATE-PARALLEL-CABLE"name="NETWORK-CREATE-PARALLEL-CABLE">24.9.1 Creating a Parallel Cable</a></h2><p>You can purchase a parallel cable at most computer supply stores. If you cannot dothat, or you just want to know how it is done, the following table shows how to make oneout of a normal parallel printer cable.</p><div class="TABLE"><a id="AEN37854" name="AEN37854"></a><p><b>Table 24-1. Wiring a Parallel Cable for Networking</b></p><table border="0" frame="void" class="CALSTABLE"><col /><col /><col /><col /><col /><thead><tr><th>A-name</th><th>A-End</th><th>B-End</th><th>Descr.</th><th>Post/Bit</th></tr></thead><tbody><tr><td><p class="LITERALLAYOUT">DATA0<br />-ERROR</p></td><td><p class="LITERALLAYOUT">2<br />15</p></td><td><p class="LITERALLAYOUT">15<br />2</p></td><td>Data</td><td><p class="LITERALLAYOUT">0/0x01<br />1/0x08</p></td></tr><tr><td><p class="LITERALLAYOUT">DATA1<br />+SLCT</p></td><td><p class="LITERALLAYOUT">3<br />13</p></td><td><p class="LITERALLAYOUT">13<br />3</p></td><td>Data</td><td><p class="LITERALLAYOUT">0/0x02<br />1/0x10</p></td></tr><tr><td><p class="LITERALLAYOUT">DATA2<br />+PE</p></td><td><p class="LITERALLAYOUT">4<br />12</p></td><td><p class="LITERALLAYOUT">12<br />4</p></td><td>Data</td><td><p class="LITERALLAYOUT">0/0x04<br />1/0x20</p></td></tr><tr><td><p class="LITERALLAYOUT">DATA3<br />-ACK</p></td><td><p class="LITERALLAYOUT">5<br />10</p></td><td><p class="LITERALLAYOUT">10<br />5</p></td><td>Strobe</td><td><p class="LITERALLAYOUT">0/0x08<br />1/0x40</p></td></tr><tr><td><p class="LITERALLAYOUT">DATA4<br />BUSY</p></td><td><p class="LITERALLAYOUT">6<br />11</p></td><td><p class="LITERALLAYOUT">11<br />6</p></td><td>Data</td><td><p class="LITERALLAYOUT">0/0x10<br />1/0x80</p></td></tr><tr><td>GND</td><td>18-25</td><td>18-25</td><td>GND</td><td>-</td></tr></tbody></table></div></div><div class="SECT2"><h2 class="SECT2"><a id="NETWORK-PLIP-SETUP" name="NETWORK-PLIP-SETUP">24.9.2 Setting UpPLIP</a></h2><p>First, you have to get a laplink cable. Then, confirm that both computers have akernel with <a href="http://www.FreeBSD.org/cgi/man.cgi?query=lpt&sektion=4"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">lpt</span>(4)</span></a> driversupport:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbd class="USERINPUT">grep lp /var/run/dmesg.boot</kbd>lpt0: <Printer> on ppbus0lpt0: Interrupt-driven port</pre><p>The parallel port must be an interrupt driven port, under FreeBSD 4.X, you shouldhave a line similar to the following in your kernel configuration file:</p><pre class="PROGRAMLISTING">device ppc0 at isa? irq 7</pre><p>Under FreeBSD 5.X, the <tt class="FILENAME">/boot/device.hints</tt> file shouldcontain the following lines:</p><pre class="PROGRAMLISTING">hint.ppc.0.at="isa"hint.ppc.0.irq="7"</pre><p>Then check if the kernel configuration file has a <var class="LITERAL">deviceplip</var> line or if the <tt class="FILENAME">plip.ko</tt> kernel module is loaded. Inboth cases the parallel networking interface should appear when you directly use the <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=ifconfig&sektion=8"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">ifconfig</span>(8)</span></a> command.Under FreeBSD 4.X like this:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbd class="USERINPUT">ifconfig lp0</kbd>lp0: flags=8810<POINTOPOINT,SIMPLEX,MULTICAST> mtu 1500</pre><p>and for FreeBSD 5.X:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbd class="USERINPUT">ifconfig plip0</kbd>plip0: flags=8810<POINTOPOINT,SIMPLEX,MULTICAST> mtu 1500</pre><div class="NOTE"><blockquote class="NOTE"><p><b>Note:</b> The device name used for parallel interface is different betweenFreeBSD 4.X (<tt class="DEVICENAME">lp<var class="REPLACEABLE">X</var></tt>) andFreeBSD 5.X (<tt class="DEVICENAME">plip<var class="REPLACEABLE">X</var></tt>).</p></blockquote></div><p>Plug in the laplink cable into the parallel interface on both computers.</p><p>Configure the network interface parameters on both sites as <ttclass="USERNAME">root</tt>. For example, if you want connect the host <ttclass="HOSTID">host1</tt> running FreeBSD 4.X with <tt class="HOSTID">host2</tt>running FreeBSD 5.X:</p><pre class="PROGRAMLISTING"> host1 <-----> host2IP Address 10.0.0.1 10.0.0.2</pre><p>Configure the interface on <tt class="HOSTID">host1</tt> by doing:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbd class="USERINPUT">ifconfig lp0 10.0.0.1 10.0.0.2</kbd></pre><p>Configure the interface on <tt class="HOSTID">host2</tt> by doing:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbdclass="USERINPUT">ifconfig plip0 10.0.0.2 10.0.0.1</kbd></pre><p>You now should have a working connection. Please read the manual pages <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=lp&sektion=4"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">lp</span>(4)</span></a> and <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=lpt&sektion=4"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">lpt</span>(4)</span></a> for moredetails.</p><p>You should also add both hosts to <tt class="FILENAME">/etc/hosts</tt>:</p><pre class="PROGRAMLISTING">127.0.0.1 localhost.my.domain localhost10.0.0.1 host1.my.domain host110.0.0.2 host2.my.domain</pre><p>To confirm the connection works, go to each host and ping the other. For example, on<tt class="HOSTID">host1</tt>:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbd class="USERINPUT">ifconfig lp0</kbd>lp0: flags=8851<UP,POINTOPOINT,RUNNING,SIMPLEX,MULTICAST> mtu 1500 inet 10.0.0.1 --> 10.0.0.2 netmask 0xff000000<samp class="PROMPT">#</samp> <kbd class="USERINPUT">netstat -r</kbd>Routing tablesInternet:Destination Gateway Flags Refs Use Netif Expirehost2 host1 UH 0 0 lp0<samp class="PROMPT">#</samp> <kbd class="USERINPUT">ping -c 4 host2</kbd>PING host2 (10.0.0.2): 56 data bytes64 bytes from 10.0.0.2: icmp_seq=0 ttl=255 time=2.774 ms64 bytes from 10.0.0.2: icmp_seq=1 ttl=255 time=2.530 ms64 bytes from 10.0.0.2: icmp_seq=2 ttl=255 time=2.556 ms64 bytes from 10.0.0.2: icmp_seq=3 ttl=255 time=2.714 ms--- host2 ping statistics ---4 packets transmitted, 4 packets received, 0% packet lossround-trip min/avg/max/stddev = 2.530/2.643/2.774/0.103 ms</pre></div></div><div class="NAVFOOTER"><hr align="LEFT" width="100%" /><table summary="Footer navigation table" width="100%" border="0" cellpadding="0"cellspacing="0"><tr><td width="33%" align="left" valign="top"><a href="network-natd.html"accesskey="P">Prev</a></td><td width="34%" align="center" valign="top"><a href="index.html"accesskey="H">Home</a></td><td width="33%" align="right" valign="top"><a href="network-ipv6.html"accesskey="N">Next</a></td></tr><tr><td width="33%" align="left" valign="top">Network Address Translation</td><td width="34%" align="center" valign="top"><a href="advanced-networking.html"accesskey="U">Up</a></td><td width="33%" align="right" valign="top">IPv6</td></tr></table></div><p align="center"><small>This, and other documents, can be downloaded from <ahref="ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/">ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/</a>.</small></p><p align="center"><small>For questions about FreeBSD, read the <ahref="http://www.FreeBSD.org/docs.html">documentation</a> before contacting <<ahref="mailto:questions@FreeBSD.org">questions@FreeBSD.org</a>>.<br />For questions about this documentation, e-mail <<ahref="mailto:doc@FreeBSD.org">doc@FreeBSD.org</a>>.</small></p></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -