cubieboard变身AP 分类: ubuntu cubieboard 2014-11-25 14:04 277人阅读 评论(0) 收藏

加载bcmdhd模块:# modprobe bcmdhd

如果你希望开启 AP 模式,那么:# modprobe bcmdhd op_mode=2

/etc/modules文件内添加bcmdhd op_mode=2,以实现bcmdhd模块的开机自动加载。


hostapd安装与配置

参考链接:http://wireless.kernel.org/en/users/Documentation/hostapd#Using_your_distributions_hostapd

安装hostapd:

1,尝试ubuntu下直接安装

sudo apt-get install hostapd 

建立文件名为hostapd-minimal.conf内容如下:

#change wlan0 to your wireless device
interface=wlan0
driver=nl80211
ssid=test
channel=1
如果运行出现下列错误:

hostapd $ sudo hostapd ./hostapd-minimal.conf
Configuration file: ./hostapd-minimal.conf
Line 2: invalid/unknown driver 'nl80211'
1 errors found in configuration file './hostapd-minimal.conf'
那么你就需要编译安装了,如果没有直接配置就好。

2,编译安装

http://w1.fi/hostapd/下载源码包。

tar xzvf hostapd-x.y.z.tar.gz
cd hostapd-x.y.z/hostapd
cp defconfig .config
vi .config

Now find this line:

#CONFIG_DRIVER_NL80211=y

and uncomment it by removing the '#' sign. Repeat for other settings that you may be interested in. The basic configuration, with only this line uncommented is enough to get hostapd up and running with WPA/WPA2 authentication and encryption.

Next, compile hostapd:

make
如果失败,出现类似如下错误:

driver_nl80211.c:21:31: warning: netlink/genl/genl.h: No such file or directory
driver_nl80211.c:22:33: warning: netlink/genl/family.h: No such file or directory
driver_nl80211.c:23:31: warning: netlink/genl/ctrl.h: No such file or directory
driver_nl80211.c:24:25: warning: netlink/msg.h: No such file or directory
driver_nl80211.c:25:26: warning: netlink/attr.h: No such file or directory
说明你需要安装libnl,执行下面的命令:

sudo apt-get install libnl-dev
编译成功之后,再次验证是否成功(cubieboard建议设置/etc/modules文件内添加bcmdhd op_mode=2,重启),正常情况如下:

hostapd # ./hostapd ./hostapd-minimal.conf
Configuration file: ./hostapd-minimal.conf
Using interface wlan1 with hwaddr 00:0d:0b:cf:04:40 and ssid 'test'
到这一步之后,你的AP便可以成功开启了。

3,配置hostapd

编辑hostapd.conf文件
可以根据自己的网卡,参照这里

http://linuxwireless.org/en/users/Documentation/hostap 

下面是一个简单的配置

interface=wlan0
driver=nl80211
ssid=__cubietruck__
channel=1
hw_mode=g
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=12345678
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP

我的电脑成功的能够开启AP,但是手机访问链接的时候无法动态获取IP,采用静态IP的方式可以连接上。

但是神奇的,我查不到用来做AP的cubieboard的局域网IP地址了,而且,在这个过程中,有线网卡莫名其妙的挂了。

环境:cubietruck  linaro

待续

版权声明:本文为博主原创文章,未经博主允许不得转载。

posted @ 2014-11-25 14:04  PaulWeiHan  阅读(221)  评论(0编辑  收藏  举报