ppp-on脚本代码共享


前面我们有文章提及过内核PPP的编制,也讲解过Linux下PPP的设置内容。那么这里我们则补充一下ppp-on脚本内容。那么不多说,具体代码如下:

=================================================================
#ppp-on 脚本
#!/bin/sh
TELEPHONE=*99***1#
LOCAL_IP=0.0.0.0
REMOTE_IP=0.0.0.0
NETMASK=255.255.255.0

DIALER_SCRIPT=/etc/ppp/ppp-on-dialer

exec /bin/pppd debug lock modem nocrtscts /dev/ttyS1 9600 \
asyncmap 20A0000 escape FF kdebug 0 $LOCAL_IP:$REMOTE_IP \
noipdefault netmask $NETMASK defaultroute connect $DIALER_SCRIPT
=================================================================
#ppp-on-dialer
#!/bin/sh
exec /bin/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*99***1# \
CONNECT '' \
================================================================
# options
/dev/ttyS1
9600
debug
kdebug 7
nocrtscts
modem
auth
-chap
noipdefault
defaultroute
user john_doe
lock
================================================================
#pap-secrets
# Secrets for authentication using PAP
# client server secret IP addresses
john_doe * "" *
================================================================
#chap-secrets
# Secrets for authentication using CHAP
# client server secret IP addresses
================================================================

相关内容