un 8 08:52:21 turbo7 pppd[1053]: pppd 2.4.0 started by root, uid 0
Jun 8 08:52:22 turbo7 chat[1054]: timeout set to 8 seconds
Jun 8 08:52:22 turbo7 chat[1054]: abort on (\nBUSY\r)
Jun 8 08:52:22 turbo7 chat[1054]: abort on (\nNO ANSWER\r)
Jun 8 08:52:22 turbo7 chat[1054]: abort on (\nRINGING\r\n\r\nRINGING\r)
Jun 8 08:52:22 turbo7 chat[1054]: send (AT S7=45 S0=0 L1 V1 X4 &c1 E1 Q0^M)
Jun 8 08:52:22 turbo7 chat[1054]: timeout set to 45 seconds
Jun 8 08:52:22 turbo7 chat[1054]: expect (OK)
Jun 8 08:52:22 turbo7 chat[1054]: AT S7=45 S0=0 L1 V1 X4 &c1 E1 Q0^M^M
Jun 8 08:52:22 turbo7 chat[1054]: OK
Jun 8 08:52:22 turbo7 chat[1054]: -- got it
Jun 8 08:52:22 turbo7 chat[1054]: send (ATDT9,16300^M)
Jun 8 08:52:23 turbo7 chat[1054]: expect (CONNECT)
Jun 8 08:52:23 turbo7 chat[1054]: ^M
Jun 8 08:53:01 turbo7 chat[1054]: ATDT9,16300^M^M
Jun 8 08:53:01 turbo7 chat[1054]: CONNECT
Jun 8 08:53:01 turbo7 chat[1054]: -- got it
Jun 8 08:53:01 turbo7 chat[1054]: send (^M)
Jun 8 08:53:01 turbo7 chat[1054]: expect (sername
Jun 8 08:53:01 turbo7 chat[1054]: 38400^M
Jun 8 08:53:01 turbo7 chat[1054]: ^M
Jun 8 08:53:02 turbo7 chat[1054]: ^M
Jun 8 08:53:02 turbo7 chat[1054]: *********************************^M
Jun 8 08:53:02 turbo7 chat[1054]: * Quidway A8010 Internet Server *^M
Jun 8 08:53:02 turbo7 chat[1054]: * welcome!! *^M
Jun 8 08:53:02 turbo7 chat[1054]: *********************************^M
Jun 8 08:53:02 turbo7 chat[1054]: please input username:
Jun 8 08:53:02 turbo7 chat[1054]: -- got it
Jun 8 08:53:02 turbo7 chat[1054]: send (16300^M)
Jun 8 08:53:02 turbo7 chat[1054]: expect (assword
Jun 8 08:53:47 turbo7 chat[1054]: alarm
Jun 8 08:53:47 turbo7 chat[1054]: Failed
Jun 8 08:53:47 turbo7 pppd[1053]: Connect script failed
Jun 8 08:53:48 turbo7 pppd[1053]: Exit.
拨号脚本:
下面就是 ppp-on 的内容:
--------------------------------------------------------------------------------
#!/bin/sh
#
# Script to initiate a ppp connection. This is the first part of the
# pair of scripts. This is not a secure pair of scripts as the codes
# are visible with the ps command. However, it is simple.
#
# These are the parameters. Change as needed.
TELEPHONE=9,16300 # The telephone number for the connection
ACCOUNT=16300 # The account name for logon (as in George Burns)
PASSWORD=16300 # The password for this account (and Gracie Allen)
LOCAL_IP=0.0.0.0 # Local IP address if known. Dynamic = 0.0.0.0
REMOTE_IP=0.0.0.0 # Remote IP address if desired. Normally 0.0.0.0
NETMASK=255.255.255.0 # The proper netmask if needed
#
# Export them so that they will be available at ppp-on-dialer time. export TELEPHONE ACCOUNT PASSWORD
#
# This is the location of the script which dials the phone and logs
# in. Please use the absolute file name as the $PATH variable is not
# used on the connect option. (To do so on a root account would be
# a security hole so dont ask.)
#
DIALER_SCRIPT=/etc/ppp/ppp-on-dialer
#
# Initiate the connection
#
# I put most of the common options on this command. Please, dont
# forget the lock option or some programs such as mgetty will not
# work. The asyncmap and escape will permit the PPP link to work with
# a telnet or rlogin connection. You are welcome to make any changes
# as desired. Dont use the defaultroute option if you currently
# have a default route to an ethernet gateway.
#
exec /usr/sbin/pppd debug lock modem crtscts /dev/ttyS0 38400 \
asyncmap 20A0000 escape FF kdebug 0 $LOCAL_IPREMOTE_IP \
noipdefault netmask $NETMASK defaultroute connect $DIALER_SCRIPT
下面是 ppp-on-dialer 实现自动拨号:
--------------------------------------------------------------------------------
#!/bin/sh
#
# This is part 2 of the ppp-on script. It will perform the connection
# protocol for the desired connection.
#
exec chat -v \
TIMEOUT 3 \
ABORT \nBUSY\r \
ABORT '\nNO ANSWER\r' \
ABORT '\nRINGING\r\n\r\nRINGING\r' \
'' \rAT \
OK- \c-OK ATH0 \
TIMEOUT 30 \
OK ATDT$TELEPHONE \
CONNECT '' \
sername:--sername: $ACCOUNT \
assword: $PASSWORD