iw
iw is a command line tool for configuring and showing information about Linux wireless devices using the nl80211 kernel interface. It supports modern wireless hardware and replaces the deprecated iwconfig tool.
Description
iw provides comprehensive control over wireless network interfaces, enabling users to scan for networks, connect to access points, set up access points, manage mesh networks, and configure advanced features like channel availability checks and power save modes. It is essential for wireless security testing, network diagnostics, and customization of WiFi behavior in Kali Linux environments.
Common use cases include wireless reconnaissance through scanning, setting up monitor mode for packet capture, creating ad-hoc or mesh networks for testing, and configuring specific bitrate masks or transmit power levels. The tool supports a wide range of modern wireless standards including HT, VHT, and HE capabilities.
Based on nl80211, iw offers detailed control over phy (physical device) and dev (network interface) operations, making it suitable for both interactive troubleshooting and scripted automation in penetration testing workflows.
How It Works
iw communicates with the Linux kernel via the nl80211 netlink interface to configure wireless devices. It supports operations on physical wireless devices (phy) and virtual network interfaces (dev), handling tasks like channel switching, authentication, scanning, and mesh path management. Features leverage kernel subsystems for AP mode (often requiring hostapd), IBSS/ad-hoc networks, monitor mode with specific flags, and advanced capabilities like WoWLAN patterns, FTM responders, and SAR specs.
Installation
sudo apt install iwFlags
Examples
iw -hiw dev <devname> connect [-w] <SSID> [<freq in MHz>] [<bssid>]iw dev <devname> scaniw dev <devname> station dumpiw phy <phyname> infoiw dev wlan0 mgmt dump frame 40 00 frame 40 01:02 count 10iw dev <devname> disconnectiw event -t