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.php
To use hostapd, you have two choices.bash
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.服务器
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.app
若是已经准备好配置文件hostapd.conf,能够经过下面的指令启动hostapd程序:less
hostapd /path/to/file/hostapd.conf
hostapd将以终端应用的方式运行,并能够经过Ctrl+C终止程序的运行。ide
若是不想以终端应用的方式运行hostapd,能够之后台程序的方式运行它:ui
# hostapd -B /path/to/file/hostapd.conf
为了能kill掉hostapd,须要经过指令将hostapd的pid写入到文件中: spa
hostapd -B -P/path/to/pid/hostapd.pid /path/to/file/hostapd.conf
上述指令会将hostapd的pid写入到文件hostapd.pid中rest
ps aux | grep hostapd
For running a WPA-PSK access-point one may use a configuration file like the one belowblog
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