免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1119 | 回复: 0
打印 上一主题 下一主题

ubuntu下组建基于蓝牙的无线网网络 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-02-14 15:31 |只看该作者 |倒序浏览

如果家里已经有一台台式机上网,那么用蓝牙组建无线网络可以作为wifi之外的另一选择。
在linux下对于蓝牙PAN(personal area network)的构件是非常简单的
假定你有两快蓝牙适配器
地址分别是:
11:22:33:44:55:66   host
66:55:44:22:22:11   client
========================================================================
对于host(也就是你连接外网的台式机)
修改/etc/default/bluetooth
############ PAND                                                               
#                                                                              
# Run pand -- ethernet: creates new network interfaces bnep                  
# that can be configured in /etc/network/interfaces                             
# set to 1 for enabled, 0 for disabled   
PAND_ENABLED=1                                                                  
# Arguments to pand                                                            
# Read the PAN howto for ways to set this up                                    
# http://bluez.sourceforge.net/contrib/HOWTO-PAN      
PAND_OPTIONS="--listen --master --role NAP"
配置host蓝牙适配器ip
修改/etc/network/interfaces
添加
auto bnep0
iface bnep0 inet static
address 192.168.128.1
netmask 255.255.255.0
重启蓝牙服务
sudo /etc/init.d/bluetooth restart
配置网络nat
sudo -s
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
===================================================================
对于client就很简单了
直接修改
修改/etc/default/bluetooth
############ PAND                                                               
#                                                                              
# Run pand -- ethernet: creates new network interfaces bnep                  
# that can be configured in /etc/network/interfaces                             
# set to 1 for enabled, 0 for disabled                                          
PAND_ENABLED=1                                                                  
# Arguments to pand
# Read the PAN howto for ways to set this up
# http://bluez.sourceforge.net/contrib/HOWTO-PAN
PAND_OPTIONS="--role PANU --connect 11:22:33:44:55:66"
配置client蓝牙适配器ip
修改/etc/network/interfaces
添加
auto bnep0
iface bnep0 inet static
address 192.168.128.10
netmask 255.255.255.0
gateway 192.168.128.1
重启蓝牙服务
sudo /etc/init.d/bluetooth restart
你就可以通过蓝牙上网了,以上在ubuntu 6.10下测试通过
注意蓝牙适配器建议买2.0标准理论速度可以达到3Mbps,实际速度在100k左右,基本满足要求


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/13673/showart_247333.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP