Linux 下通过蓝牙连手机 GPRS 拨号上网

现在的智能手机一般都有“猫”的功能。因此可以把你的手机当做一个无线猫来用。 如果你的手机开通了 GPRS 流量包月,那么你拨号上网的流量也是算在这个里面的。 因此还是很不错,上海 5 元包月有 30M 流量。

我是通过蓝牙连接手机,然后利用 PPP 拨号。手机是 Blackberry 8820,操作系统是 Debian Etch。笔记本是 Lenovo r61i。 说一下设置的要点。

首先在 Debian 里面安装 bluez-utils 和 pppoe 软件, 然后在硬件上打开你的蓝牙(一般笔记本有开关)。 启动 /etc/init.d/buletooth 服务, 运行 hciconfig 命令,看看是否找到了蓝牙设备。

打开手机的蓝牙,然后在电脑上执行 hcitool scan 命令,搜索你的手机,看看手机的蓝牙的 Mac 地址是多少。然后记下这个地址。配置到 /etc/bluetooth/rfcomm.conf 文件里面。重启电脑的蓝牙服务。

然后是配置 PPP 拨号。 在 /etc/ppp/peers 里面建立文件 gprs,内容如下:

/dev/rfcomm0 115200

connect '/usr/sbin/chat -v -f /etc/ppp/peers/chat-gprs'
crtscts
modem -detach
noccp
defaultroute
usepeerdns
noauth
ipcp-accept-remote
ipcp-accept-local
noipdefault 

建立 /etc/ppp/peers/chat-gprs 文件,内容如下:

'' ATZ OK 
AT+CGDCONT=1,"IP","cmnet"
OK "ATD*99***1#"
CONNECT ''

建立好以后,执行 pon gprs 就能连上网络了。 时间比较仓促,没精力慢慢写一个详细教程,有兴趣的人可以看看 这里, 有什么问题可以留言里面讨论。

Read More:

17 Comments

  1. 1 jerry Commented @ 2009-10-29 10:57Reply to this comment

    不错的指导,我用的8310,不过本子的蓝牙不支持连接,郁闷

  2. 2 西滨 Commented @ 2009-10-29 11:35Reply to this comment

    想问一下反方向怎么做,就是手机怎么通过蓝牙连电脑上网?因为手机没有wifi,但有时要下载mp3或者软件,不想先下载到电脑再下载到手机。

  3. 3 kidfruit Commented @ 2009-10-29 12:07Reply to this comment

    30M的流量手机用感觉不少,用电脑那就…………开个驱动之家流量就差不多over了

  4. 4 hmy Commented @ 2009-10-29 12:56Reply to this comment

    @jerry linux下用barry软件,通过usb线也可以通过黑莓拨号上网

  5. 5 ggarlic Commented @ 2009-10-29 13:09Reply to this comment

    s60可以使用joikuspot把自己手机变成热点 然后电脑就可以共享上网了

  6. 6 Iven Commented @ 2009-10-29 13:10Reply to this comment

    貌似我的手机也能……不过只能用输这样两段咒语的方法办到么……

  7. 7 Xhacker Commented @ 2009-10-29 13:21Reply to this comment

    用Blueman蛮好的。

  8. 8 jack Commented @ 2009-10-29 13:27Reply to this comment

    用数据线连Nokia手机的话,NetWorkManager可以实现图形化的配置

  9. 9 Yousri Commented @ 2009-10-29 13:29Reply to this comment

    方法不错 不是实用性不强吧 毕竟手机流量都很有限的 除非有不限流量的 就可以利用

  10. 10 kurrunk Commented @ 2009-10-29 13:33Reply to this comment

    @西滨: 相同的问题,有人知道吗?

  11. 11 hmy Commented @ 2009-10-29 13:41Reply to this comment

    手机通过电脑上网, 首先你要查一下蓝牙的协议栈里面有没有合适的服务来做这个. 可以考虑电脑上做一个拨号服务器,手机上装一个拨号客户端.具体没验证,比较懂这个的高手出来讲一下吧

  12. 12 hmy Commented @ 2009-10-29 13:50Reply to this comment

    @Yousri 这个主要是用于应急. 特别是对于系统管理员来说.在电脑上ssh总比在手机上ssh强. 要用来做普通的上网浏览,肯定是不行,一是流量,二是速度.

  13. 13 GraphiteCube Commented @ 2009-10-29 19:24Reply to this comment

    不錯的教學, 可惜我的電腦沒有Bluetooth...

  14. 14 yang Commented @ 2009-10-29 20:51Reply to this comment

    这个,拨cmnet花费太高了~拨cmwap则有限制,主要是——两者网速都太慢! 不过,手机通过蓝牙来共享PC的宽带倒是挺有意思的。

  15. 15 yang Commented @ 2009-10-29 20:54Reply to this comment

    @kurrunk: 可以看看我写的这篇博(手机为nokiaN71):Nokia N71通过蓝牙共享PC网络

  16. 16 liu Mingwei Commented @ 2009-10-30 15:39Reply to this comment

    这种实用性在于:背起笔记本在外公干,而且没有可用的网络可用,那么GPRS这种方式就成为一种选择了。除非GPRS速度不错,而且费用很低,那么这种方式就是一种很好的选择。否则,就是既浪费马达,有浪费电的。

  17. 17 Steve Yao Commented @ 2009-11-01 16:07Reply to this comment

    30M流量,不能指望用来浏览站点,但是一般的MSN或QQ的流量还是足够的,我正在使用,上下班的班车上可以保持泡妞状态,呵呵呵~~~~