Linux 版 (精华区)
发信人: superman (风雨无阻), 信区: Unix
标 题: 如何使用 Kermit + Modem 上网路
发信站: 紫 丁 香 (Wed Jul 1 07:50:45 1998), 站内信件
【 以下文字转载自 cnlinux 讨论区 】
【 原文由 Gamble_Tan@bbs.ustc.edu.cn 所发表 】
来 源: freebsd.csie.nctu.edu.tw
档 名: 0/System/network/Kermit(使用 70 埠)
标 题: 如何使用 Kermit + Modem 上网路
Last Updated: 95/11/10
From: jou.chen@nematic.ieo.nctu.edu.tw ( 陈威州 Wei-Jou Chen )
Newsgroups: tw.bbs.comp.386bsd
Subject: Re: 请使用数据机的朋友帮忙......
Date: 10 Nov 1995 01:50:14 GMT
Organization: Sweet Home, Hsinchu, Taiwan.
I would like to post my .kermrc file for using kermit to
dial up to NCTU to play with PPP(pppd), SLIP and Terminal server. The macros
'slip' and 'ppp' can be used to play 'slip' and 'ppp'. That means you can just
keyin 'slip' for connection to slip server in NTU after go into kermit. Your
kernel should support ppp and sl.
I am a very poor Chinese typist, so I just can
contribute my example .kermrc file. Have fun!
PS. In FreeBSD, only root can add route table, so the .kermrc is for root.
#------------.kermrc for root ---------------#
;
; basic assignment session
;
assign \%m /dev/cuaa3
assign \%s 57600
assign \%i ATH0L2M1\x0d
;
; basic setting session
;
set line \%m
set modem hayes
set dial init-string \%i
set dial dial-command ATDT%s\x0d
set dial timeout 60
set flow rts/cts
set terminal bytesize 8
set command bytesize 8
set parity none
set speed \%s
set file type binary
set file names literal
set receive packet-length 1024
set send packet-length 1024
set window 8
set block 3
;
; macro definitions session
;
;
; rz and sz macro definitions
;
define rz -
!rz \%1 \%2 \%3 \%4 \%5 \%6 \%7 \%8 \%9 < \v(line) > \v(line)
define sz -
!sz \%1 \%2 \%3 \%4 \%5 \%6 \%7 \%8 \%9 < \v(line) > \v(line)
;
; godial macro definition
;
define godial -
assign \%n 0, -
: dial, -
increment \%n, -
echo dial-up counting numbers: \%n, -
dial 730600, -
if equal \v(dialstatus) 22 goto dial, -
if equal \v(dialstatus) 23 goto dial, -
;
; gotelnet macro definition
;
define gotelnet -
if not equal \v(argc) 2 end 1 Usage: gotelnet hostname, -
assign \%n 0, -
: dial, -
increment \%n, -
echo dial-up counting numbers: \%n, -
dial 730600, -
if equal \v(dialstatus) 22 goto dial, -
if equal \v(dialstatus) 23 goto dial, -
input 50 choice:, if failure stop, -
output 0\x0d, input 10 telnet:, if failure stop, -
output open \%1\x0d, if failure stop, -
connect
;
; slip macro definition
;
define slip -
log session /var/log/kermit.\fsubstr(\v(line),6,10).log append, -
assign \%n 0, -
: dial, -
increment \%n, -
echo dial-up counting numbers: \%n, -
dial 730600, -
if equal \v(dialstatus) 22 goto dial, -
if equal \v(dialstatus) 23 goto dial, -
input 50 choice:, if failure stop, -
clear, -
output 7\x0d, -
input 5 SLIP., -
input 5 Annex address is, -
input 5 ., input 5 ., input 5 ., input 5 ., -
input 5 Your address is, -
input 5 ., input 5 ., input 5 ., input 5 ., -
close session, -
assign \%d \fsubstr(\v(input),43,13), -
assign \%l \fsubstr(\v(input),75,15), -
!ifconfig sl0 inet \%l \%d netmask 0xffffff00 link0 -link2 mtu 1500, -
!route add default \%d, -
!slattach -h -c -s \v(speed) \v(line), -
pause 1, -
suspend, -
open read /var/run/slattach.\fsubstr(\v(line),6,10).pid, -
read \%p, -
!kill -INT \%p, -
!ifconfig sl0 down, -
!ifconfig sl0 delete, -
!route delete default, -
quit
;
; ppp macro definition
;
define ppp -
!touch /etc/ppp/options, -
log session /var/log/kermit.\fsubstr(\v(line),6,10).log append, -
assign \%n 0, -
: dial, -
increment \%n, -
echo dial-up counting numbers: \%n, -
dial 730600, -
if equal \v(dialstatus) 22 goto dial, -
if equal \v(dialstatus) 23 goto dial, -
input 50 choice:, if failure stop, -
clear, -
output 6\x0d, -
input 5 PPP., -
close session, -
!pppd crtscts modem noipdefault passive \v(line) \v(speed), -
pause 5, -
!route add default `tail -n 50 /var/log/messages|grep "pppd"|grep "remote IP"|tail -n 1|cut -d' ' -f10`, -
suspend, -
open read /var/run/ppp0.pid, -
read \%p, -
!kill -INT \%p, -
!ifconfig ppp0 down, -
!ifconfig ppp0 delete, -
!route delete default, -
quit
--Jou
== Wei-Jou Chen ( 陈威州 ) at Chen Sweet Home ==
== Email:jou.chen@nematic.ieo.nctu.edu.tw ==
== Mail : No. 25, Lane 878, Nan-Ta Road, Hsinchu, Taiwan __o ==
== 新竹市南大路878巷25号 _\<,_, ==
== Fax/Data: +886-35-613285 Tel: +886-35-266575 . ..(*)/(*) ==
--
※ 来源: 中国科大BBS站 [bbs.ustc.edu.cn]
--
※ 转载:.紫 丁 香 bbs.hit.edu.cn.[FROM: poster.hit.edu.c]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:2.426毫秒