niedziela, 5 kwietnia 2009

Linksys WUSB54G / WPA2 and FreeBSD 7.1

In order to make my Internet connection usable I had to configure my Linksys WUSB54G USB wireless adapter. The driver that I use for this device is rum. It should be compiled into the default kernel but if it is not, one need to add the following line to the /boot/loader.conf file:

if_rum_load="YES"

More information on the driver can be found in the manual rum(4). Afterwards the device should be properly detected by the OS - in my case it was rum0.

The next step is to configure the WPA2 wireless connection. For this I purpose I used wpa_supplicant tool. First the connection details have to be specified in the configuration file - I used /etc/wpa_supplicant.conf (the content of which can be found below):

network={
ssid=
proto=WPA2
key_mgmt=WPA-PSK
psk=
}

To establish connection and obtain the IP address via dhcp I created a simple script:

#!/bin/sh
wpa_supplicant -irum0 -c/etc/wpa_supplicant.conf -B
sleep 2
dhclient rum0

The first line establishes the WPA2 connection with the AP. Unfortunately the call to the wpa_supplicant was not synchronous, which means that the tool had finished before the connection to the AP was established. Therefore I had to add a sleep for 2 seconds before invoking the dhclient to automatically obtain the IP address. I know there are better ways to do it but actually I did not have too much time to work on it.

Brak komentarzy:

Prześlij komentarz