iwconfig无线工具实现方式
socket->ioctl->sock_ioctl->sock_do_ioctl->dev_ioctl->wext_handle_ioctl->wext_ioctl_dispatch->wireless_process_ioctl->ioctl_standard_call->ioctl_standard_iw_point..-.dev->wireless_handlers
1. hostapd配置
interface=ath0
driver=atheros
ctrl_interface=/var/run/hostapd-ath0
ssid=ChinaNet-1265
max_num_sta=255
auth_algs=1
wpa=2
wpa_passphrase=1227918265
rsn_pairwise=TKIP CCMP
wpa_key_mgmt=WPA-PSK
wps_state=2
ap_pin=12345670
ap_setup_locked=0
device_type=6-0050F204-1
device_name=ChinaNet-1265
manufacturer=GW
model_name=WAP
model_number=123
serial_number=12345
config_methods=1 push_button
ieee80211w=0
eap_server=1
2. wps软触发
hostapd_cli -p /var/run/hostapd-ath%d wps_pbc
3. 创建ath
wlanconfig ath0 create wlandev wifi0 wlanmode ap
4. 设置国家码
"iwpriv wifi0 setCountry cno"
5. 设置ip地址
ifconfig ath xx.xx.xx.xx netmask xx.xx.xx.xx
6. 指定网络出口
iptables -t nat -s %s/24 -A POSTROUTING -j MASQUERADE
7. 创建桥设备
brctl addbr test
ifconfig test up
brctl addif test ath1 将设备添加到桥
8.设置工作模式
iwpriv athx mode 11B
9. 设置工作信道
iwconfig athx channel n
10. 设置隐藏ssid
iwpriv athx hide_ssid 1/0
11.设置用户隔离
iwpriv athx ap_bridge 0/1
12. 开启wmm
iwpriv athx wmm 1/0
13.开启uapsd
iwpriv athx uapsd 1/0
14.设置beacon时间间隔
iwpriv athx bintval x
15. 设置dtim时间间隔
iwpriv athx dtim_period x
16. 设置速率
iwconfig athx rate auto
17.设置发射功率
iwconfig athx txpower 5mW
18. 设置mac过滤
iwpriv athx maccmd 0/1/2/3
iwpriv athx addmac xx:xx:xx:xx:xx:xx
19. 设置wep
iwconfig athx key [%d]
iwconfig ath%d key s:%s
iwconfig ath%d key %s
阅读(3201) | 评论(0) | 转发(0) |