2018-12-16 23:17:30 +08:00
|
|
|
|
# [通过 Linux 命令行工具连接 Wifi](https://www.tecmint.com/nmcli-connect-wi-fi-from-linux-terminal/)
|
2018-12-16 11:09:28 +08:00
|
|
|
|
|
|
|
|
|
首先查看无线网卡名称
|
|
|
|
|
|
|
|
|
|
ifconfig -a
|
|
|
|
|
|
|
|
|
|
如果无线网卡没有开启,则使能无线网卡
|
|
|
|
|
|
|
|
|
|
ifconfig <eth> up
|
|
|
|
|
|
|
|
|
|
扫描附近的无线网络
|
|
|
|
|
|
2018-12-16 23:12:14 +08:00
|
|
|
|
iw <eth> scan
|
2018-12-16 11:09:28 +08:00
|
|
|
|
|
|
|
|
|
可得到网络的 ESSID。如果要连接的网络是没有加密的,可以用下面的命令直接连接:
|
|
|
|
|
|
|
|
|
|
iw dev <eth> connect <ESSID>
|
|
|
|
|
|
2018-12-16 23:12:14 +08:00
|
|
|
|
开启 NetworkManager 服务
|
2018-12-16 11:09:28 +08:00
|
|
|
|
|
2018-12-16 23:12:14 +08:00
|
|
|
|
systemctl start NetworkManager
|
2018-12-16 11:09:28 +08:00
|
|
|
|
|
2018-12-16 23:12:14 +08:00
|
|
|
|
连接无线网络
|
2018-12-16 11:09:28 +08:00
|
|
|
|
|
2018-12-16 23:12:14 +08:00
|
|
|
|
nmcli dev wifi connect <ESSID> password <Password>
|