Linux命令连接WiFi
一.先安装软件
yum -y install iw
yum -y install wpa_supplicant
yum -y install net-tools
二.查看无线网接口
iw dev
三.查看接口连接信息
iw wls2 link
四.启用WiFi
ip link set dev wls2 up
五.查看周围WiFi
iw dev wls2 scan |grep SSID
六.连接WiFi
wpa_supplicant -B -i wls2 -c <(wap_passphrase "ssid" "password")
用dhcp获取ip
dhclient wls2
查看ip
ip addr show wls2