LinuxCommandLibrary

iwctl

Manage wireless connections using command line

TLDR

Run iwctl in interactive mode

$ iwctl
copy

Display Wi-Fi stations
$ iwctl station list
copy

Look for networks with a station
$ iwctl station [station] scan
copy

Display the networks found by a station
$ iwctl station [station] get-networks
copy

Connect to a network with a station, if credentials are needed they will be asked
$ iwctl station [station] connect [network_name]
copy

Display help
$ iwctl [[-h|--help]]
copy

SYNOPSIS

iwctl [options] [command] [arguments]
iwctl
iwctl --help
iwctl --version

PARAMETERS

--help, -h
    Displays the command's help message.

--version, -v
    Shows the version information of iwd.

--raw
    Outputs information in a raw, machine-readable format, suitable for parsing.

--json
    Outputs information in JSON format, facilitating programmatic access.

--no-pager
    Prevents piping output to a pager, displaying it directly in the terminal.

adapter
    Manages wireless adapters, including listing available adapters, showing their details, and setting properties.

device
    An alias for the 'adapter' command, used to manage wireless devices.

station
    Controls a wireless station (client) on an adapter, allowing scanning for networks, connecting, disconnecting, and managing network profiles.

known-networks
    Manages previously saved wireless network profiles, allowing users to list and forget them.

net
    An alias for network-related operations, often used interchangeably with 'station get-networks' or 'station list-known-networks'.

p2p
    Manages Wi-Fi Direct (Peer-to-Peer) connections and operations.

ap
    Manages Access Point mode configurations and operations.

phy
    Displays and manages physical layer properties of wireless devices.

DESCRIPTION

iwctl is the command-line interface for iwd, the iNet wireless daemon. iwd is a Linux wireless daemon developed by Intel that aims to replace wpa_supplicant. iwctl provides a user-friendly and interactive way to manage wireless networks directly from the terminal. Users can leverage it to scan for available Wi-Fi networks, connect to them using various authentication methods, disconnect, and manage network profiles. It also allows for the configuration of wireless adapters. Designed for modern Linux systems, iwctl supports both an interactive shell, which simplifies routine tasks, and direct command execution, making it suitable for scripting and automation. Its primary design goals are to be lightweight, efficient, and simple to use for common wireless management tasks, providing a streamlined experience for wireless connectivity.

CAVEATS

iwctl requires the iwd (iNet wireless daemon) service to be running. Certain operations, especially those involving modifying system network configurations or connecting to protected networks, may require root privileges (e.g., via sudo). While iwd manages the wireless connection, it typically relies on other system services like systemd-networkd or dhcpcd for IP address configuration.

INTERACTIVE MODE

Running iwctl without any arguments launches an interactive shell, providing an intuitive environment for managing wireless connections with tab-completion and contextual help.

NON-INTERACTIVE USAGE

Commands can be executed directly from the terminal (e.g., iwctl station wlan0 scan), which is useful for scripting and automating wireless management tasks.

NETWORK PROFILES

iwctl automatically creates and manages network profiles for successfully connected Wi-Fi networks, simplifying future reconnections to known networks.

SYSTEMD INTEGRATION

iwd is designed to integrate seamlessly with systemd components like systemd-networkd for network configuration and systemd-resolved for DNS resolution, providing a cohesive network management solution.

HISTORY

iwd, and consequently iwctl, was developed by Intel as a modern, lightweight alternative to wpa_supplicant. Its development began around 2017-2018, aiming for better integration with systemd and focusing solely on wireless connectivity, delegating IP management to other system services. It has steadily gained traction and is now the default wireless backend in several Linux distributions, offering a simpler and more efficient approach to Wi-Fi management.

SEE ALSO

iwd(8), iw(8), nmcli(1), nmtui(1), wpa_supplicant(8), ip(8), systemctl(1)

Copied to clipboard