2008年12月31日星期三

linux下通过Palm手机拨号上网

本文转自吹友吧:http://www.treo.net.cn/bbs/thread-90811-1-2.html


0、以下操作均在root用户下,我用的手机是treo680,装好软件usbmodem,在手机上运行usbmodem
1、安装wvdial,我用的是debian,apt-get install wvdial ppp
2、运行wvdial,会生成/etc/wvdial.conf,按你的实际情况修改一下,网上都有,现付上我用的。
[Dialer Defaults]
Init1 = at+cgdcont=1,"ip","cmwap"
stupid Mode = yes
Modem Type = USB Modem
ISDN = 0
Phone = *99***1#
Modem = /dev/ttyACM0
Username = any
Carrier Check = no
Password = any
Baud = 460800
New PPPD = yes
3、运行wvdial,已经能拨号上网了,但现在有一个问题,就是每2分钟就掉线,解决的方法是
4、读/etc/ppp/options其中有两行:
# If this option is given, pppd will send an LCP echo-request frame to the
# peer every n seconds. Normally the peer should respond to the echo-request
# by sending an echo-reply. This option can be used with the
# lcp-echo-failure option to detect that the peer is no longer connected.
lcp-echo-interval 30

# If this option is given, pppd will presume the peer to be dead if n
# LCP echo-requests are sent without receiving a valid LCP echo-reply.
# If this happens, pppd will terminate the connection. Use of this
# option requires a non-zero value for the lcp-echo-interval parameter.
# This option can be used to enable pppd to terminate after the physical
# connection has been broken (e.g., the modem has hung up) in
# situations where no hardware modem control lines are available.
lcp-echo-failure 4
明白为什么是2分钟就掉线了吧,把那两项注释掉,再拨号上网就没问题了。
5、上网与ie一样,要加代理10.0.0.172:80,debian的apt-get 更新,也要加代理,
在/etc/apt/下添加文件apt.conf,内容:
Acquire::http:roxy "http://10.0.0.172:80";
不要忘了最后的分号。

没有评论: