更新文件 通过_Linux_命令行工具连接_Wifi.md
This commit is contained in:
parent
edc5ea09d2
commit
5ff513dd2c
|
@ -10,31 +10,16 @@
|
|||
|
||||
扫描附近的无线网络
|
||||
|
||||
iw dev <eth> scan
|
||||
iw <eth> scan
|
||||
|
||||
可得到网络的 ESSID。如果要连接的网络是没有加密的,可以用下面的命令直接连接:
|
||||
|
||||
iw dev <eth> connect <ESSID>
|
||||
|
||||
如果网络是用 WEP 加密的:
|
||||
开启 NetworkManager 服务
|
||||
|
||||
iw dev <eth> connect <ESSID> key 0:<WEP Password>
|
||||
systemctl start NetworkManager
|
||||
|
||||
但网络使用的是 WPA 或 WPA2 协议的话:
|
||||
连接无线网络
|
||||
|
||||
wpa_passphrase <"ESSID"> <"Password"> > /etc/xxx.conf
|
||||
wpa_supplicant -B -i <eth> -c /etc/xxx.conf
|
||||
|
||||
查看无线网络连接状态:
|
||||
|
||||
iwconfig <eth>
|
||||
# 或
|
||||
iw <eth> link
|
||||
# 或
|
||||
ip link show <eth>
|
||||
|
||||
为无线网动态分配 IP
|
||||
|
||||
dhclient <eth>
|
||||
# 或
|
||||
udhcpc ‐b ‐i <eth>
|
||||
nmcli dev wifi connect <ESSID> password <Password>
|
||||
|
|
Loading…
Reference in New Issue