hostapd交叉编译及测试脚本

Hostapd的功能就是作为softAP的认证服务器,负责控制管理stations(通常可以认为带无线网卡的PC)的接入和认证。hostapd一般与wpa_supplicant同时提供,这个东西是实现WPA加密认证的。

 

cp defconfig .config
vi .config

CFLAGS += -I/home/imx6s/third/libnl-3.2.25/include/

CFLAGS += -I/home/imx6s/third/openssl-1.0.1e/include/

CFLAGS +=-I/home/imx6s/linux-3.0.101/include/

 

LIBS += -L/home/imx6s/third/libnl-3.2.25/lib-lnl-3

LIBS += -L/home/imx6s/third/openssl-1.0.1e/-lssl -lcrypto

CC=arm-linux-gcc

 

make

../src/drivers/drivers.o:(.data+0x0):undefined reference to `wpa_driver_nl80211_ops'

../src/crypto/crypto_openssl.o: In function`md4_vector':

/home/imx6s/third/RTL8188-hostapd-master/hostapd/../src/crypto/crypto_openssl.c:117:undefined reference to `EVP_md4'

这个错其实跟openssl的lib有关系,将EVP_md4改为EVP_md5就可以了。

../src/drivers/driver_nl80211.c:1695:2:error: too few arguments to function 'genl_ctrl_alloc_cache'

vi .config       先mask掉
#CONFIG_DRIVER_NL80211=y

但安装时hostapd -d/etc/hostapd.conf &,出现如下问题:

Configuration file: /etc/hostapd.conf

Line 2: invalid/unknown driver 'nl80211'

看来这个driver的编译问题是必须要解决的。

从官网上下载的hostapd-1.0版本编译的时候会出错,因为它没有支持nl80211的驱动。

 (../src/drivers/driver_nl80211.c:95:9: error:too few arguments to function ‘genl_ctrl_alloc_cache’)

git clonegit://w1.fi/srv/git/hostap.git hostapd这里下载编译才没有错误。

新建 vi /etc/hostapd/hostapd.conf 

interface=wlan0
#interface=wlan0
driver=nl80211
#driver=madwifi
ssid=YOUR_SSID
channel=9
hw_mode=g
macaddr_acl=0
ignore_broadcast_ssid=0
auth_algs=1
wpa=3
wpa_passphrase=YOUR_PASSPHRASE
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP

最后执行:hostapd-d /etc/hostapd/hostapd.conf 

同时,libnl也不要用最新的libnl3.2.25,改为libnl-1.1.4。明显这是hostapd没有随libnl同步更新所导致的。

 

开启NAT功能后就可以连接WAN了。

iptables -t nat -A POSTROUTING -o eth0 -jMASQUERADE

 

测试脚本:

insmod/lib/modules/mlan.ko;insmod /lib/modules/sd8xxx.ko drv_mode=2 cfg80211_wext=12

ifconfig uap0192.168.0.1

udhcpd/etc/udhcpd.conf

hostapd -d/etc/hostapd.conf &

 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

草根大哥

进军大神程序员路上,谢谢支持!

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值