Networking

當適配器處於 AP 模式時獲取附近的 WiFi 網路列表

  • June 15, 2016

I am trying to get a list of wireless networks nearby while the adapter is acting as an access point but iwlist returns the following error:

$ sudo iwlist wlan0 scan
wlan0     Interface doesn't support scanning : Operation not supported

Is there another way of getting this list, perhaps with another utility? My Tomato powered WRT54 seems to be able to achieve this (listing nearby APs while the device itself is set up as an AP), so I’m curious how I could replicate that behaviour.

Thanks.

iwlist is seriously deprecated. Remove it from your system and never use it again. Do the same with iwconfig, iwspy. Those tools are ancient and were designed in an era where 802.11n didn’t exist. Kernel developers maintain a ugly compatibility layer to still support wireless-tools, and this compatibility layer often lies.


Now install iw if not already done. The iw command you are looking for is

iw dev wlan0 scan ap-force.

這是一個相當新的添加。並非所有驅動程序都支持這一點,但大多數應該這樣做。

引用自:https://unix.stackexchange.com/questions/131372