Tuesday, July 20, 2010

Misc 41

I'll now sidetrack a little bit to Debian. More specifically, I'm going to go into setting up WLAN services in Debian using Windows drivers. Yes you heard me right, you can actually natively use Windows drivers in Debian as long as the architecture is the same (e.g. an i386 driver for an i386 installation of Debian).
This sounds like a miracle and it probably is. It is completely done through a software wrapper known as NDISwrapper. NDISwrapper dynamically links the driver through Windows kernel and NDIS APIs. Notice that I mentioned "natively" in the previous paragraph. This explicitly means that there is no emulation involved, and so implementation would be reliable and fast.

If we have module-assistant, Debian can help us set up the entire NDISwrapper module from scratch, including downloading of the source, compiling, and installing. In this example, I am going to use the Netgear WG111T wireless adapter. We'll need a few files. First, we need to download the driver and extract it to a folder. To download the driver, we'll use the wget command:
apt-get install wget
wget http://www.netgear.de/download/WG111T/WG111T_GRV1.2.zip

Now, we'll unzip using the unzip command:
apt-get install unzip
unzip WG111T*zip -d wg111t

Now, we'll install ndiswrapper. To do this, we'll need to first install module-assistant and wireless-tools:
aptitude install module-assistant wireless-tools

Now, we'll use the module-assistant's automatic install feature to completely install ndiswrapper from source:
m-a a-i ndiswrapper

Now, we would need to add ndiswrapper to load on start up:
echo ndiswrapper >> /etc/modules

Now we can begin installing the drivers. To do this, browse into the folder you just extracted:
cd wg111t/WG111T_GR\ V1.2/

Next, we'll install two .inf files required for the device to work. To know the files to use, we need to check the database of known working devices here:
ndiswrapper -i athfmwdl.inf
ndiswrapper -i netwg11t.inf
ndiswrapper -m

Now if you haven't started ndiswrapper, type:
modprobe ndiswrapper

Check your interfaces file to make sure that wlan0 exists. If it doesn't, manually add in a line like this:
iface wlan0 inet dhcp

Here is where we choose our SSID and authentication method. For this case, I'll use WEP. To do this, we'll need to use the iwconfig command:
iwconfig wlan0 essid Kelvin
iwconfig wlan0 key CF3E89B61E

Now turn on your interface using the ifup command like this:
ifup wlan0

Now, if you would like to use WPA-Personal instead, you would configure the network file as follows:
iface wlan0 inet dhcp
wpa-ssid Kelvin
wpa-psk CF3E89B61E

In the next article, I'll walk through setting up of EAP-TLS (WPA/2-Enterprise) by making use of the wpa_supplicant.conf file.

No comments :

Post a Comment