soloforce 发表于 2013-5-11 18:16:32

【原创】让CubieBoard具备WIFI AP热点功能

本帖最后由 soloforce 于 2013-5-11 18:18 编辑

本文在Ubuntu/Debian linux for CubieBoard上面构造一个WIFI AP,前提如下:

[*] 物理接口eth0已经接入到互联网
[*] 内核配置好了iptables依赖的相关模块
[*] 拥有一块支持软AP的无线网卡,本文使用的是“巴法络(BUFFALO)WLI-UC-GNM NANO USB无线网卡”


安装软件$ sudo apt-get install hostapd dnsmasq
配置文件

建立hostapd的配置文件/etc/hostapd/hostapd.conf,内容如下(请酌情更改)#Name:Default
#Type:Hostapd
interface=wlan0
driver=nl80211
ssid=CUBIE_WIFI
hw_mode=g
channel=5
wpa=2
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
wpa_passphrase=hello
修改配置文件 /etc/default/hostapd ,设定其中一行为:DAEMON_CONF="/etc/hostapd/hostapd.conf"修改dnsmasq的配置文件/etc/dnsmasq.conf,内容如下#Name:Default
#Type:DNSMASQ
interface=wlan0
dhcp-range=192.168.0.2,192.168.0.255,12h;
server=/www.google.com/8.8.8.8
启动上述两个守护进程$ sudo /etc/init.d/hostapd start
$ sudo /etc/init.d/dnsmasq start
再执行如下配置转发和防火墙规则$ sudo sysctl net.ipv4.ip_forward=1
$ sudo iptables -t nat -A POSTROUTING -oeth0-j MASQUERADE
$ sudo ifconfig wlan0 192.168.0.1 netmask 255.255.255.0
好了,用手机/平板看看可用的WIFI接入点吧。

small29 发表于 2013-6-2 14:03:35

赞!帮了大忙了~:lol

@allen 发表于 2013-11-12 14:27:28

用CT 的WIFI作热点 ,按上面的步骤配置,但好像发不了信号,难道少了内核iptables依赖的相关模块

萤火虫 发表于 2013-11-12 17:34:03

so easy。要是有大功率带天线的usb无线网卡就好了,信号刚刚的

gcd0318 发表于 2013-11-18 14:20:32

建议hostapd还是自己编译一个吧,别直接用现成的,保险

lssebastian 发表于 2014-2-8 16:07:16

按照上面的做法修改了
/etc/hostapd/hostapd.conf
/etc/default/hostapd
/etc/dnsmasq.conf

root@cubieboard2:~# iwlist
Usage: iwlist scanning
             frequency
             channel
             bitrate
             rate
             encryption
             keys
             power
             txpower
             retry
             ap
             accesspoints
             peers
             event
             auth
             wpakeys
             genie
             modulation
支持AP模式

root@cubieboard2:~# /etc/init.d/hostapd start
* Starting advanced IEEE 802.11 management hostapd                                             

应该怎样解决呢?

killercat 发表于 2014-2-8 16:13:47

CT 一直没搞成

killercat 发表于 2014-2-10 12:42:34

killercat 发表于 2014-2-8 16:13
CT 一直没搞成

解决了,主要是 hostapd 版本的问题

GT10NO 发表于 2014-4-2 10:51:23

killercat 发表于 2014-2-10 12:42 static/image/common/back.gif
解决了,主要是 hostapd 版本的问题

8楼,肿么实现的啊?我看了你发的帖子,照着来做,咋不行呢???:'(:'(

KochiyaOcean 发表于 2014-4-3 12:48:25

hostapd.conf 可以添加一句
ieee80211n=1
来开启 802.11n。
只用 802.11g 的话未免太浪费了(笑
页: [1] 2
查看完整版本: 【原创】让CubieBoard具备WIFI AP热点功能