Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1260637
  • 博文数量: 548
  • 博客积分: 7597
  • 博客等级: 少将
  • 技术积分: 4224
  • 用 户 组: 普通用户
  • 注册时间: 2010-12-15 13:21
个人简介

嵌入式软件工程师&&太极拳

文章分类

全部博文(548)

文章存档

2014年(10)

2013年(76)

2012年(175)

2011年(287)

分类:

2012-04-25 17:37:26

原文地址:Gentoo: hostapd简单用 作者:maodafi

实现目的:使用hostapd让电脑上的无线网卡工作在AP模式
当前环境:Atheros5212,kernel-2.6.31r6,ath5k,hostapd-v0.6.9
最简使用:

1. 文件/etc/hostapd/hostapd.conf
<1> driver=nl80211
    缺省是hostapd,会导致ioctl[PRISM2_IOCTL_PRISM2_PARAM]错误。
<2> ssid=TESTAP
    网络SSID名称,32个字符以内。
<3> hw_mode=g
    本卡支持b/g模式,故设为g
<4> channel=1
    国内可用频道为1-13,任选一个

2. 文件/etc/conf.d/net
增加:
modules=( "!iwconfig" )
config_wlan0=( "192.168.1.1 netmask 255.255.255.0" )
mode_wlan0="master"

3. 创建net.wlan0接口
ln -s /etc/init.d/net.lo /etc/init.d/net.wlan0

4. 启动hostapd
/etc/init.d/hostapd start

另外需注意的是,如果是kernel-2.6.30及其以前版本,drivers/net/wireless/ath5k/base.c 中的 ath5k_pci_probe函数里,hw->wiphy->interface_modes缺少一个BIT(NL80211_IFTYPE_AP),这会导致wlan0不能工作在master模式。

阅读(1565) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~