CentOS-6.4無(wú)線上網(wǎng)命令行配置
待連接的WIFI的ssid為“thm”,密碼為12345678,認(rèn)證方式為WPA2-PSK
1. 檢查無(wú)線網(wǎng)卡驅(qū)動(dòng)是否安裝
1 xxx#iwconfig
若打印wlan0(或其他名字)的無(wú)線網(wǎng)卡信息,則表明無(wú)線網(wǎng)卡驅(qū)動(dòng)已經(jīng)安裝,否則要先安裝無(wú)線網(wǎng)卡驅(qū)動(dòng)方能繼續(xù)。
2. 配置/etc/sysconfig/network-scripts/ifcfg-wlan0
我的配置文件內(nèi)容為:
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. 安裝工具wpa_supplicant
1 xxx#yum install wpa_supplicant
4. 配置/etc/wpa_supplicant/wpa_supplicant.conf,寫入相關(guān)ssid和對(duì)應(yīng)的密碼
1 xxx#wpa_passphrase thm 12345678 >> /etc/wpa_supplicant/wpa_supplicant.conf
我的配置文件內(nèi)容為:
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. 后臺(tái)運(yùn)行wpa_supplicant進(jìn)程
1 xxx#wpa_supplicant -B -Dwext -iwlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf
6. 搜索無(wú)線網(wǎng)絡(luò)
1 xxx#iwlist wlan0 scan | grep ESSID
7. 連接無(wú)線網(wǎng)絡(luò)
1 xxx#iwconfig wlan0 essid "thm"
8. dhcp方式獲取ip
1 xxx#dhclient wlan0
9. 測(cè)試網(wǎng)絡(luò)是否聯(lián)通
1 xxx#ping www.baidu.com
關(guān)鍵詞:CentOS,無(wú)線上網(wǎng)
閱讀本文后您有什么感想? 已有 人給出評(píng)價(jià)!
- 0
- 0
- 0
- 0
- 0
- 0