CentOS6.4 wireless Internet access command line configuration
Refer to: drivers. Check whether the wireless NIC driver is installed.
1 xxx#iwconfig
If you print the information of the wireless network card of wlan0 (or other names), it indicates that the wireless network card driver has been installed. Otherwise, you must first install the wireless network card driver to continue. 2. Configure/etc/sysconfig/network-scripts/ifcfg-wlan0 my configuration file content is:
1 DEVICE=wlan02 HWADDR=9C:4E:36:9A:64:103 TYPE=Wireless4 UUID=f017bd9c-eebf-46fc-823c-7f76cc8d5abf5 ONBOOT=no6 NM_CONTROLLED=yes7 BOOTPROTO=dhcp8 ESSID="thm"
3. Install wpa_supplicant
1 xxx#yum install wpa_supplicant
4. Configure/etc/wpa_supplicant/wpa_supplicant.conf and write the related ssid and password.
1 xxx#wpa_passphrase thm 12345678 >> /etc/wpa_supplicant/wpa_supplicant.conf
My configuration file content is:
1 ctrl_interface=/var/run/wpa_supplicant2 ctrl_interface_group=wheel3 4 network={5 ssid="thm"6 #psk="12345678"7 psk=eabb3e1572789c41a1600051b1235e03c0787c88fc527f6597cd29cb5a707822
5. Run the wpa_supplicant process in the background
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. Obtain the ip address through dhcp
1 xxx#dhclient wlan0
9. Test network connectivity
1 xxx#ping www.baidu.com