LinuxCommandLibrary

iw-dev

Configure wireless devices

TLDR

Set device to monitor mode (interface must be down first. See also: ip link)

$ sudo iw dev [wlp] set type monitor
copy

Set device to managed mode (interface must be down first)
$ sudo iw dev [wlp] set type managed
copy

Set device WiFi channel (device must first be in monitor mode with the interface up)
$ sudo iw dev [wlp] set channel [channel_number]
copy

Set device WiFi frequency in Mhz (device must first be in monitor mode with the interface up)
$ sudo iw dev [wlp] set freq [freq_in_mhz]
copy

Show all known station info
$ iw dev [wlp] station dump
copy

Create a virtual interface in monitor mode with a specific MAC address
$ sudo iw dev [wlp] interface add "[vif_name]" type monitor addr [12:34:56:aa:bb:cc]
copy

Delete virtual interface
$ sudo iw dev "[vif_name]" del
copy

SYNOPSIS

iw [options] command [arguments]
iw help
iw command help

PARAMETERS

dev
    Show information about wireless devices attached to the system.

phy
    Show or modify information about wireless physical devices (phys).

scan
    Perform a scan for available Wi-Fi networks on a specified interface.

connect <SSID>
    Connect to a specified Wi-Fi network (SSID).

disconnect
    Disconnect from the currently connected network.

link
    Display or modify current link properties for an interface, like signal strength.

station
    Manage or display information about stations (clients) connected to an access point.

info
    Show general information about the current wireless configuration or interface.

set
    Set various parameters for an interface, such as channel, type, or transmit power.

event
    Monitor wireless device events, useful for debugging or scripting.

help
    Display general help message or help for a specific command.

DESCRIPTION

iw-dev refers to the development version of the
iw utility, which is a powerful command-line tool for configuring wireless devices on Linux. It is built upon the
nl80211 kernel interface, making it the preferred and modern replacement for the older
iwconfig tool.

Unlike
iwconfig, which was specific to the now-deprecated Wireless Extensions API,
iw leverages the netlink protocol to interact with modern wireless drivers, offering more robust and detailed control over Wi-Fi hardware.

As a "development" version,
iw-dev typically includes the latest features, bug fixes, and improvements that are still under active development and have not yet been released in a stable version. This makes it suitable for testing new functionalities, debugging driver issues, or working with cutting-edge wireless hardware that requires the newest kernel features.

Capabilities include scanning for networks, connecting to access points, setting up access points, configuring mesh networks, managing P2P connections, inspecting wireless device capabilities, and displaying detailed link and station information.

CAVEATS

As a development version,
iw-dev (i.e.,
iw compiled from a development branch) should be used with caution. It may contain unstable features, known bugs, or incomplete functionalities. It is not recommended for production environments or systems requiring high stability. Features might change or be removed without prior notice. It also often relies on the latest kernel features, which might not be available on older Linux distributions, potentially leading to compatibility issues.

DEVELOPMENT CONTEXT

When 'iw-dev' is referenced, it typically implies using the iw utility compiled directly from its source code repository's development branch (e.g., Git 'master' or 'main'). This approach is common for developers, advanced users, or hardware vendors who need access to the absolute latest features or bug fixes before they are formally released in stable versions of the tool or integrated into distribution packages. It requires manual compilation and potentially more attention to dependencies and system compatibility.

HISTORY

The
iw command was developed to replace the deprecated
iwconfig utility, which relied on the older Wireless Extensions API. With the introduction of the
nl80211 kernel interface, a more robust and extensible framework for wireless device control became available.
iw was designed from the ground up to leverage
nl80211, providing comprehensive control over modern Wi-Fi chipsets and features like mesh networking, P2P, and advanced access point functionalities. The term
iw-dev specifically refers to utilizing the bleeding-edge development builds of
iw, reflecting the continuous evolution and improvement of wireless networking tools in Linux.

SEE ALSO

Copied to clipboard