📘 1. What Are iwd and iwctl?

  • iwd (iNet Wireless Daemon) is a wireless daemon developed by Intel to replace wpa_supplicant.
  • iwctl is its front-end tool for user interaction via D-Bus (interactive shell or direct commands).
  • Together, they allow you to:
  • Scan and connect to Wi-Fi networks
  • Manage known networks
  • Configure devices
  • Automate network connections

🧩 1.1 Advantages over wpa_supplicant

  • Lightweight and modern architecture
  • Integrates tightly with systemd and networkd
  • Easier to configure and debug
  • Automatically manages profiles and connections
  • Requires fewer dependencies

⚙️ 2. Installation and Setup

2.1 Installing IWD

Use your package manager to install iwd:

BASH
sudo pacman -S iwd           # Arch-based systems
sudo apt install iwd         # Debian/Ubuntu
sudo dnf install iwd         # Fedora

Then enable the service:

BASH
sudo systemctl enable --now iwd.service

2.2 Enabling Network Configuration

Edit (or create) the file /etc/iwd/main.conf:

INI
[General]
EnableNetworkConfiguration = true
RoutePriorityOffset = 300

This lets iwd handle IP assignment and routing (like DHCP). Restart the service to apply changes:

BASH
sudo systemctl restart iwd

💡 3. Using iwctl

iwctl can be used in interactive mode or via direct commands.

3.1 Interactive Mode

Start the shell:

BASH
sudo iwctl

You’ll see the prompt:

TEXT
[iwd]#

List available commands:

BASH
[iwd]# help

Common Commands

| Command | Description | | --- | --- | | device list | Show available Wi-Fi adapters | | station <DEVICE> scan | Scan for nearby Wi-Fi networks | | station <DEVICE> get-networks | List detected networks | | station <DEVICE> connect <SSID> | Connect to a Wi-Fi network | | station <DEVICE> disconnect | Disconnect from the current network | | known-networks list | List saved networks | | known-networks <SSID> forget | Forget a saved network | | exit | Quit iwctl |

Example session:

TEXT
[iwd]# device list
[iwd]# station wlan0 scan
[iwd]# station wlan0 get-networks
[iwd]# station wlan0 connect MyWiFiNetwork

3.2 Non-interactive Mode

You can also run single commands without entering the shell:

BASH
iwctl device list
iwctl station wlan0 scan
iwctl station wlan0 get-networks
iwctl station wlan0 connect "MySSID"

If the network requires a password:

BASH
iwctl --passphrase="MySecretPass" station wlan0 connect "MySSID"

🧠 4. Full Connection Workflow

Below is a step-by-step example to connect from scratch:

BASH
sudo systemctl enable --now iwd

# Start iwctl
sudo iwctl

[iwd]# device list
[iwd]# station wlan0 scan
[iwd]# station wlan0 get-networks
[iwd]# station wlan0 connect MyWiFiSSID
[iwd]# exit

Then verify the connection:

BASH
ip addr show wlan0
ping google.com

If you don’t get an IP address, check your DHCP or enable network configuration in /etc/iwd/main.conf.


🛠️ 5. Advanced Tips

5.1 Disable Auto-Connect

To stop auto-connecting to a network:

BASH
[iwd]# known-networks MyWiFi set-property AutoConnect no

Or edit the profile file /var/lib/iwd/MyWiFi.psk:

INI
[Settings]
AutoConnect = false

5.2 Set a Static IP

Edit the same .psk profile:

INI
[IPv4]
Address = 192.168.1.50
Netmask = 255.255.255.0
Gateway = 192.168.1.1
DNS = 8.8.8.8

Then restart the iwd service.

5.3 Combine with systemd-networkd

While iwd handles Wi-Fi connections, you can delegate IP configuration to:

  • systemd-networkd (for DHCP/static IP)
  • systemd-resolved (for DNS)
  • GUI front-ends like iwgtk (optional)

🧩 6. Troubleshooting

| Issue | Cause | Solution | | --- | --- | --- | | No Wi-Fi devices listed | Driver not loaded | Load kernel module / install firmware | | Can’t get IP address | DHCP failure | Enable network configuration or use static IP | | Keeps auto-connecting | Default behavior | Disable AutoConnect property | | Conflicts with NetworkManager | Two services controlling Wi-Fi | Disable wpa_supplicant or Wi-Fi in NetworkManager |


✅ 7. Conclusion

iwctl is a fast, lightweight, and reliable way to manage Wi-Fi connections in Linux systems — especially those using systemd. It’s ideal for users who prefer simplicity over heavy GUI tools.

For further reading:


TEXT