升级到8.10 gprs通过蓝牙上网。
发表于 : 2008-11-17 10:49
从8.04 升级到 8.10后,不能通过蓝牙手机接gprs上网。8.10里的网络管理不如8.04里的好用了。
研究了很久。终于找到了解决问题的办法。居然也很简单。
在终端里输入
pon ppp0
就可以连到上手上网了。但是前提是要其它的网卡没有连接上。
也可以用sudo ifconfig eth1 down把当前的活动的网络关掉。
(如果要打开。sudo ifconfig eth1 up),
我的当前活动网卡是eht1. 用的无线网卡。eht0是有线的。没有接上。
pon ppp0,的意思就是拔号,按ppp0里设置的。
我的ppp0在/etc/ppp/peers/ppp0内容是:
defaultroute
persist
/dev/rfcomm0
115200
user "cmwap"
connect "/usr/sbin/chat -v -f /etc/chatscripts/ppp0"
指的是蓝牙猫。要事先设定好。/dev/rcomm0
connect "/usr/sbin/chat -v -f /etc/chatscripts/ppp0"
这句应该就是用/etc/chatscripts/ppp0文件指定的内容来连接吧。
以下是/etc/chatscripts/ppp0的内容
ABORT 'BUSY'
ABORT 'NO CARRIER'
ABORT 'ERROR'
'' AT
OK AT+CGATT=1
OK AT+CGDCONT=1,"IP","cmwap"
OK ATDT*99***1#
在此补充蓝牙猫的设定文件
#
# RFCOMM configuration file.
#
#rfcomm0 {
# # Automatically bind the device at startup
# bind no;
#
# # Bluetooth address of the device
# device 11:22:33:44:55:66;
#
# # RFCOMM channel for the connection
# channel 1;
#
# # Description of the connection
# comment "Example Bluetooth device";
#}
rfcomm0 {
bind yes;
device 00:02:5B:00:A5:A5;
channel 2;
comment “Bluetooth Connection”;
}
重要的东西就是手机的地址device 00:02:5B:00:A5:A5;
和通道号:channel 2;
这是怎么找到的呢?
#
sudo hcitool scan
上面的命令将会得到手机的 mac 地址 (形如 00:00:00:00:00:00), 记录下来.
# 查找手机蓝牙的 DUN 服务信息:
sdptool browse 手机的 mac 地址
在命令的输出中找到”Service Name: Dial-up Networking”, 在项目”Protocol Descriptor List:”中的 “RFCOMM”里有个 “Channel:”, 记住这个数字.
# 编辑 /etc/bluetooth/rfcomm.conf, 在其中加入这么一段:
rfcomm0 {
bind yes;
device 手机的 mac 地址;
channel 手机 rfcomm 的 id;
comment “Bluetooth Connection”;
}
保存.
# 运行
sudo /etc/init.d/bluetooth restart
重启蓝牙服务。
如果你在8。04,里可以上网,现在升到了8。10。只要pon ppp0就可以了
当然,如果你没有ppp0这个文件,可能是/etc/ppp/peers/里其它的文件。打开看一下就知道了。
研究了很久。终于找到了解决问题的办法。居然也很简单。
在终端里输入
pon ppp0
就可以连到上手上网了。但是前提是要其它的网卡没有连接上。
也可以用sudo ifconfig eth1 down把当前的活动的网络关掉。
(如果要打开。sudo ifconfig eth1 up),
我的当前活动网卡是eht1. 用的无线网卡。eht0是有线的。没有接上。
pon ppp0,的意思就是拔号,按ppp0里设置的。
我的ppp0在/etc/ppp/peers/ppp0内容是:
defaultroute
persist
/dev/rfcomm0
115200
user "cmwap"
connect "/usr/sbin/chat -v -f /etc/chatscripts/ppp0"
指的是蓝牙猫。要事先设定好。/dev/rcomm0
connect "/usr/sbin/chat -v -f /etc/chatscripts/ppp0"
这句应该就是用/etc/chatscripts/ppp0文件指定的内容来连接吧。
以下是/etc/chatscripts/ppp0的内容
ABORT 'BUSY'
ABORT 'NO CARRIER'
ABORT 'ERROR'
'' AT
OK AT+CGATT=1
OK AT+CGDCONT=1,"IP","cmwap"
OK ATDT*99***1#
在此补充蓝牙猫的设定文件
#
# RFCOMM configuration file.
#
#rfcomm0 {
# # Automatically bind the device at startup
# bind no;
#
# # Bluetooth address of the device
# device 11:22:33:44:55:66;
#
# # RFCOMM channel for the connection
# channel 1;
#
# # Description of the connection
# comment "Example Bluetooth device";
#}
rfcomm0 {
bind yes;
device 00:02:5B:00:A5:A5;
channel 2;
comment “Bluetooth Connection”;
}
重要的东西就是手机的地址device 00:02:5B:00:A5:A5;
和通道号:channel 2;
这是怎么找到的呢?
#
sudo hcitool scan
上面的命令将会得到手机的 mac 地址 (形如 00:00:00:00:00:00), 记录下来.
# 查找手机蓝牙的 DUN 服务信息:
sdptool browse 手机的 mac 地址
在命令的输出中找到”Service Name: Dial-up Networking”, 在项目”Protocol Descriptor List:”中的 “RFCOMM”里有个 “Channel:”, 记住这个数字.
# 编辑 /etc/bluetooth/rfcomm.conf, 在其中加入这么一段:
rfcomm0 {
bind yes;
device 手机的 mac 地址;
channel 手机 rfcomm 的 id;
comment “Bluetooth Connection”;
}
保存.
# 运行
sudo /etc/init.d/bluetooth restart
重启蓝牙服务。
如果你在8。04,里可以上网,现在升到了8。10。只要pon ppp0就可以了
当然,如果你没有ppp0这个文件,可能是/etc/ppp/peers/里其它的文件。打开看一下就知道了。