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

📄 ppp.html

📁 FreeBSD操作系统的详细使用手册
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<pre class="SCREEN"><samp class="PROMPT">#</samp> <kbd class="USERINPUT">pppd</kbd></pre></div><div class="SECT2"><h2 class="SECT2"><a id="AEN30819" name="AEN30819">21.3.3 Using <ttclass="COMMAND">pppd</tt> as a Server</a></h2><p><tt class="FILENAME">/etc/ppp/options</tt> should contain something similar to thefollowing:</p><pre class="PROGRAMLISTING">crtscts                         # Hardware flow controlnetmask 255.255.255.0           # netmask (not required)192.114.208.20:192.114.208.165  # IP's of local and remote hosts                                # local ip must be different from one                                # you assigned to the Ethernet (or other)                                # interface on your machine.                                # remote IP is IP address that will be                                 # assigned to the remote machinedomain ppp.foo.com              # your domainpassive                         # wait for LCPmodem                           # modem line</pre><p>The following <tt class="FILENAME">/etc/ppp/pppserv</tt> script will tell <bclass="APPLICATION">pppd</b> to behave as a server:</p><pre class="PROGRAMLISTING">#!/bin/sh ps ax |grep pppd |grep -v greppid=`ps ax |grep pppd |grep -v grep|awk '{print $1;}'`if [ "X${pid}" != "X" ] ; then        echo 'killing pppd, PID=' ${pid}        kill ${pid}fips ax |grep kermit |grep -v greppid=`ps ax |grep kermit |grep -v grep|awk '{print $1;}'`if [ "X${pid}" != "X" ] ; then        echo 'killing kermit, PID=' ${pid}        kill -9 ${pid}fi# reset ppp interfaceifconfig ppp0 downifconfig ppp0 delete# enable autoanswer modekermit -y /etc/ppp/kermit.ans# run ppppppd /dev/tty01 19200</pre><p>Use this <tt class="FILENAME">/etc/ppp/pppservdown</tt> script to stop the server:</p><pre class="PROGRAMLISTING">#!/bin/sh ps ax |grep pppd |grep -v greppid=`ps ax |grep pppd |grep -v grep|awk '{print $1;}'`if [ "X${pid}" != "X" ] ; then        echo 'killing pppd, PID=' ${pid}        kill ${pid}fips ax |grep kermit |grep -v greppid=`ps ax |grep kermit |grep -v grep|awk '{print $1;}'`if [ "X${pid}" != "X" ] ; then        echo 'killing kermit, PID=' ${pid}        kill -9 ${pid}fiifconfig ppp0 downifconfig ppp0 deletekermit -y /etc/ppp/kermit.noans</pre><p>The following <b class="APPLICATION">kermit</b> script (<ttclass="FILENAME">/etc/ppp/kermit.ans</tt>) will enable/disable autoanswer mode on yourmodem. It should look like this:</p><pre class="PROGRAMLISTING">set line /dev/tty01set speed 19200set file type binaryset file names literalset win 8set rec pack 1024set send pack 1024set block 3set term bytesize 8set command bytesize 8set flow nonepau 1out +++inp 5 OKout ATH0\13inp 5 OKecho \13out ATS0=1\13   ; change this to out ATS0=0\13 if you want to disable                ; autoanswer modeinp 5 OKecho \13exit</pre><p>A script named <tt class="FILENAME">/etc/ppp/kermit.dial</tt> is used for dialing andauthenticating on the remote host. You will need to customize it for your needs. Put yourlogin and password in this script; you will also need to change the input statementdepending on responses from your modem and remote host.</p><pre class="PROGRAMLISTING">;; put the com line attached to the modem here:;set line /dev/tty01;; put the modem speed here:;set speed 19200set file type binary            ; full 8 bit file xferset file names literalset win 8set rec pack 1024set send pack 1024set block 3set term bytesize 8set command bytesize 8set flow noneset modem hayesset dial hangup offset carrier auto                ; Then SET CARRIER if necessary,set dial display on             ; Then SET DIAL if necessary,set input echo onset input timeout proceedset input case ignoredef \%x 0                       ; login prompt countergoto slhup:slcmd                          ; put the modem in command modeecho Put the modem in command mode.clear                           ; Clear unread characters from input bufferpause 1output +++                      ; hayes escape sequenceinput 1 OK\13\10                ; wait for OKif success goto slhupoutput \13pause 1output at\13input 1 OK\13\10if fail goto slcmd              ; if modem doesn't answer OK, try again:slhup                          ; hang up the phoneclear                           ; Clear unread characters from input bufferpause 1echo Hanging up the phone.output ath0\13                  ; hayes command for on hookinput 2 OK\13\10if fail goto slcmd              ; if no OK answer, put modem in command mode:sldial                         ; dial the numberpause 1echo Dialing.output atdt9,550311\13\10               ; put phone number hereassign \%x 0                    ; zero the time counter:lookclear                           ; Clear unread characters from input bufferincrement \%x                   ; Count the secondsinput 1 {CONNECT }if success goto slloginreinput 1 {NO CARRIER\13\10}if success goto sldialreinput 1 {NO DIALTONE\13\10}if success goto slnodialreinput 1 {\255}if success goto slhupreinput 1 {\127}if success goto slhupif &#60; \%x 60 goto lookelse goto slhup:sllogin                        ; loginassign \%x 0                    ; zero the time counterpause 1echo Looking for login prompt.:slloopincrement \%x                   ; Count the secondsclear                           ; Clear unread characters from input bufferoutput \13;; put your expected login prompt here:;input 1 {Username: }if success goto sluidreinput 1 {\255}if success goto slhupreinput 1 {\127}if success goto slhupif &#60; \%x 10 goto slloop         ; try 10 times to get a login promptelse goto slhup                 ; hang up and start again if 10 failures:sluid;; put your userid here:;output ppp-login\13input 1 {Password: };; put your password here:;output ppp-password\13input 1 {Entering SLIP mode.}echoquit:slnodialecho \7No dialtone.  Check the telephone line!\7exit 1; local variables:; mode: csh; comment-start: "; "; comment-start-skip: "; "; end:</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="userppp.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="ppp-troubleshoot.html"accesskey="N">Next</a></td></tr><tr><td width="33%" align="left" valign="top">Using User PPP</td><td width="34%" align="center" valign="top"><a href="ppp-and-slip.html"accesskey="U">Up</a></td><td width="33%" align="right" valign="top">Troubleshooting <acronymclass="ACRONYM">PPP</acronym> Connections</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 &#60;<ahref="mailto:questions@FreeBSD.org">questions@FreeBSD.org</a>&#62;.<br />For questions about this documentation, e-mail &#60;<ahref="mailto:doc@FreeBSD.org">doc@FreeBSD.org</a>&#62;.</small></p></body></html>

⌨️ 快捷键说明

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