The SSID of the WiFi to be connected is "tHM", the password is 12345678, the authentication method is WPA2-PSK
1. Check whether the wireless network card driver is installed
1 xxx#iwconfig
If you print wlan0 (or other name) of the wireless network card information, it indicates that the wireless network card driver has been installed, or to install the wireless network card driver can continue.
2. Configure/etc/sysconfig/network-scripts/ifcfg-wlan0
The contents of my configuration file are:
1 device=wlan0
2 Hwaddr=9c:4e:36:9a:64:10
3 type=wireless
4 UUID=F017BD9C-EEBF-46FC-823C-7F76CC8D5ABF
5 Onboot=no
6 Nm_controlled=yes
7 BOOTPROTO=DHCP
8 essid= "tHM"
3. Installation Tools Wpa_supplicant
1 Xxx#yum Install Wpa_supplicant
4. Configure/etc/wpa_supplicant/wpa_supplicant.conf, write related SSID and corresponding password
1 xxx#wpa_passphrase thm 12345678 >>/etc/wpa_supplicant/wpa_supplicant.conf
The contents of my configuration file are:
1 ctrl_interface=/var/run/wpa_supplicant
2 Ctrl_interface_group=wheel
3
4 network={
5 ssid= "tHM"
6 #psk = "12345678"
7 psk=eabb3e1572789c41a1600051b1235e03c0787c88fc527f6597cd29cb5a707822
5. Background Run wpa_supplicant process
1 Xxx#wpa_supplicant-b-dwext-iwlan0-c/etc/wpa_supplicant/wpa_supplicant.conf
6. Search for wireless networks
1 xxx#iwlist wlan0 Scan | grep Essid
7. Connect to the wireless network
1 xxx#iwconfig wlan0 Essid "tHM"
8. DHCP Way to obtain IP
1 xxx#dhclient wlan0
9. Test whether the network Unicom
1 xxx#ping www.baidu.com