Authoring Mode Warning
This article series is under heavy development.
Most of the articles are not done yet.
Where to Discuss?

Preface

Goal: Examine wireless in system: device, driver, and interface.

First thing catch my eye in my vanilla Arch install is iwctl. So I think, I have to play with it. So I can install my Vanilla Arch easily.

IWD: Summary

Reference

There is better reference for you:


Starting The Service

In arch install, iwd is running as default. But after install you should decide what service to be run.

sudo systemctl enable iwd.service
Created symlink /etc/systemd/system/multi-user.target.wants/iwd.service → /usr/lib/systemd/system/iwd.service.
❯ sudo systemctl start iwd.service

IWD: Enable IWD

If the service already enabled, the command won’t make the soft link again.

IWD: Enable IWD

You can try yourself in your beloved command line.


Using The Shell

One thing I love about iwctl is the shell. So I don’t have to type over and over again. Just up and down arrow.

❯ iwctl
Auto-refresh is disabled. Enlarge window width to at least 80 to enable.
NetworkConfigurationEnabled: disabled
StateDirectory: /var/lib/iwd
Version: 2.5
[iwd]#

Unfortunately the shell require long terminal.

IWD: Starting iwctl: narrow

Let me start over with wider teminal.

❯ iwctl
NetworkConfigurationEnabled: disabled
StateDirectory: /var/lib/iwd
Version: 2.5
[iwd]#

IWD: Starting iwctl: wide


Power Up The Device

First list what device available.

[iwd]# device list

                                    Devices                                   *
--------------------------------------------------------------------------------
  Name                  Address               Powered     Adapter     Mode      
--------------------------------------------------------------------------------
  wlan0                 9c:2f:9d:9a:6d:e3     on          phy0        station  

IWD: Device List

Then powering on.

[iwd]# device wlan0 set-property Powered on

IWD: Set Power Property On


Scanning Network

[iwd]# station wlan0 scan

IWD: Scanning Network

If you do the same command again, this will refused.

[iwd]# station wlan0 scan
Operation already in progress

IWD: Scanning Network

Now you can get the list of the networks.

[iwd]# station wlan0 get-networks
                               Available networks                              
--------------------------------------------------------------------------------
      Network name                      Security            Signal
--------------------------------------------------------------------------------
  >   Japrut_Slebew                     psk                 ****    
      TELTONIKA_5G                      psk                 ****    
      RUT955_4B8D                       psk                 ****    
      TELTONIKA                         psk                 ****    
      Soadamara110                      psk                 ****    
      Production                        psk                 ****    
      E.R. Nurwijayadi                  psk                 ****    
      Bismillahirrahmanirrahim          psk                 ****    
      michael                           psk                 ****    
      MEDABU LT 3                       psk                 ****    
      978EnergiGLX                      psk                 ****    
      JPKP POSKO                        psk                 ****    
      Infinix HOT 10S                   psk                 ****    
      GGP 9/20_2.4G                     psk                 ****    
      ZTE_2.4G_4kJEQ2                   psk                 ****    

IWD: Get the Network

Now you can easily connect with your SSID.

[iwd]# station wlan0 connect "E.R. Nurwijayadi"
Type the network passphrase for E.R. Nurwijayadi psk.
Passphrase: **********

IWD: Connect to SSID

[iwd]# station wlan0 disconnect
[iwd]# known-networks "E.R. Nurwijayadi" forget

IWD: Forget Connection

We can check the detail of the device.

[iwd]# device wlan0 show
                                 Device: wlan0                                *
--------------------------------------------------------------------------------
  Settable  Property              Value                                          
--------------------------------------------------------------------------------
            Name                  wlan0                                            
         *  Mode                  station                                          
         *  Powered               on                                               
            Address               9c:2f:9d:9a:6d:e3                                
            Adapter               phy0                                             

IWD: Show Device

And also the connection detail of the station

[iwd]# station wlan0 show
                                 Station: wlan0                               *
--------------------------------------------------------------------------------
  Settable  Property              Value                                          
--------------------------------------------------------------------------------
            Scanning              no                                               
            State                 connected                                        
            Connected network     E.R. Nurwijayadi                                 
            IPv4 address          192.168.43.173                                   
            ConnectedBss          1e:77:f6:4c:0d:31                                
            Frequency             2442                                             
            Security              WPA2-Personal                                    
            RSSI                  -31 dBm                                          
            AverageRSSI           -30 dBm                                          
            TxMode                802.11n                                          
            TxMCS                 7                                                
            TxBitrate             72200 Kbit/s                                     
            RxBitrate             1000 Kbit/s          

IWD: Show Station


Testing The Connection

❯ ping google.com -c 2
ping: google.com: Temporary failure in name resolution

IWD: Ping: Failure

Allright, I think we need dhcpcd here.

sudo systemctl start dhcpcd.service
❯ ping google.com -c 2
PING google.com (142.250.4.138) 56(84) bytes of data.
64 bytes from 142.250.4.138: icmp_seq=1 ttl=106 time=59.9 ms
64 bytes from 142.250.4.138: icmp_seq=2 ttl=106 time=38.6 ms

--- google.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 10071ms
rtt min/avg/max/mdev = 38.600/49.252/59.905/10.652 ms

IWD: Ping: Succeed

Alternatively you can use dhclient.

sudo pacman -S dhclient

IWD:

❯ dhclient wlan0
RTNETLINK answers: Operation not permitted
❯ sudo dhclient wlan0
❯ ping google.com -c 2
PING google.com (74.125.200.100) 56(84) bytes of data.
64 bytes from 74.125.200.100: icmp_seq=1 ttl=104 time=51.3 ms
64 bytes from 74.125.200.100: icmp_seq=2 ttl=104 time=63.0 ms

--- google.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 10063ms
rtt min/avg/max/mdev = 51.312/57.170/63.029/5.858 ms

Stopping IWD

If you want to continue to leanr about other service, such as NetworkManager, you should stop the iwd. Because both can’t be coexist without further backend settings.

sudo systemctl disable iwd.service
Removed "/etc/systemd/system/multi-user.target.wants/iwd.service".

Now try to ping again.

sudo systemctl stop iwd
❯ ping 8.8.8.8
ping: connect: Network is unreachable

IWD: Stop IWD

Just to prove that it really to stopped.


Config

There are two configuration

  • Main Configuration
  • Per Connexion

Main Configuration

The main configuration can provide something like EnableNetworkConfiguration.

sudo touch /etc/iwd/main.conf
❯ sudo nano /etc/iwd/main.conf
❯ sudo cat /etc/iwd/main.conf
[General]
EnableNetworkConfiguration=true

IWD: Main Configuration

Per Connexion

This is what I have got, while examining the /var/lib/iwd directory. All the connexion stored here.

sudo su
[root@utama epsi]# cd /var/lib/iwd
[root@utama iwd]# ls
'=452e522e204e757277696a6179616469.psk'   hotspot

Let’s see what’s in there.

sudo su
[root@utama epsi]# cat /var/lib/iwd/=452e522e204e757277696a6179616469.psk
[Security]
PreSharedKey=50a047c8ba8ff1f14bc7651ff1b6e4bb6e6682d4c218181461a3ae22b014b7ad
Passphrase=oyenyebus
SAE-PT-Group19=e8eeab4081b3142b487369bae06addef2563e0a77516fc22b748ad6f01ffb5f1b6d07bd778d14377fa447ad7519b0839f3977bf35487e06938e70a464493a594
SAE-PT-Group20=7453564053aadda669ceeee61dc58abc490f1af8150e842db69bde434594a2912da0223c73ffd2a7502db8569aa7e11dbd1b2a36dea05187585301544ac9d3de597597edb19cbba16394ed30f0dc8c502442c1a74c129bcc27d5c6fa66c4b65e

IWD: /var/lib/iwd

It is a good idea to manage each connexion manually, for frequent connexion.

sudo su
[root@utama epsi]# cd /var/lib/iwd
[root@utama iwd]# ls -l
total 12
-rw-r--r-- 1 root root  110 Jul 16 10:02 ern.psk
drwx------ 2 root root 4096 Jun  4 01:33 hotspot
-rw------- 1 root root  464 Jul 16 10:06 Whitewood.psk

IWD: ls -l /var/lib/iwd

sudo cat /var/lib/iwd/ern.psk
[Security]
PreSharedKey=50a047c8ba8ff1f14bc7651ff1b6e4bb6e6682d4c218181461a3ae22b014b7ad
Passphrase=oyenyebus

IWD: cat /var/lib/iwd/ern.psk

This looks better with bat instead od cat.

IWD: bat /var/lib/iwd/ern.psk


What is Next 🤔?

After the INet Wireless Daemon in arch setup. I need WPA Supplicant in post arch setup.

Consider continue reading [ Wireless: WPA Supplicant ].