Linux, CLI & WLAN

一次去老板家,老板跟我说,家里的无线网络经常中断,可能是什么问题呢?他家的无线路由器是新买的,应该不会有故障。于是我启动我的Ubuntu,用Linux来诊断一下。

Ubuntu的桌面网络管理工具只是列出所有的无线接入点(AP),但是没有这些点的详细信息。我还得依靠CLI了:

[email protected]:~$ iwlist
Usage: iwlist [interface] scanning [essid NNN] [last]
[interface] frequency
[interface] channel
[interface] bitrate
[interface] rate
[interface] encryption
[interface] keys
[interface] power
[interface] txpower
[interface] retry
[interface] ap
[interface] accesspoints
[interface] peers
[interface] event
[interface] auth
[interface] wpakeys
[interface] genie
[interface] modulation

我所关心的只是频率上的设置,因为多个接入点使用相同的频率,有可能会互相干扰。下面对周围存在的接入点进行扫描:

[email protected]:~$ iwlist wlan0 scan
wlan0     Scan completed :
Cell 01 – Address: 00:25:86:23:CB:DA
ESSID:”tplink”
Mode:Master
Channel:2
Frequency:2.417 GHz (Channel 2)
Quality=83/100  Signal level:-51 dBm  Noise level=-83 dBm
Encryption key:on

既然我只是对Channel信息感兴趣,可以过滤一下:

[email protected]:~$ iwlist wlan0 scan |grep Channel

Channel:2
Frequency:2.417 GHz (Channel 2)

结果我发现周围邻居共有6个接入点共用了一个频率!可能是缺省频率吧…… 赶紧更改了频率设置,搞定!