ppp拨号后无法ping通外网
时间:2008-03-27
来源:互联网
我在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 ''
这时候可以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

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 ''
作者: edisontang 发布时间: 2008-03-27
211.2.65.3 我也ping不通啊

作者: flag 发布时间: 2008-03-27
sorry,没看到是GPRS的,这东西还没玩过。不过楼主把route表show一下先啊,通常ppp拨上去会自己加路由的吧。用什么工具拨号的?log有没有问题?
作者: flag 发布时间: 2008-03-27
是啊,可以自己加也可以自动加的,log中没有提示有任何问题。
作者: edisontang 发布时间: 2008-03-27
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28