1

The iwd is the up-and-coming wireless daemon for linux released by Intel and the wpasupplicant successor. The development of iwd is still in progress, but it is packaged under some linux distribution Gentoo, Arch-linux , Ubuntu (Cosmic) and Debian (Buster and Sid)...

The configuration of the network and the connection is possible through the interactive mode using iwctl , the help command will display the list of the available commands (no manpage ).

Without using the interactive mode :

1) How can I manually configure the wifi credentials?

2) How can I connect to the configured wifi through iwctl?

3) How can I automatically enable the wifi connection at boot?

2

1) From the non-interactive mode , you can scan and list the available access points :

iwctl station wlp8s0 scan
iwctl station wlp8s0 get-networks

The wifi credentials are stored under /var/lib/iwd , the exact name of the SSID should be used , the format:

SSID.psk 

The content:

[Security]
PreSharedKey=encripted-password
Passphrase=the-plain-txt-password

The minimal configuration file should contain the encrypted wifi paswword (PreSharedKey)

To generate an encrypted psk , you can use the wpa_passhrase tool:

wpa_passhrase "My-SSID" passphrase

There is an example using "My SSID" and mysecretpassword:

$ cat My\ SSID.psk
[Security]
PreSharedKey=8e1e64a6ecaf2b5e0aa29816547af300d7f3b0473bbfa56ddb5514ad4683804c

2) To connect from the terminal:

iwctl station <INTERFACE> connect "SSID" 

e,g:

iwctl station wlp8s0 connect "My SSID"
dhclient

dhclient can be replaced an iproute2 command to assign an IP address to wlp8s0.

3) to automatically enable the wifi connection at boot , there is a way using a systemd service:

A minimal script to connect:

$ cat /usr/local/enable-wifi.sh

#!/bin/bash
iwctl station wlan0 connect "My SSID" 
dhclient

Create a systemd service.

$ cat /etc/systemd/system/enable-wifi.service

[Unit]
Before=network.target
Wants=network.target

[Service]
ExecStart=/usr/local/enable-wifi.sh

[Install]
WantedBy=default.target

then :

# chmod 744 /usr/local/enable-wifi.sh
# chmod 664 /etc/systemd/system/enable-wifi.service
# systemctl daemon-reload
# systemctl enable enable-wifi.service

documentation:

arch-linux wiki : iwd

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.