zoukankan      html  css  js  c++  java
  • Hostapd

    Hostapd 

    一、基本概念

     hostapd is an application used to setup your wireless interface as an access-point (master mode). Hostapd requires a configuration file in order to operate, and in addition, it needs to support the driver used for the wireless interface.

    二、用途

    To use hostapd, you have two choices.

    1. use hostapd as a global service
    2. use hostapd as a standalone user application

    1、Global Service

      If you install hostapd through yum (Fedoras package system), it comes with some startup scripts located in /etc/init.d. To use the service, you have to create a configuration file, put it in/etc/hostapd/hostapd.conf and issue the service hostapd start|restart|stop command.

    2、Standalone User Application (Preferred)

      This allows you to tailor hostapd for your experiments and set the configuration to your preferences. But as you most of the time would use nearly identical configurations, you may create a configuration file which you use for several experiments.

    终端应用

    如果已经准备好配置文件hostapd.conf,可以通过下面的指令启动hostapd程序:

    hostapd /path/to/file/hostapd.conf
    

    hostapd将以终端应用的方式运行,并可以通过Ctrl+C终止程序的运行。

    后台程序

    如果不想以终端应用的方式运行hostapd,可以以后台程序的方式运行它:

    # hostapd -B /path/to/file/hostapd.conf

    为了能kill掉hostapd,需要通过指令将hostapd的pid写入到文件中: 

    hostapd -B -P/path/to/pid/hostapd.pid /path/to/file/hostapd.conf
    

    上述指令会将hostapd的pid写入到文件hostapd.pid中

    查看hostapd的状态

    ps aux | grep hostapd
    

    三、配置  

    For running a WPA-PSK access-point one may use a configuration file like the one below

    ssid=test
    hw_mode=g
    channel=10
    interface=wlan0
    bridge=br0
    driver=nl80211
    ignore_broadcast_ssid=0
    macaddr_acl=0
    accept_mac_file=/etc/hostapd.accept
    deny_mac_file=/etc/hostapd.deny
    • ssid:别人所看到的无线接入点的名称;
    • hw_mode:指定802.11协议,其中 a = IEEE 802.11a, b = IEEE 802.11b, g = IEEE 802.11g;
    • channel:设定无线频道;
    • interface:接入点设备名称,注意不要包含ap后缀,即如果该设备称为wlan0ap,填写wlan0即可;
    • bridge:指定所处网桥;
    • driver:设定无线驱动;
    • macaddr_acl:可选,指定MAC地址过滤规则,0表示除非在禁止列表否则允许,1表示除非在允许列表否则禁止,2表示使用外部RADIUS服务器;
    • accept_mac_file:指定允许MAC列表文件所在;
    • deny_mac_file:指定禁止MAC列表文件所在;

     

    相关资料

    参考1:http://w1.fi/hostapd/  

    参考2http://w1.fi/wpa_supplicant/devel/

  • 相关阅读:
    个人博客08
    《新浪微博平台架构》---阅读
    《阿里游戏高可用架构设计实践》---阅读
    《京东咚咚架构演进》---阅读
    《京东话费充值系统架构演进实践》--阅读
    实时获取input框内容
    html:判断两次密码不一致以及阻止提交
    《京东到家库存系统架构设计》---阅读
    《数据蜂巢架构演进之路》---阅读
    SOA案例分析浅谈
  • 原文地址:https://www.cnblogs.com/happygirl-zjj/p/5993472.html
Copyright © 2011-2022 走看看