背景
iwconfig是用来配置wifi的工具,属于wireless-tools工具集
有些时候在linux上无法找到wireless-tools工具集,需要手动编译,本文记录编译方式,以及一些问题。
要点
- WT工具的背景, WT是HP维护的工具,since1996年
The Linux Wireless Extension and the Wireless Tools are an Open Source project sponsored by Hewlett Packard (through my contribution) since 1996, and build with the contribution of many Linux users all over the world.
The Wireless Extension (WE) is a generic API allowing a driver to expose to the user space configuration and statistics specific to common Wireless LANs. The beauty of it is that a single set of tool can support all the variations of Wireless LANs, regardless of their type (as long as the driver support Wireless Extension). Another advantage is these parameters may be changed on the fly without restarting the driver (or Linux).
The Wireless Tools (WT) is a set of tools allowing to manipulate the Wireless Extensions. They use a textual interface and are rather crude, but aim to support the full Wireless Extension. There are many other tools you can use with Wireless Extensions, however Wireless Tools is the reference implementation.
-iwconfig manipulate the basic wireless parameters
-iwlist allow to initiate scanning and list frequencies, bit-rates, encryption keys…
-iwspy allow to get per node link quality
-iwpriv allow to manipulate the Wireless Extensions specific to a driver (private)
-ifrename allow to name interfaces based on various static criteria
下载编译安装方法
- 下载
git clone https://github.com/HewlettPackard/wireless-tools.git
- 编译
cd wireless-tools/wireless_tools/
make
- 安装
make install
- 共享库处理
vim /etc/ld.so.conf
#添加 /usr/local/lib/
ldconfig #配置生效
- 查看信息
iwconfig --version
实操
- 下载
- 编译
- 安装
异常处理
报错 libiw.so.29: cannot open shared object file
[root@localhost wireless_tools]# iwconfig --version
iwconfig: error while loading shared libraries: libiw.so.29: cannot open shared object file: No such file or directory
该问题出现原因是自己编译后,共享库并未加入全局。WT的工具被make install到了该目录:/usr/local/lib/
加入方式:
将/usr/local/lib/ 加入 /etc/ld.so.conf文件,然后执行ldconfig生效
参考:
https://github.com/HewlettPackard/wireless-tools/tree/master
https://hewlettpackard.github.io/wireless-tools/Tools.html