命令行连接wifi

ubuntu没有图形界面,插入无线网卡后启动不能连接无线。

看这个帖子

http://askubuntu.com/questions/138472/how-do-i-connect-to-a-wpa-wifi-network-using-the-command-line

iw(list/config) can only handle WEP.

You need wpa-supplicant for this.

sudo apt-get install wpasupplicant

In /etc/wpa_supplicant.conf you put your ssid and password.

gksu gedit /etc/wpa_supplicant.conf 

Example:

network={
            ssid="ssid_name"
             psk="password"
}

Assuming your interface is wlan0 you can connect to it with...

wpa_supplicant -B -iwlan0 -c/etc/wpa_supplicant.conf -Dwext && dhclient wlan0

然后如果要开机连接
在/etc/rc.local中添加
wpa_supplicant -B -iwlan0 -c/etc/wpa_supplicant.conf -Dwext && dhclient wlan0
问题:
1.
驱动加载这一块还需要在实验,现在用的系统驱动已经加载好了。
2.
从解答中有iw,所以用iw可以执行,但iw只支持WEP
3.
wep,wep2-psk



posted @ 2013-12-06 21:56  silence.li  阅读(487)  评论(0编辑  收藏  举报