⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ppp-howto-12.html

📁 这份文件展示如何把你的 Linux PC 连接到一台 PPP 伺服器上
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312"> <META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.7"> <TITLE>PPP HOWTO 中译版: 设定 PPP 连接档案</TITLE> <LINK HREF="PPP-HOWTO-13.html" REL=next> <LINK HREF="PPP-HOWTO-11.html" REL=previous> <LINK HREF="PPP-HOWTO.html#toc12" REL=contents></HEAD><BODY><A HREF="PPP-HOWTO-13.html">Next</A><A HREF="PPP-HOWTO-11.html">Previous</A><A HREF="PPP-HOWTO.html#toc12">Contents</A><HR><H2><A NAME="options"></A> <A NAME="s12">12. 设定 PPP 连接档案</A></H2><P>你必须以 <B>root</B> 身份签入来建立这些目录并且编辑这些设立 PPP 连线所需的档案,即使你想让所有的使用者都能使用 PPP.<P><P>PPP 使用几个档案来建立并设定 PPP 连结.这些档案在 PPP 2.1.2 与 2.2 中的名称与位置都不同.<P><P>在 PPP 2.1.2 中这些档案是:-<HR><PRE>/usr/sbin/pppd               # PPP 执行档/usr/sbin/ppp-on             # 拨号/连线指令稿/usr/sbin/ppp-off            # 断线指令稿/etc/ppp/options             # 所有连线所使用的选项/etc/ppp/options.ttyXX   # 给某一特定通讯埠使用的选项</PRE><HR><P><P>在 PPP 2.2 中这些档案是:-<HR><PRE>/usr/sbin/pppd                  # PPP 执行档/etc/ppp/scripts/ppp-on         # 拨号/连线指令稿/etc/ppp/scripts/ppp-on-dialer  # 拨号的 chat 指令稿部份/etc/ppp/scripts/ppp-off        # 断线指令稿/etc/ppp/options                # 所有连线所使用的选项/etc/ppp/options.ttyXX          # 给某一特定通讯埠使用的选项</PRE><HR><P><P><P>Red Hat Linux 的使用者应注意标准的 Red Hat 4.X 安装将这些指令稿放在 <CODE>/usr/doc/ppp-2.2.0f-2/scripts</CODE>.<P><P>在你的 <CODE>/etc</CODE> 目录里应该要有个目录:<BLOCKQUOTE><CODE><PRE>drwxrwxr-x   2 root     root         1024 Oct  9 11:01 ppp</PRE></CODE></BLOCKQUOTE><P><P>如果它不存在的话 - 以这样的权限建立它.<P><P>如果这个目录已经存在,它应该会包含一个称为 <B>options.tpl</B> 的选项档案样板.这个档案包括在下面.<P><P>因为它包含所有 PPP 选项的解释所以请你把它印出来(配合 pppd 的线上使用手册来阅读将会是很有用的).虽然你可以使用这个档案作为 <CODE>/etc/ppp/options</CODE> 档案的基础,但是建立你自己的,没有包含所有在这个样板里的指令的选项档案可能会更好 - 它会短得多而且比较容易阅读/维护.<P><P>如果你有多个串列线路/数据机(典型的例子是 PPP 伺服器),那麽建立一个一般化的 <CODE>/etc/ppp/options</CODE> 档案,其中包含每个你提供支援拨入的串列埠所使用的共同选项并且为每一个需要个别设定以建立 PPP 连线的串列线路设立个别的选项档案.<P><P>这些档案名为 <CODE>options.ttyx1</CODE>, <CODE>options.ttyx2</CODE> 依此类推(其中 <CODE>x</CODE> 是你串列埠的适当代码).<P><P>然而,对於单一 PPP  连线,你可以直接使用 <CODE>/etc/ppp/options</CODE> 这个档案.另外一种办法,你可以把所有的选项放进 pppd 指令作为参数.<P><P>使用 <CODE>/etc/ppp/options.ttySx</CODE> 档案的设定方式会比较容易加以维护.如果你使用 PPP  来连线到好几个不同的节点去的话,那麽你就可以在 <CODE>/etc/ppp/options.site</CODE> 里面为每个节点建立选项档案然後在你连线时指定选项档案作为 PPP 指令的参数.(使用 <CODE>file option-file</CODE> 参数於 pppd 的指令列).<P><H2><A NAME="ss12.1">12.1 替代的 options.tpl 档案</A></H2><P>某些个 PPP  的发行套件似乎漏失了 options.tpl 这个档案,所以在这里有个完整的档案.我建议你不要直接编辑这个档案来建立你自己的 <CODE>/etc/ppp/options</CODE>.把它拷贝到一个新的档案然後编辑该档案比较好.如果你弄乱了你编辑的档案,你可以回头从原始档案再度开始.<P><HR><PRE># /etc/ppp/options -*- sh -*- general options for pppd# created 13-Jul-1995 jmk# autodate: 01-Aug-1995# autotime: 19:45# Use the executable or shell command specified to set up the serial# line.  This script would typically use the "chat" program to dial the# modem and start the remote ppp session.#connect "echo You need to install a connect command."# Run the executable or shell command specified after pppd has# terminated the link.  This script could, for example, issue commands# to the modem to cause it to hang up if hardware modem control signals# were not available.#disconnect "chat -- \d+++\d\c OK ath0 OK"# async character map -- 32-bit hex; each bit is a character# that needs to be escaped for pppd to receive it.  0x00000001# represents '\x01', and 0x80000000 represents '\x1f'.#asyncmap 0# Require the peer to authenticate itself before allowing network# packets to be sent or received.#auth# Use hardware flow control (i.e. RTS/CTS) to control the flow of data# on the serial port.#crtscts# Use software flow control (i.e. XON/XOFF) to control the flow of data# on the serial port.#xonxoff# Add a default route to the system routing tables, using the peer as# the gateway, when IPCP negotiation is successfully completed.  This# entry is removed when the PPP connection is broken.#defaultroute# Specifies that certain characters should be escaped on transmission# (regardless of whether the peer requests them to be escaped with its# async control character map).  The characters to be escaped are# specified as a list of hex numbers separated by commas.  Note that# almost any character can be specified for the escape option, unlike# the asyncmap option which only allows control characters to be# specified.  The characters which may not be escaped are those with hex# values 0x20 - 0x3f or 0x5e.#escape 11,13,ff# Don't use the modem control lines.#local# Specifies that pppd should use a UUCP-style lock on the serial device# to ensure exclusive access to the device.#lock# Use the modem control lines.  On Ultrix, this option implies hardware# flow control, as for the crtscts option.  (This option is not fully# implemented.)#modem# Set the MRU [Maximum Receive Unit] value to &lt;n> for negotiation.  pppd# will ask the peer to send packets of no more than &lt;n> bytes. The# minimum MRU value is 128.  The default MRU value is 1500.  A value of# 296 is recommended for slow links (40 bytes for TCP/IP header + 256# bytes of data).#mru 542# Set the interface netmask to &lt;n>, a 32 bit netmask in "decimal dot"# notation (e.g. 255.255.255.0).#netmask 255.255.255.0# Disables the default behaviour when no local IP address is specified,# which is to determine (if possible) the local IP address from the# hostname. With this option, the peer will have to supply the local IP# address during IPCP negotiation (unless it specified explicitly on the# command line or in an options file).#noipdefault# Enables the "passive" option in the LCP.  With this option, pppd will# attempt to initiate a connection; if no reply is received from the# peer, pppd will then just wait passively for a valid LCP packet from# the peer (instead of exiting, as it does without this option).#passive# With this option, pppd will not transmit LCP packets to initiate a# connection until a valid LCP packet is received from the peer (as for# the "passive" option with old versions of pppd).#silent# Don't request or allow negotiation of any options for LCP and IPCP# (use default values).#-all# Disable Address/Control compression negotiation (use default, i.e.# address/control field disabled).#-ac# Disable asyncmap negotiation (use the default asyncmap, i.e. escape# all control characters).#-am# Don't fork to become a background process (otherwise pppd will do so# if a serial device is specified).#-detach# Disable IP address negotiation (with this option, the remote IP# address must be specified with an option on the command line or in an# options file).#-ip# Disable magic number negotiation.  With this option, pppd cannot# detect a looped-back line.#-mn# Disable MRU [Maximum Receive Unit] negotiation (use default, i.e.# 1500).#-mru# Disable protocol field compression negotiation (use default, i.e.# protocol field compression disabled).#-pc# Require the peer to authenticate itself using PAP.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -