?? ppp-howto-12.html
字號(hào):
<!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 中譯版: 設(shè)定 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. 設(shè)定 PPP 連接檔案</A></H2><P>你必須以 <B>root</B> 身份簽入來(lái)建立這些目錄并且編輯這些設(shè)立 PPP 連線所需的檔案,即使你想讓所有的使用者都能使用 PPP.<P><P>PPP 使用幾個(gè)檔案來(lái)建立并設(shè)定 PPP 連結(jié).這些檔案在 PPP 2.1.2 與 2.2 中的名稱(chēng)與位置都不同.<P><P>在 PPP 2.1.2 中這些檔案是:-<HR><PRE>/usr/sbin/pppd # PPP 執(zhí)行檔/usr/sbin/ppp-on # 撥號(hào)/連線指令稿/usr/sbin/ppp-off # 斷線指令稿/etc/ppp/options # 所有連線所使用的選項(xiàng)/etc/ppp/options.ttyXX # 給某一特定通訊埠使用的選項(xiàng)</PRE><HR><P><P>在 PPP 2.2 中這些檔案是:-<HR><PRE>/usr/sbin/pppd # PPP 執(zhí)行檔/etc/ppp/scripts/ppp-on # 撥號(hào)/連線指令稿/etc/ppp/scripts/ppp-on-dialer # 撥號(hào)的 chat 指令稿部份/etc/ppp/scripts/ppp-off # 斷線指令稿/etc/ppp/options # 所有連線所使用的選項(xiàng)/etc/ppp/options.ttyXX # 給某一特定通訊埠使用的選項(xiàng)</PRE><HR><P><P><P>Red Hat Linux 的使用者應(yīng)注意標(biāo)準(zhǔn)的 Red Hat 4.X 安裝將這些指令稿放在 <CODE>/usr/doc/ppp-2.2.0f-2/scripts</CODE>.<P><P>在你的 <CODE>/etc</CODE> 目錄里應(yīng)該要有個(gè)目錄:<BLOCKQUOTE><CODE><PRE>drwxrwxr-x 2 root root 1024 Oct 9 11:01 ppp</PRE></CODE></BLOCKQUOTE><P><P>如果它不存在的話 - 以這樣的權(quán)限建立它.<P><P>如果這個(gè)目錄已經(jīng)存在,它應(yīng)該會(huì)包含一個(gè)稱(chēng)為 <B>options.tpl</B> 的選項(xiàng)檔案樣板.這個(gè)檔案包括在下面.<P><P>因?yàn)樗?PPP 選項(xiàng)的解釋所以請(qǐng)你把它印出來(lái)(配合 pppd 的線上使用手冊(cè)來(lái)閱讀將會(huì)是很有用的).雖然你可以使用這個(gè)檔案作為 <CODE>/etc/ppp/options</CODE> 檔案的基礎(chǔ),但是建立你自己的,沒(méi)有包含所有在這個(gè)樣板里的指令的選項(xiàng)檔案可能會(huì)更好 - 它會(huì)短得多而且比較容易閱讀/維護(hù).<P><P>如果你有多個(gè)串列線路/數(shù)據(jù)機(jī)(典型的例子是 PPP 伺服器),那麼建立一個(gè)一般化的 <CODE>/etc/ppp/options</CODE> 檔案,其中包含每個(gè)你提供支援撥入的串列埠所使用的共同選項(xiàng)并且為每一個(gè)需要個(gè)別設(shè)定以建立 PPP 連線的串列線路設(shè)立個(gè)別的選項(xiàng)檔案.<P><P>這些檔案名為 <CODE>options.ttyx1</CODE>, <CODE>options.ttyx2</CODE> 依此類(lèi)推(其中 <CODE>x</CODE> 是你串列埠的適當(dāng)代碼).<P><P>然而,對(duì)於單一 PPP 連線,你可以直接使用 <CODE>/etc/ppp/options</CODE> 這個(gè)檔案.另外一種辦法,你可以把所有的選項(xiàng)放進(jìn) pppd 指令作為參數(shù).<P><P>使用 <CODE>/etc/ppp/options.ttySx</CODE> 檔案的設(shè)定方式會(huì)比較容易加以維護(hù).如果你使用 PPP 來(lái)連線到好幾個(gè)不同的節(jié)點(diǎn)去的話,那麼你就可以在 <CODE>/etc/ppp/options.site</CODE> 里面為每個(gè)節(jié)點(diǎn)建立選項(xiàng)檔案然後在你連線時(shí)指定選項(xiàng)檔案作為 PPP 指令的參數(shù).(使用 <CODE>file option-file</CODE> 參數(shù)於 pppd 的指令列).<P><H2><A NAME="ss12.1">12.1 替代的 options.tpl 檔案</A></H2><P>某些個(gè) PPP 的發(fā)行套件似乎漏失了 options.tpl 這個(gè)檔案,所以在這里有個(gè)完整的檔案.我建議你不要直接編輯這個(gè)檔案來(lái)建立你自己的 <CODE>/etc/ppp/options</CODE>.把它拷貝到一個(gè)新的檔案然後編輯該檔案比較好.如果你弄亂了你編輯的檔案,你可以回頭從原始檔案再度開(kāi)始.<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#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 <n> for negotiation. pppd# will ask the peer to send packets of no more than <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 <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.
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -