Linux下通过蓝牙连接手机上网(GPRS/EDGE)
Pubdate:2011-09-21 18:05:55 Categories: linux 1777 ViewsTags: gentoo, linux
第一步,先得配置好本机的蓝牙。这个不详述了,有时间可能另文写。装上gnome-bluetooth,设置好要配对的蓝牙设备,我的是诺基亚E71。
启动 /etc/init.d/buletooth 服务, 运行 hciconfig 命令,看看是否找到了蓝牙设备。
第二步,找出你手机的MAC地址和频道
打开手机的蓝牙,然后在电脑上执行 hcitool scan 命令,搜索你的手机,看看手机的蓝牙的 Mac 地址是多少。然后记下这个地址。
运行
$ sdptool browse <handy-mac-address>
查看是否有Dial-Up Networking字样,并查看对应频道。
第三步,把第二步找到的地址和频道配置到 /etc/bluetooth/rfcomm.conf 文件里面。
# cat /etc/bluetooth/rfcomm.conf
rfcomm0 {
bind yes;
device <replace with mac address>;
channel 4;
comment "Dial up with E71";
}
重启电脑的蓝牙服务。
这时应该能看到
# rfcomm
rfcomm0: 00:00:00:00:00:00 channel 4 closed
# ls -l /dev/rfcomm0
crw-rw---- 1 root uucp 216, 0 Sep 21 16:40 /dev/rfcomm0
第四步,安装wvdial,并按如下配置:
#emerge wvdial
# cat /etc/wvdial.conf
[Dialer Defaults]
Init1 = ATZ
#Init2 = ATQ0 V1 E1 S0=0 >C1 >D2 +FCLASS=0
Init3 = AT+CGDCONT=1,"IP","CMNET","",0,0
Stupid Mode = yes
# 装载类型
;Modem Type = USB Modem
Modem Type = BlueTooth Modem
Phone = *99#
ISDN = 0
New PPPD = yes
# the username and password any
Username = guest
Password = guest
# tty是usb连接使用 rfc是蓝牙使用
#Modem = /dev/ttyACM0
Modem = /dev/rfcomm0
Baud = 460800
Auto DNS = 1
Idle Seconds = 3000
第五步,运行wvdial拨号上网。
Comments(0)