LinuxCommandLibrary

iwlist

Scan for available wireless networks

TLDR

Display the list of access points and ad-hoc cells in range

$ iwlist [wireless_interface] scan
copy

Display available frequencies in the device
$ iwlist [wireless_interface] frequency
copy

List the bit-rates supported by the device
$ iwlist [wireless_interface] rate
copy

List the WPA authentication parameters currently set
$ iwlist [wireless_interface] auth
copy

List all the WPA encryption keys set in the device
$ iwlist [wireless_interface] wpakeys
copy

List the encryption key sizes supported and list all the encryption keys set in the device
$ iwlist [wireless_interface] keys
copy

List the various power management attributes and modes of the device
$ iwlist [wireless_interface] power
copy

List generic information elements set in the device (used for WPA support)
$ iwlist [wireless_interface] genie
copy

SYNOPSIS

iwlist interface [command] [options]
iwlist --help
iwlist --version

PARAMETERS

interface
    The name of the wireless network interface (e.g., wlan0, eth1) to query.

scan
    Displays a list of available wireless networks (Access Points) with detailed information like SSID, BSSID, channel, signal quality, and encryption.

frequency / channel
    Shows the frequencies or channels supported and currently in use by the interface.

bitrate / rate
    Lists the supported and current bit rates for the wireless connection.

encryption / keys
    Shows the encryption capabilities of the interface and any active encryption keys.

power / txpower
    Displays the transmit power range and the current transmit power setting.

retry
    Shows the retry limits and timings for wireless transmissions.

ap / accesspoints
    Lists the access points currently associated with the interface or visible (similar to scan in some contexts).

event
    Displays wireless events (e.g., association, deassociation).

auth
    Shows authentication parameters for the wireless connection.

rts
    Displays the RTS (Request To Send) threshold settings.

frag
    Displays the fragmentation threshold settings.

stats
    Shows comprehensive wireless statistics including packets transmitted/received, errors, and signal levels.

peers
    Lists the peers associated with the interface, typically in ad-hoc mode.

--help
    Displays usage information and available commands for iwlist.

--version
    Shows the version of the wireless-tools package that iwlist belongs to.

DESCRIPTION

The iwlist command is a powerful tool for scanning and displaying detailed information about wireless networks and interfaces on Linux systems. It is part of the wireless-tools package, designed to interact with wireless extensions in the Linux kernel. Unlike iwconfig, which primarily configures wireless interfaces, iwlist focuses on providing read-only data, such as available Wi-Fi networks (SSIDs), signal strengths, channels, encryption types, and various other operational parameters. It's frequently used for troubleshooting wireless connectivity issues, discovering nearby access points, and verifying network settings. Its output is typically human-readable, though parsing it programmatically can be challenging due to its unstructured nature.

CAVEATS

Root Privileges: Most iwlist commands, especially scan, require root privileges (or sudo) to execute successfully.
Output Format: The output is primarily designed for human readability, making it somewhat challenging to parse reliably with scripts due to varying formats and whitespace.
Deprecation: On modern Linux distributions, iwlist and the wireless-tools suite are largely superseded by the iw command, which uses the newer Netlink-based nl80211 interface for more robust and consistent wireless management. While still functional, iw is generally preferred for new development and scripting.
Driver Support: Functionality depends on the wireless driver's support for Linux wireless extensions. Newer drivers might offer more comprehensive information via iw.

PROGRAMMATIC PARSING

While iwlist's output is not ideal for scripting due to its unstructured nature, some utilities or manual parsing techniques (e.g., using grep, awk) can extract specific data points. For more robust programmatic interaction, the iw command's JSON output capabilities are often preferred.

REAL-TIME MONITORING

Although not designed for continuous real-time monitoring, iwlist scan can be run in a loop (e.g., watch -n 5 'sudo iwlist wlan0 scan') to periodically refresh and display network conditions or discover new access points.

HISTORY

iwlist is a core component of the wireless-tools package, initially developed by Jean Tourrilhes. It emerged as a standard set of command-line utilities for managing wireless interfaces under Linux using the Wireless Extensions API. For many years, it was the primary tool for interacting with Wi-Fi hardware. With the advent of the more powerful and flexible nl80211 kernel interface, the newer iw command has gradually replaced wireless-tools for modern wireless management, though iwlist remains widely available and functional on many systems.

SEE ALSO

iw(8): A new nl80211 based wireless configuration utility., iwconfig(8): Configure a wireless network interface (part of wireless-tools)., ifconfig(8): Configure network interfaces (generally deprecated, but still common for basic interface status).

Copied to clipboard