Linux蓝牙热点共享网络,linux下通过蓝牙手机上网

手机:sony ericsson K750C 开通了GPRS

系统:redflag linux desktop 5.0

所用的工具:

pppd(用来拨号的)

rfcomm(用来连接手机拨号服务)

需要的配置文件有2个:

1:/etc/ppp/gprs

内容如下:

/dev/rfcomm0

230400

defaultroute

usepeerdns

user ''

password bobo

nodetach

crtscts

lock

noauth

local

debug

connect "/usr/sbin/chat -v -f /etc/ppp/chat-gprs"

2:/etc/ppp/chat-gprs

TIMEOUT 10

ABORT 'BUSY'

ABORT 'NO ANSWER'

ABORT 'ERROR'

"" 'ATZ'

OK 'AT+CGDCONT=3,"IP","internet3.voicestream.com" '

ABORT 'NO CARRIER'

SAY 'Dialing....\n'

OK 'ATD*99***1#'

CONNECT ''

建立好上述2个文件,执行下面的命令:

1:hcitool scan

取得蓝牙手机地址 00:16:20:31:6C:A8

2:sdptool browser 00:16:20:31:6C:A8

输出如下:

ervice Name: Dial-up Networking

Service RecHandle: 0x10001

Service Class ID List:

"Dialup Networking" (0x1103)

"Generic Networking" (0x1201)

Protocol Descriptor List:

"L2CAP" (0x0100)

"RFCOMM" (0x0003)

Channel: 1

Profile Descriptor List:

"Dialup Networking" (0x1103)

Version: 0x0100

3:rfcomm bind 0 00:16:20:31:6C:A8 1

4 pppd call gprs

输出如下:

Serial connection established.

using channel 25

Using interface ppp0

Connect: ppp0 /dev/rfcomm0

rcvd [LCP ConfReq id=0x1 ]

sent [LCP ConfReq id=0x1 ]

sent [LCP ConfAck id=0x1 ]

rcvd [LCP ConfReq id=0x2 ]

sent [LCP ConfAck id=0x2 ]

rcvd [LCP ConfAck id=0x1 ]

sent [PAP AuthReq id=0x1 user="localhost" password=]

rcvd [PAP AuthAck id=0x1 "Congratulations!"]

Remote message: Congratulations!

sent [IPCP ConfReq id=0x1 ]

sent [CCP ConfReq id=0x1 ]

rcvd [LCP ProtRej id=0x1 80 fd 01 01 00 0c 1a 04 78 00 18 04 78 00]

rcvd [IPCP ConfReq id=0x1]

sent [IPCP ConfNak id=0x1 ]

rcvd [IPCP ConfNak id=0x1 ]

sent [IPCP ConfReq id=0x2 ]

rcvd [IPCP ConfReq id=0x2]

sent [IPCP ConfAck id=0x2]

rcvd [IPCP ConfAck id=0x2 ]

Could not determine remote IP address: defaulting to 10.64.64.64

not replacing existing default route to eth0 [172.16.80.1]

local IP address 10.12.93.62

remote IP address 10.64.64.64

primary DNS address 221.130.33.52

secondary DNS address 221.130.33.60

Script /etc/ppp/ip-up started (pid 29502)

Script /etc/ppp/ip-up finished (pid 29502), status = 0x0

最后修改/etc/resolv.conf

nameserver 221.130.33.52

search localhost

启动网络浏览器即可通过蓝牙手机上网了

http://jsxsongwei.blog.163.com/blog/static/146179782006618105190/

阅读(756) | 评论(0) | 转发(0) |

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值