博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
基于Linux WiFi ap 的hostapd 工具的使用方法
阅读量:4160 次
发布时间:2019-05-26

本文共 1206 字,大约阅读时间需要 4 分钟。

什么是hostapd

hostapd 是用户控件的守护进程用于无线接入点(AP)和授权服务器(authentication servers).
她实现了IEEE802.11的AP管理,IEEE802.1X/WPA/WPA2/EAP授权,RADIUS 客户端,EAP服务器和RADIUS 授权服务器,目前最新版本支持Linux系统(HOST AP,madwifi,mac80211-based驱动)和FreeBSD(net80211)。
hostapd设计为一个守护程序(进程),后台运行,进行一些相关控制授权的操作。属于一个开源项目。
 ———————————————— 
 

 

  执行如下脚本即可

killall -q wpa_supplicant

killall -q udhcpc
killall -q udhcpd
killall -q hostapd
# 以上清除当前网络相关进程是必须的,不然WiFi还有可能工作在sta模式下
echo "start switch to AP mode..."
ifconfig wlan0 down

# 设置当前网卡IP为192.168.43.1,和udhcpd 里面IP要相同

ifconfig wlan0 192.168.43.1 up  
#启动hostap 工具,记得-B表示后台运行
hostapd -B hostapd.cfg
# 启动udhcpd 设置ip地址范围,dns等
udhcpd udhcpd.conf

hostapd.cfg

interface=wlan0

ctrl_interface=/var/run/hostapd
ssid=ap_ssid
wpa=2
wpa_key_mgmt=WPA-PSK
wpa_pairwise=CCMP
wpa_passphrase=12345678
channel=3
driver=nl80211
wme_enabled=1
ieee80211n=1
hw_mode=g
ht_capab=[SHORT-GI-20][SHORT-GI-40][HT40+]
auth_algs=1
max_num_sta=8
   udhcpd.conf

start        192.168.43.20

end        192.168.43.254
interface        wlan0
lease_file    /var/run/udhcpd.leases
opt    dns     8.8.8.8 8.8.4.4
option    subnet    255.255.255.0
opt    router    192.168.43.1
opt    wins    0.0.0.0
option    domain    local
option    lease    864000
    ap 开启成功后,ifconfig 会有ip ,route 有网关,这样手机连接上就可以ping 通了。
 ———————————————— 
 

转载地址:http://yqdxi.baihongyu.com/

你可能感兴趣的文章
The Solution Path Algotithm for Identity-Aware Multi-Object Tracking
查看>>
Groupwise Tracking of Crowded Similar-Appearance Targets from Low-Continuity Image Sequences
查看>>
CDTS: Collaborative Detection, Tracking, and Segmentation for Online Multiple Object Segmentation
查看>>
Deep Network Flow for Multi-Object Tracking
查看>>
Multiple People Tracking by Lifted Multicut and Person Re-identification
查看>>
Multi-Object Tracking with Quadruplet Convolutional Neural Networks
查看>>
关于多目标跟踪的一点理解
查看>>
Learning by tracking:Siamese CNN for robust target association
查看>>
MUSTer:Multi-Store Tracker:A Cognitive Psychology Inspired Approach to Object Tracking
查看>>
Understanding and Diagnosing Visual Tracking Systems
查看>>
Multiple People Tracking by Lifted Multicut and Person Re-identification
查看>>
Visual Tracking Using Attention-Modulated Disintegration and Integration
查看>>
Action-Decision Networks for Visual Tracking with Deep Reinforcement Learning
查看>>
Multiple Object Tracking with High Performance Detection and Appearance Feature
查看>>
深度学习入门(上)-第一章 必备基础知识点
查看>>
ubuntu unzip解压时提示错误 解决方法
查看>>
sprintf函数的说明
查看>>
BOOST_TYPEOF和BOOST_AUTO 作用
查看>>
随机森林概述
查看>>
2011十大战略技术
查看>>