1、需要先安装 yum -y install wpa_supplicant
2、配置wpa_supplicant接口和驱动,执行:vi /etc/sysconfig/wpa_supplicant,按a进入插入模式,编辑如下:
|# Use the flag "-i" before each of your interfaces, like so:
|# INTERFACES="-ieth1 -iwlan0"
|INTERFACES="-iwlan0" |
|# Use the flag "-D" before each driver, like so:
|# DRIVERS="-Dwext"
|DRIVERS="-Dwext"
3、将wifi信息加入到配置文件:
wpa_passphrase {wifiSSIDhere} {pwhere} >> /etc/wpa_supplicant/wpa_supplicant.conf,后面增加新的wifi也是如此
4、配置wpa_supplicant
wpa_supplicant -B w -i wlan0 -l /etc/wpa_supplicant/suplicant.conf 或者 /wpa_supplicant.conf 目录下有两个,看哪个里面有内容
ifup wlan0
service network restart
5、加入到系统启动内,开机自动连接
vim /etc/rc.d/rc.local