diff options
author | Xin LI <delphij@FreeBSD.org> | 2009-02-24 20:00:44 +0000 |
---|---|---|
committer | Xin LI <delphij@FreeBSD.org> | 2009-02-24 20:00:44 +0000 |
commit | cd9e51b0196fe04568417a7c678df62909ec3162 (patch) | |
tree | f625bdcd32673958991375b10f688cebc55234b5 /zh_CN.GB2312/books/handbook/ppp-and-slip | |
parent | b227896c2086858857f74cc7ff9bf8fb0f6025ca (diff) |
Notes
Diffstat (limited to 'zh_CN.GB2312/books/handbook/ppp-and-slip')
-rw-r--r-- | zh_CN.GB2312/books/handbook/ppp-and-slip/chapter.sgml | 134 |
1 files changed, 82 insertions, 52 deletions
diff --git a/zh_CN.GB2312/books/handbook/ppp-and-slip/chapter.sgml b/zh_CN.GB2312/books/handbook/ppp-and-slip/chapter.sgml index a5d827f31e..171852d65d 100644 --- a/zh_CN.GB2312/books/handbook/ppp-and-slip/chapter.sgml +++ b/zh_CN.GB2312/books/handbook/ppp-and-slip/chapter.sgml @@ -2,7 +2,7 @@ The FreeBSD Documentation Project The FreeBSD Simplified Chinese Project - Original Revision: 1.185 + Original Revision: 1.192 $FreeBSD$ --> @@ -153,8 +153,8 @@ </listitem> <listitem> - <para>您需要一个连接到您的系统, 并做了正确配置的 modem - 或其它设备, 使您能连接到 ISP。</para> + <para>您需要有连接在系统上, 并做了正确配置的 modem, + 或其他能够连接您 ISP 的设备。</para> </listitem> <listitem> @@ -234,17 +234,19 @@ <title><application>PPP</application>自动化配置</title> <indexterm> - <primary>PPP</primary> - <secondary>configuration</secondary> - </indexterm> + <primary>PPP</primary> + <secondary>configuration (配置)</secondary> + </indexterm> <para> <command>ppp</command>和<command>pppd</command>(PPP的内核级实现) - 都使用<filename>/etc/ppp</filename>目录中的配置文件。 用户级 PPP - 的例子可以在 <filename>/usr/share/examples/ppp/</filename> 中找到。</para> + 都使用 <filename class="directory">/etc/ppp</filename> 目录中的配置文件。 用户级 PPP + 的例子可以在 + <filename class="directory">/usr/share/examples/ppp/</filename> 中找到。</para> <para>配置<command>ppp</command>要求根据您的需要编辑几个文件。 编辑哪几个文件取决于您的 - IP 是静态分配还是动态分配的。</para> + IP 是静态分配 (每次都使用同一个地址) + 还是动态分配的 (每次连接到 ISP 都会获得不同的 IP 地址)。</para> <sect4 id="userppp-staticIP"> <title>PPP和静态IP地址</title> @@ -315,9 +317,10 @@ <listitem> <para>标明modem要连接的端口号。 <devicename>COM1</devicename> 对应的设备是 - <filename>/dev/cuad0</filename> + <filename class="devicefile">/dev/cuad0</filename> 而 <devicename>COM2</devicename> - 对应的则是 <filename>/dev/cuad1</filename>。</para + 对应的则是 + <filename class="devicefile">/dev/cuad1</filename>。</para> </listitem> </varlistentry> @@ -482,7 +485,8 @@ protocol: ppp</screen> 模式运行ppp(因为在连接之前已经正确设置了路由表项), 那就不需要再向<filename>ppp.linkup</filename> 添加项。 您可能希望在连接以后创建一个项来调用程序。 这在以后的sendmail的例子中会解释。</para> - <para>示例配置文件可以在目录<filename>/usr/share/examples/ppp/</filename>中找到。</para> + <para>示例配置文件可以在目录 + <filename class="directory">/usr/share/examples/ppp/</filename> 中找到。</para> </sect4> <sect4 id="userppp-dynamicIP"> @@ -656,8 +660,8 @@ exec /usr/sbin/ppp -direct $IDENT</programlisting> <programlisting>pchilds:*:1011:300:Peter Childs PPP:/home/ppp:/etc/ppp/ppp-dialup</programlisting> - <para>创建一个名为 <filename>/home/ppp</filename>的目录作为拨入用户的主目录, - 包含以下这些空文件:</para> + <para>创建一个名为 <filename class="directory">/home/ppp</filename> + 的目录作为拨入用户的主目录, 其中包含以下这些空文件:</para> <screen>-r--r--r-- 1 root wheel 0 May 27 02:23 .hushlogin -r--r--r-- 1 root wheel 0 May 27 02:22 .rhosts</screen> @@ -1058,8 +1062,10 @@ ifconfig_tun0=</programlisting> </step> <step> - <para>确保<filename>tun<replaceable>N</replaceable></filename> - 设备文件在 <filename>/dev</filename> 目录中是可用的。</para> + <para>确保 <filename class="directory">/dev</filename> + 目录中名为 + <filename class="devicefile">tun<replaceable>N</replaceable></filename> + 的设备文件是可用的。</para> </step> <step> @@ -1090,8 +1096,10 @@ ifconfig_tun0=</programlisting> </step> <step> - <para>确保<filename>tun<replaceable>N</replaceable></filename>设备文件在 - <filename>/dev</filename>目录中是可用的。</para> + <para>确保 <filename class="directory">/dev</filename> + 目录中名为 + <filename class="devicefile">tun<replaceable>N</replaceable></filename> + 的设备文件是可用的。</para> </step> <step> @@ -1148,8 +1156,10 @@ ifconfig_tun0=</programlisting> <secondary>kernel PPP</secondary> </indexterm> - <para>在开始设置内核级PPP时, 需要确信<command>pppd</command>已经被定位在<filename>/usr/sbin</filename> 中 - 且存在<filename>/etc/ppp</filename>目录。</para> + <para>在开始配置 PPP 之前, + 请确认 <command>pppd</command> 已经存放在 + <filename class="directory">/usr/sbin</filename> 中, 并且 + <filename class="directory">/etc/ppp</filename> 目录是存在的。</para> <para><command>pppd</command>能在两种模式下工作:</para> @@ -1237,7 +1247,7 @@ defaultroute # put this if you want that PPP server will be your <step> <para>键入下面这行:</para> - <screen>&prompt.root; <userinput>/usr/src/usr.sbin/pppd.new/pppd <replaceable>/dev/tty01</replaceable> <replaceable>19200</replaceable></userinput></screen> + <screen>&prompt.root; <userinput>/usr/sbin/pppd <replaceable>/dev/tty01</replaceable> <replaceable>19200</replaceable></userinput></screen> <para>一定要使用正确的速度和设备名。</para> </step> @@ -1617,9 +1627,14 @@ exit 1 <sect2> <title>检查设备节点</title> - <para>如果您的内核是经过重新配置的, 那么就需要检查<devicename>sio</devicename>设备。 - 如果没有配置过内核, 就没什么可担心的了。 只要查看 - <command>dmesg</command>的输出以找到modem设备:</para> + <para>如果使用的是定制内核, 确认在其编译配置中包含下列配置:</para> + + <programlisting>device sio</programlisting> + + <para>默认的 <literal>GENERIC</literal> 内核中包含了 + <devicename>sio</devicename> 设备, 因此如果您使用的是它的话, + 就不需要担心了。 只要查看 <command>dmesg</command> 输出中是否有 modem + 设备:</para> <screen>&prompt.root; <userinput>dmesg | grep sio</userinput></screen> @@ -1628,7 +1643,7 @@ exit 1 您就会在 <devicename>sio1</devicename> 或 <devicename>COM2</devicename> 上找到它。 如果 modem 设备连接在 <devicename>sio1</devicename> 接口 (在 DOS 中称为<devicename>COM2</devicename>), - 那么您的 modem 将会是 <filename>/dev/cuad1</filename>。</para> + 那么您的 modem 将会是 <filename class="devicefile">/dev/cuad1</filename>。</para> </sect2> <sect2> @@ -1645,7 +1660,7 @@ exit 1 <para>现在我们已经打开了<command>ppp</command>。</para> - <screen>ppp ON example> <userinput>set device <filename>/dev/cuad1</filename></userinput></screen> + <screen>ppp ON example> <userinput>set device <filename class="devicefile">/dev/cuad1</filename></userinput></screen> <para>设置modem设备, 在本例子中是 <devicename>cuad1</devicename>。</para> @@ -1664,7 +1679,7 @@ exit 1 <para>切换到 <quote>终端</quote>样我们就能手动地控制这台 modem 的模式。</para> - <programlisting>deflink: Entering terminal mode on <filename>/dev/cuad1</filename> + <programlisting>deflink: Entering terminal mode on <filename class="devicefile">/dev/cuad1</filename> type '~h' for help</programlisting> <screen><userinput>at</userinput> @@ -2033,13 +2048,13 @@ ppp_profile="adsl"</programlisting> <para>首先需要从 port 完成安装, 然后才能配置 <application>mpd</application> 来满足您的需要, 并完成服务商的配置。 port 会把一系列包括了详细注解的配置文件实例放到 - <filename><replaceable>PREFIX</replaceable>/etc/mpd/</filename>。 + <filename class="directory"><replaceable>PREFIX</replaceable>/etc/mpd/</filename>。 注意, 这里的 <replaceable>PREFIX</replaceable> 表示 ports 安装的目录, 默认情况下, 应该是 - <filename>/usr/local/</filename>。 + <filename class="directory">/usr/local/</filename>。 关于配置 <application>mpd</application> 的完整说明, 会以 HTML 格式随 port 一起安装。 这些文件将放在 - <filename><replaceable>PREFIX</replaceable>/share/doc/mpd/</filename>。 + <filename class="directory"><replaceable>PREFIX</replaceable>/share/doc/mpd/</filename>。 下面是通过 <application>mpd</application> 连接 ADSL 服务的一个简单例子。 配置被分别放到了两个文件中, 第一个是 <filename>mpd.conf</filename>:</para> @@ -2211,25 +2226,31 @@ tun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1500 <indexterm><primary>SLIP</primary></indexterm> <sect2 id="slipc"> - <title>设置SLIP客户端</title> - <indexterm><primary>SLIP</primary><secondary>client</secondary></indexterm> + <title>设置 SLIP 客户端</title> + + <indexterm> + <primary>SLIP</primary> + <secondary>client (客户端)</secondary> + </indexterm> + <para>下面是在静态主机网络上配置 FreeBSD 机器使用 SLIP 的方法。 对于动态主机名分配 (您的地址会随每次拨号而不同), 您可能需要稍复杂一些的设置。</para> <para>首先, 您需要确认调制解调器所连接的串口。 许多人会设置一个符号连接, 例如 - <filename>/dev/modem</filename>, 用以指向实际的设备名, - <filename>/dev/cuadN</filename>。 - 这样您就可以对实际的设备名进行抽象, - 以备调制解调器换到其他串口时方便调整之用。 - 不然, 在系统中修改一大堆 <filename>/etc</filename> 下的文件以及 - <filename>.kermrc</filename> 将是非常麻烦的事情!</para> + <filename class="devicefile">/dev/modem</filename>, 用以指向实际的设备名, 如 + <filename class="devicefile">/dev/cuad<replaceable>N</replaceable></filename>。 + 这样您就可以对实际的设备名进行抽象, + 以备调制解调器换到其他串口时方便调整之用。 不然, 修改 + <filename class="directory">/etc</filename> 和遍布于系统中的 <filename>.kermrc</filename> + 文件将是一件很麻烦的事情!</para> <note> - <para><filename>/dev/cuad0</filename> 对应 - <devicename>COM1</devicename>, 而 <filename>cuad1</filename> - 则对应 <devicename>COM2</devicename>, 等等。</para> + <para><filename class="devicefile">/dev/cuad0</filename> 对应 + <devicename>COM1</devicename>, 而 <filename class="devicefile">/dev/cuad1</filename> + 则对应 + <devicename>COM2</devicename>, 等等。</para> </note> <para>确保您的内核文件包含以下内容:</para> @@ -2562,12 +2583,15 @@ water.CS.Example localhost.Example. UGH 34 47641234 lo0 - 0.438 <para>默认情况下, 您的 &os; 计算机不会转发包。 如果您希望将 FreeBSD SLIP 服务器作为路由器使用, 就需要修改 <filename>/etc/rc.conf</filename> 文件, - 并加入一项将 <literal>gateway_enable</literal> 变量设为 - <option>YES</option> 的设制。</para> + 将 <literal>gateway_enable</literal> 变量设为 + <option>YES</option>。 这样下次系统引导时就能够保持这一配置了。</para> + + <para>要立即应用这些配置, 可以 <username>root</username> + 的身份运行:</para> - <para>接下来需要重新启动以便使新设置生效。</para> + <screen>&prompt.root; /etc/rc.d/routing start</screen> - <para>请参见 <xref linkend="kernelconfig"> 以了解如何配置 FreeBSD + <para>请参阅 <xref linkend="kernelconfig"> 以了解如何配置 FreeBSD 内核, 并获得在重新配置内核方面的指导。</para> </sect3> @@ -2575,10 +2599,14 @@ water.CS.Example localhost.Example. UGH 34 47641234 lo0 - 0.438 <title>Sliplogin配置</title> <para>正如先前所提到的, - <filename>/etc/sliphome</filename>目录有三个文件构成<filename>/usr/sbin/sliplogin</filename>的配置 - (参考<command>sliplogin</command>的联机手册&man.sliplogin.8;):<filename>slip.hosts</filename>, - 定义SLIP用户及有关IP地址; <filename>slip.login</filename>, 一般只配置SLIP接口; 文件 - <filename>slip.logout</filename>(可选的), 串行连接终止时, 撤消<filename>slip.login</filename>所做的修改。</para> + <filename class="directory">/etc/sliphome</filename> 目录中有三个文件, + 它们共同构成 <filename>/usr/sbin/sliplogin</filename> 的配置 (参考 + <command>sliplogin</command> 的联机手册 &man.sliplogin.8;): + 用于定义 SLIP 用户和相关的 IP + 地址的 <filename>slip.hosts</filename>、 + 通常仅用于配置 SLIP 接口的 <filename>slip.login</filename>, 以及 (可选的) + <filename>slip.logout</filename>, 用以撤销由 + <filename>slip.login</filename> 所执行的动作。</para> <sect4> <title>配置 <filename>slip.hosts</filename></title> @@ -2653,10 +2681,12 @@ Shelmerg dc-slip sl-helmerg 0xfffffc00 autocomp</programlisting 路由器上配置一个指向 SLIP 子网的静态路由。</para> <indexterm><primary>Ethernet</primary></indexterm> - <para>如果您要使用 <quote>代理 ARP</quote>的方式, 您需要从SLIP服务器的以太子网中为每个SLIP客户分配IP地址, - 还必须修改<filename>/etc/sliphome/slip.login</filename> 和 + <para>如果要使用 <quote>代理 ARP</quote> + 的方式, 您还需要从 SLIP 服务器的以太子网中为每个 SLIP 客户分配IP地址, + 还必须修改<filename>/etc/sliphome/slip.login</filename> 和 <filename>/etc/sliphome/slip.logout</filename>脚本以使用 - &man.arp.8;来管理proxy-ARP在服务器ARP表中的项。</para> + &man.arp.8;来管理在 SLIP + 服务器 ARP 表中的 <quote>代理 ARP</quote> 项。</para> </sect4> <sect4> |