iw
iw
is a command-line tool used for configuring and managing wireless devices in Linux. It supports the modern nl80211 interface and is intended to replace older tools like iwconfig
. The iw
command provides more advanced and detailed control over wireless interfaces and supports the latest features of wireless hardware.
Basic Usage
To use iw
, you typically need root privileges. The general syntax of the iw
command is:
Common Commands and Options
List Devices
List all wireless devices:
Example output:
Link Status
Show information about the current link:
Example output:
Scan for Networks
Scan for available wireless networks:
Example output:
Set Interface Down
Bring a wireless interface down:
Example:
Set Interface Up
Bring a wireless interface up:
Example:
Join a Network
Connect to a wireless network (requires WPA supplicant for encrypted networks):
For encrypted networks, additional configuration with WPA supplicant or network manager is needed.
Disconnect from a Network
Disconnect from the current network:
Set Wireless Power Save Mode
Enable power save mode:
Disable power save mode:
Show Station Information
Show information about connected stations (for access points):
Change Wireless Interface Type
Change the type of a wireless interface (e.g., from managed to monitor):
Example Configuration Workflow
List Available Wireless Interfaces
Bring the Interface Down
Set Interface Type
Bring the Interface Up
Scan for Available Networks
Connect to a Network
Conclusion
The iw
tool is a powerful utility for managing and configuring wireless devices in Linux. It provides comprehensive control over wireless interfaces and supports advanced features. By mastering iw
, administrators can effectively manage wireless connectivity and troubleshoot issues.
Last updated