发布于 2018-10-24 11:36:10
1)在非交互模式下,您可以扫描并列出可用的访问点:
iwctl station wlp8s0 scan
iwctl station wlp8s0 get-networkswifi凭据存储在/var/lib/iwd下,应该使用SSID的确切名称,格式:
SSID.psk 内容:
[Security]
PreSharedKey=encripted-password
Passphrase=the-plain-txt-password最小配置文件应该包含加密的wifi密码(PreSharedKey)。
要生成加密psk,可以使用wpa_passhrase工具:
wpa_passhrase "My-SSID" passphrase有一个使用"My“和mysecretpassword的示例:
$ cat My\ SSID.psk
[Security]
PreSharedKey=8e1e64a6ecaf2b5e0aa29816547af300d7f3b0473bbfa56ddb5514ad4683804c2)从终端连接:
iwctl station connect "SSID" e,g:
iwctl station wlp8s0 connect "My SSID"
dhclientdhclient可以被替换为iproute2命令,以将IP地址分配给wlp8s0。
3)要在引导时自动启用wifi连接,可以使用systemd服务:
连接的最小脚本:
$ cat /usr/local/enable-wifi.sh
#!/bin/bash
iwctl station wlan0 connect "My SSID"
dhclient创建一个systemd服务。
$ 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 wiki:iwd
Debian:网络管理器/iwd
https://unix.stackexchange.com/questions/477488
复制相似问题