指令: sudo lsusb
终端显示如下,其中显示RTL8188CUS信息,说明系统已经成功识别到wifi模块
Bus 001 Device 002: ID 0bda:8176 Realtek Semiconductor Corp. RTL8188CUS 802.11n WLAN Adapter Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
指令: sudo ifconfig
终端显示如下,显示当前wifi设备对应为wlan0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10<host> loop txqueuelen 1000 (Local Loopback) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.43.230 netmask 255.255.255.0 broadcast 192.168.43.255 inet6 fe80::a529:9fb2:36ae:22d prefixlen 64 scopeid 0x20<link> ether e8:4e:06:6f:6b:09 txqueuelen 1000 (Ethernet) RX packets 41 bytes 4157 (4.0 KiB) RX errors 0 dropped 20 overruns 0 frame 0 TX packets 53 bytes 7668 (7.4 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
指令:sudo iwlist wlan0 scan
扫面设备搜到的附近网络信息
编辑网络配置文件
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
在文件中添加网络名称、密码
network={ ssid="testing" psk="testingPassword"}
重启配置网络
wpa_cli -i wlan0 reconfigure
查看连接状态