📄 00000003.htm
字号:
<HTML><HEAD> <TITLE>BBS水木清华站∶精华区</TITLE></HEAD><BODY><CENTER><H1>BBS水木清华站∶精华区</H1></CENTER>发信人: <A HREF="mailto:jllin.bbs@cis.nctu.edu.tw">jllin.bbs@cis.nctu.edu.tw</A> (肥猫喵喵), 看板: Linux <BR>标 题: Re: 请教用Linux ppp连接seednet的问题 <BR>发信站: 交大资科_BBS (Sat Nov 30 04:02:16 1996) <BR>转信站: sob!netnews.ntu!linux2.tpml!UUserv.Net.tw!news.cis.nctu!cisnews.cis.nc <BR> <BR>==> 在 <A HREF="mailto:hugh@tpts1.seed.net.tw">hugh@tpts1.seed.net.tw</A> (Hugh Wu) 的文章中提到: <BR>><I> 29 Nov 1996 13:46:42 GMT Jack Yang says... </I><BR>><I> > 若有 pap 需要如何设定, </I><BR>><I> +pap。 </I><BR> ^^^^ <BR> 这个指令会要求对方通过你的 PAP Auth. <BR> 当然结果是对方送来的Package中 username 及 password 都是空的 <BR> 这是当做 Server 用的 <BR> <BR>><I> > 我曾经看过,忘了... 可否各知.... </I><BR>><I> 可能还需要一个 +ua <档名>。 </I><BR> <BR>pppd-2.2.0f 有 ppp-on ppp-off redialer ppp-on-dialer 等现成的 script <BR>稍加修改即可使用 <BR> <BR> <BR> <BR>至於 PAP .... 提供我用的命令稿(也是修改自pppd-2.2.0f现成的命令稿) <BR> <BR>ppp-on : 执行档 <BR>=========================== <BR>#!/bin/sh <BR>DEVICE=/dev/cua0 <--- port <BR>LOCAL_IP=0.0.0.0 \___ 视需要而定 <BR>REMOTE_IP=0.0.0.0 / <BR>NETMASK=255.255.255.0 <--- netmask <BR>MTU=296 <--- mtu or mru <BR>DIALER_SCRIPT=$HOME/bin/redialer <--- chat 命令稿 <BR>OPTION_FILE=$HOME/.ppp-option <--- 自己的 pppd 预设档 <BR>PAP_SECRET_FILE=$HOME/.pap-secrets <--- PAP 验证用的 ID 及 password <BR>exec /usr/sbin/pppd \ <BR> connect $DIALER_SCRIPT \ <BR> $DEVICE 57600 \ <BR> debug lock \ <BR> file $OPTION_FILE \ <BR> netmask $NETMASK \ <BR> crtscts modem defaultroute mru $MTU mtu $MTU \ <BR> $LOCAL_IP:$REMOTE_IP \ <BR> remotename "" \ <BR> noipdefault +ua $PAP_SECRET_FILE <BR>============================ <BR> <BR> <BR>redialer : 顾名思义, 可以自动重拨 (执行档) <BR>============================ <BR>#!/bin/sh <BR>################################################################### <BR># <BR># These parameters control the attack dialing sequence. <BR># <BR># Maximum number of attempts to reach the telephone number(s) <BR>MAX_ATTEMPTS=20 <BR> <BR># Delay between each of the attempts. This is a parameter to sleep <BR># so use "15s" for 15 seconds, "1m" for 1 minute, etc. <BR>SLEEP_DELAY=5s <BR> <BR>################################################################### <BR># <BR># This is a list of telephone numbers. Add new numbers if you wish <BR># and see the function 'callall' below for the dial process. <BR>PHONE1=123-4567 <BR>#PHONE2=411 <BR> <BR>################################################################### <BR># <BR># If you use the ppp-on script, then these are passed to this routine <BR># automatically. There is no need to define them here. If not, then <BR># you will need to set the values. <BR># <BR>#ACCOUNT=my_account_name <BR>#PASSWORD=my_password <BR> <BR>################################################################### <BR># <BR># Function to initialize the modem and ensure that it is in command <BR># state. This may not be needed, but it doesn't hurt. <BR># <BR>function initialize <BR>{ <BR> chat -v TIMEOUT 3 '' AT 'OK-+++\c-OK' <BR> return <BR>} <BR> <BR>################################################################### <BR># <BR># Script to dial a telephone <BR># <BR>function callnumber <BR>{ <BR>chat -v \ <BR> ABORT '\nBUSY\r' \ <BR> ABORT '\nNO ANSWER\r' \ <BR> ABORT '\nRINGING\r\n\r\nRINGING\r' \ <BR> '' ATDT$1 \ <BR> CONNECT '' <BR> <BR># <BR># If the connection was successful then end the whole script with a <BR># success. <BR># <BR> if [ "$?" = "0" ]; then <BR> exit 0 <BR> fi <BR> <BR> return <BR>} <BR> <BR>################################################################### <BR># <BR># Script to dial any telephone number <BR># <BR>function callall <BR>{ <BR># echo "dialing attempt number: $1" >/dev/console <BR> callnumber $PHONE1 <BR># callnumber $PHONE2 <BR>} <BR> <BR>################################################################### <BR># <BR># Initialize the modem to ensure that it is in the command state <BR># <BR>initialize <BR>if [ ! "$?" = "0" ]; then <BR> exit 1 <BR>fi <BR> <BR># <BR># Dial telephone numbers until one answers <BR># <BR>attempt=0 <BR>while : ; do <BR> attempt=`expr $attempt + 1` <BR> callall $attempt <BR> if [ "$attempt" = "$MAX_ATTEMPTS" ]; then <BR> exit 1 <BR> fi <BR> sleep "$SLEEP_DELAY" <BR>done <BR>=========================================== <BR> <BR> <BR> <BR>$HOME/.pap-secrets : 只有两行 <BR>========================================== <BR>ID <BR>PASSWORD <BR>========================================= <BR> <BR>$HOME/.ppp-option : 不是很重要, 反正在命令稿中都重新设定了 <BR>========================================= <BR>asyncmap 00000000 <BR>netmask 255.255.255.0 <BR>-proxyarp <BR>lock <BR>crtscts <BR>modem <BR>========================================= <BR>-- <BR> * Origin: ★ 交通大学资讯科学系 BBS ★ <bbs.cis.nctu.edu.tw: 140.113.23.3> <BR><CENTER><H1>BBS水木清华站∶精华区</H1></CENTER></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -