CentOS6.5以runlevel 3开机时自动连接某无线设置示例

[参考]http://blog.csdn.net/simeone18/article/details/8580592

[方法一]

假设无线网卡代号为wlan0,无线AP的essid为:TheWiFi,密码为:ThePassword,WPA加密

  • 添加如下内容至 /etc/sysconfig/network-scripts/ifcfg-wlan0
DEVICE="wlan0"
BOOTPROTO="dhcp"
HWADDR="00:5E:4D:1A:2C:3B"
NM_CONTROLLED="no"
ONBOOT="yes"
  • 添加如下内容至 /etc/wpa_supplicant/wpa_supplicant.conf
network={
ssid="TheWiFi"
psk="ThePassword"  
}
  • 添加如下脚本至 /etc/rc.local
ifconfig wlan0 192.168.0.100
wpa_supplicant -B -i wlan0 /etc/wpa_supplicant/wpa_supplicant.conf
  • 重启验证效果
posted @ 2015-04-02 00:04  flowjacky  阅读(349)  评论(0编辑  收藏  举报