iwd(Linux Wireless Daemon)を介してLinuxシステムのコマンドラインからWi-Fiに接続します。

iwd(Linux Wireless Daemon)を介してLinuxシステムのコマンドラインからWi-Fiに接続します。

これiwdIntelがリリースしたwpasupplicantの後継製品であるLinuxベースのワイヤレスデーモンです。 iwdの発展はまだ進行中です。進展しかし、いくつかのLinuxディストリビューションGentoo、Arch-linux、Ubuntu(Cosmic)とダーバンバスターそしてシード)...

ネットワークと接続の設定は対話型モードで使用でき、iwctlhelpコマンドは利用可能なコマンドのリストを表示します(マンページなし)。

対話型モードを使用しない:

  1. Wi-Fi認証情報を手動で設定するには?
  2. で設定されたWi-Fiに接続するにはiwctl
  3. 起動時にWi-Fi接続を自動的に有効にする方法は?

ベストアンサー1

1)非対話モードでは、利用可能なアクセスポイントを検索して一覧表示できます。

iwctl station wlp8s0 scan
iwctl station wlp8s0 get-networks

Wi-Fi資格情報は以下に保存され、/var/lib/iwdSSIDの正確な名前を次の形式で使用する必要があります。

SSID.psk 

コンテンツ:

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

最小構成ファイルには、暗号化されたWi-Fiパスワード(PreSharedKey)を含める必要があります。

暗号化されたpskを作成するには、wpa_passhraseツールを使用できます。

wpa_passhrase "My-SSID" passphrase

「My SSID」を使用する例は次のとおりですmysecretpassword

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

2)ターミナルからの接続:

iwctl station <INTERFACE> connect "SSID" 

たとえば、

iwctl station wlp8s0 connect "My SSID"
dhclient

dhclientiproute2コマンドを置き換えて、wlp8s0にIPアドレスを割り当てることができます。

3)起動時にWi-Fi接続を自動的に有効にするには、systemdサービスを使用する方法があります。

接続用の最小スクリプト:

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

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

システムサービスを作成します。

$ 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

それから:

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

文書:

Arch-Linux Wiki:世界の女性の日

Debian Wiki:ネットワーク管理者/iwd

ルーン:iwd:WiFi管理の簡素化

おすすめ記事