LinuxÒÁµéÔ°ÂÛ̳'s Archiver

edisontang ·¢±íÓÚ 2008-3-27 12:48

ppp²¦ºÅºóÎÞ·¨pingͨÍâÍø

ÎÒÔÚlinux2.6.9µÄƽ̨ÉÏÓÃÁËÒ»¸ögprsµÄmodemÀ´²¦ºÅ£¬²¦ºÅ³É¹¦ºóÒ²¸ø·ÖÅäÁËipµØÖ·£¨10.61.23.12£©,peer ipΪ10.0.0.1£¬Ò²·ÖÅäÁËdns(211.2.65.3)
Õâʱºò¿ÉÒÔpingͨ10.0.0.1,
È»ºó½«ppp0½Ó¿Ú×öÎªÈ±Ê¡Íø¹Ø£º
route add default dev ppp0
ÕâʱºòÔÙping 211.2.65.3£¬È´·µ»Øno response from 211.2.65.3.
ÇëÎÊÕâÊÇʲôԭÒò£¬ÈçºÎ½â¾öÄØ£¿£¨ÎÒÏëÕâ¿Ï¶¨²»ÊÇ·ÓɵÄÎÊÌ⣩


PS:

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="*99***1#"
ACCOUNT=CARD
PASSWORD=CARD
APN=CMNET
LOCAL_IP=0.0.0.0
REMOTE_IP=0.0.0.0
NETMASK=255.255.255.0
export TELEPHONE ACCOUNT PASSWORD APN
#
# 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 don't ask.)
#
DIALER_SCRIPT=/etc/ppp-on-dialer
#
# Initiate the connection
#
# I put most of the common options on this command. Please, don't
# 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. Don't use the 'defaultroute' option if you currently
# have a default route to an ethernet gateway.
#
echo $DIALER_SCRIPT
exec /sbin/pppd usehostname -detach noipdefault debug lock modem crtscts 115200 \
/dev/ttyS0 usepeerdns novj asyncmap 20A0000 escape FF kdebug 0 $LOCAL_IP:$REMOTE_IP \
netmask $NETMASK nodefaultroute 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' \
'' AT \
OK ATH \
OK ATE1 \
OK AT+CGATT=1 \
OK 'AT+CGDCONT=1,"IP","$APN"'
OK ATD$TELEPHONE \
TIMEOUT 30
CONNECT ''

flag ·¢±íÓÚ 2008-3-27 16:25

211.2.65.3 ÎÒÒ²ping²»Í¨°¡:lol

flag ·¢±íÓÚ 2008-3-27 16:30

sorry£¬Ã»¿´µ½ÊÇGPRSµÄ£¬Õâ¶«Î÷»¹Ã»Íæ¹ý¡£²»¹ýÂ¥Ö÷°Ñroute±íshowÒ»ÏÂÏȰ¡£¬Í¨³£ppp²¦ÉÏÈ¥»á×Ô¼º¼Ó·Óɵİɡ£ÓÃʲô¹¤¾ß²¦ºÅµÄ£¿logÓÐûÓÐÎÊÌ⣿

edisontang ·¢±íÓÚ 2008-3-27 16:49

Êǰ¡£¬¿ÉÒÔ×Ô¼º¼ÓÒ²¿ÉÒÔ×Ô¶¯¼ÓµÄ£¬logÖÐûÓÐÌáʾÓÐÈκÎÎÊÌâ¡£

Ò³: [1]

Powered by Discuz! Archiver 6.1.0  © 2001-2007 Comsenz Inc.