Openwrt无线管理工具/命令
2016-03-26 22:37
411 查看
/article/8436462.html
查看连接Openwrt路由的无线客户端:
[cpp] view
plain copy
iwinfo wlan0 assoclist
iw dev wlan0 station dump
查看分配的DHCP客户端IP:
[cpp] view
plain copy
cat /tmp/dhcp.leases
扫描无线路由器/AP:
[cpp] view
plain copy
iwinfo wlan0 scan
查看Openwrt路由无线信息:
[cpp] view
plain copy
iwinfo wlan0 info
wlan0 ESSID: "OpenWrt"
Access Point: 00:1F:A3:65:55:8E
Mode: Master Channel: 5 (2.432 GHz)
Tx-Power: 20 dBm Link Quality: 30/70
Signal: -80 dBm Noise: unknown
Bit Rate: 32.5 MBit/s
Encryption: WPA2 PSK (CCMP)
Type: nl80211 HW Mode(s): 802.11bg
Hardware: unknown [Generic MAC80211]
TX power offset: unknown
Frequency offset: unknown
Supports VAPs: no PHY name: phy0
重启无线:
[cpp] view
plain copy
wifi down && sleep 5 && wifi
一个bash脚本,输出当前无线客户端IP/MAC/名称/速率:
[cpp] view
plain copy
#!/bin/bash
echo -e "# IP address\tname\tMAC address\ttx bit\trx bit"
for interface in `iw dev | grep Interface | cut -f 2 -s -d" "`
do
maclist=(`iw dev $interface station dump | grep Station | cut -f 2 -s -d" "`)
txlist=(`iw dev wlan0 station dump|grep 'tx bitrate'|awk '{print $3$4}'`)
rxlist=(`iw dev wlan0 station dump|grep 'rx bitrate'|awk '{print $3$4}'`)
len=${#maclist[@]}
for ((i=0;i<$len;i++))
do
mac=${maclist[$i]}
tx=${txlist[$i]}
rx=${rxlist[$i]}
ip="UNKN"
host=""
ip=`cat /tmp/dhcp.leases | cut -f 2,3,4 -s -d" " | grep $mac | cut -f 2 -s -d" "`
host=`cat /tmp/dhcp.leases | cut -f 2,3,4 -s -d" " | grep $mac | cut -f 3 -s -d" "`
echo -e "$ip\t$host\t$mac\t$tx\t$rx"|awk '{printf "%-15s %-25s %-15s %-10s %-10s\n",$1,$2,$3,$4,$5}'
done
done
查看连接Openwrt路由的无线客户端:
[cpp] view
plain copy
iwinfo wlan0 assoclist
iw dev wlan0 station dump
查看分配的DHCP客户端IP:
[cpp] view
plain copy
cat /tmp/dhcp.leases
扫描无线路由器/AP:
[cpp] view
plain copy
iwinfo wlan0 scan
查看Openwrt路由无线信息:
[cpp] view
plain copy
iwinfo wlan0 info
wlan0 ESSID: "OpenWrt"
Access Point: 00:1F:A3:65:55:8E
Mode: Master Channel: 5 (2.432 GHz)
Tx-Power: 20 dBm Link Quality: 30/70
Signal: -80 dBm Noise: unknown
Bit Rate: 32.5 MBit/s
Encryption: WPA2 PSK (CCMP)
Type: nl80211 HW Mode(s): 802.11bg
Hardware: unknown [Generic MAC80211]
TX power offset: unknown
Frequency offset: unknown
Supports VAPs: no PHY name: phy0
重启无线:
[cpp] view
plain copy
wifi down && sleep 5 && wifi
一个bash脚本,输出当前无线客户端IP/MAC/名称/速率:
[cpp] view
plain copy
#!/bin/bash
echo -e "# IP address\tname\tMAC address\ttx bit\trx bit"
for interface in `iw dev | grep Interface | cut -f 2 -s -d" "`
do
maclist=(`iw dev $interface station dump | grep Station | cut -f 2 -s -d" "`)
txlist=(`iw dev wlan0 station dump|grep 'tx bitrate'|awk '{print $3$4}'`)
rxlist=(`iw dev wlan0 station dump|grep 'rx bitrate'|awk '{print $3$4}'`)
len=${#maclist[@]}
for ((i=0;i<$len;i++))
do
mac=${maclist[$i]}
tx=${txlist[$i]}
rx=${rxlist[$i]}
ip="UNKN"
host=""
ip=`cat /tmp/dhcp.leases | cut -f 2,3,4 -s -d" " | grep $mac | cut -f 2 -s -d" "`
host=`cat /tmp/dhcp.leases | cut -f 2,3,4 -s -d" " | grep $mac | cut -f 3 -s -d" "`
echo -e "$ip\t$host\t$mac\t$tx\t$rx"|awk '{printf "%-15s %-25s %-15s %-10s %-10s\n",$1,$2,$3,$4,$5}'
done
done
相关文章推荐
- Linux基础--进程管理和作业控制
- 网站建设(1)——域名的类型、选择和购买
- Enum扩展及MVC中DropDownListFor扩展方法的使用
- 网上出名IT技术网站整理
- 建立MyEclipse与Tomcat的连接
- Linux-iptables详解
- Linux内核分析:实验五
- centos7.1与无线网 (芯片rtl8723be)
- 【转】Configuring VM Acceleration on Linux
- 在mac下搭建Apache服务器
- hadoop生态系统学习之路(二)如何编写MR以及运行测试
- Nginx+PHP+mysql
- 使用CSS3实现响应式标题全屏居中和网站前端性能
- WebService学习之旅(四)Apache Axis2的安装
- WebService学习之旅(四)Apache Axis2的安装
- Linux 正则表达
- WebService学习之旅(四)Apache Axis2的安装
- Activemq构建高并发、高可用的大规模消息系统
- 打开网站时发生的请求的细节
- Linux 正则表达