关闭

在Linux下实现无线WPA

491人阅读 评论(0) 收藏 举报
下面的說法太復雜了,基本上在Debian下面,只要安裝kwlan,稍加配置就可以了。

kwlan可能首次運行不成功,要重新啟動一下系統。

===========================================================================

Mini HowTo


1) My setup is the following:

WiFi router: SMC Barricade WBR14-G2
WiFi card in laptop: Intel PRO/Wireles 3945
OS: Ubuntu 6.06 LTS (Dapper Drake)

2) The router settings:

Wireless encryption: WPA/WPA2 Only
Cipher suit: TKIP+AES (WPA/WPA2)
Authentication: Pre-shared Key (yes, I know 802.1X would be more secure... sue me)
Pre-shared key type: Passphrase (8~63 characters)

3) The package one needs to install:

# aptitude install wpasupplicant

4) Making WPA supplicant run:

First, create a config file, by the name /etc/wpa_supplicant.conf, and inside it, write:


ctrl_interface=/var/run/wpa_supplicant
ap_scan=1

network={
ssid="your_ssid_name"
scan_ssid=0
proto=WPA RSN
key_mgmt=WPA-PSK
pairwise=TKIP CCMP
group=TKIP CCMP
psk="your_preshared_key"
priority=5
}


At that point, you should make sure that the WiFi is turned on, and that the correct driver is loaded. In my case:

# modprobe ipw3945

Then, to test the WPA supplicant, run:


# wpa_supplicant -Dwext -ieth1 -c /etc/wpa_supplicant.conf


Recall I have used the wext device, instead of the ipw one, that would seem the appropriate one. Well, I read somewhere, that with 2.6.16 kernels and newer, this should be the case. Now I recall that my kernel is 2.6.15... nevermind, it works that way, and not the other (with -Dipw).

Recall also that my wireless device is eth1. Your mileage may vary (but each wireless card model gives rise to a precise device name, don't worry).

If everything went fine, the output for the above command should be something like:


# wpa_supplicant -Dwext -ieth1 -c /etc/wpa_supplicant.conf
Trying to associate with xx:xx:xx:xx:xx:xx (SSID='xxxxxxxx' freq=0 MHz)
CTRL-EVENT-DISCONNECTED - Disconnect event - remove keys
Authentication with 00:00:00:00:00:00 timed out.
Associated with xx:xx:xx:xx:xx:xx
WPA: Key negotiation completed with xx:xx:xx:xx:xx:xx [PTK=CCMP GTK=TKIP]
CTRL-EVENT-CONNECTED - Connection to xx:xx:xx:xx:xx:xx completed (auth)


If you see that "negotiation completed", it worked (Ctr-C to exit the above).

5) Automating the WPA connection when bringing wireless interface up

Next, I'll explain the small changes one has to make to /etc/network/interfaces to correctly bring up the interface. As I said, my wireless interface is eth1, so, I added the lines below to the aforementioned config file:


iface eth1 inet dhcp
wireless-essid my_wireless_essid
pre-up wpa_supplicant -Bw -Dwext -ieth1 -c /etc/wpa_supplicant.conf
post-down killall -q wpa_supplicant


And that's all! Whenever you ifup eth1, you'll bring up the wireless interface, with WPA encryption working. 
0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:32928次
    • 积分:603
    • 等级:
    • 排名:千里之外
    • 原创:27篇
    • 转载:1篇
    • 译文:0篇
    • 评论:2条
    文章分类
    文章存档
    最新评论
  • 破解无线网络

    wifi0595: 大家好,我司(鑫瑞科技)专注无线网络设备开发与运用,产品可以接五公里内的所有无线网络信号,也有接三公...

  • AR7WRD路由器的问题

    YEZO: AR7WRD是可以在AP内设拨号上网的,但是有一个问题是IP地址紧张时(周六周日)就很难连接上网了,...