Friday, July 14, 2006

How to get a syntax usb-400 wireless card to work with any linux distro

You bought the cheapo wireless card. It works well enought with windows, but in *nix, there is a problem. You have scourged various websites with specifics for varioux linux distros, saw something about hotplug, yada, yada yada...nothing works.

The foll. will get you through in MOST linux distros (have tried it on simplymepis, ubuntu, redhat 9.0)

Obtain the linux-wlan driver for your card (http://www.linux-wlan.org/) and install it. However, you need to install the kernel headers (no, this is not recompiling the kernel) before installing linux-wlan.

In debian distros, it is as simple as knowing your kernel (uname -a should give you that), followed by an apt-get install kernel-header.... (choose the right header corresponding to uname -a)

Now, tar unzip, your linux-wlan drivers file, do a configure (and pray to God you have everything required in your system) , a make (while selling Satan your soul for being able to build) , and finally a make install. Do all this as root to make your life easier.

Good, it builds! What next?

First, in your router, turn off encryption (Disable WEP and make auth type to be "open system" - believe me this is needed as a first step. Will save you hassle.)
Create a small script called wlan_script_basic.sh in your home directory consisting of the following lines:

sudo rmmod prism2_usb
sudo modprobe prism2_usb prism2_doreset
sudo wlanctl-ng wlan0 lnxreq_ifstate ifstate=enable
sudo wlanctl-ng wlan0 lnxreq_autojoin ssid="XXX" authtype=opensystem
sudo dhclient wlan0

XXX = name of your access point/router
(Pray that you will donate all your hair while your wlan0 acquires a lease)

Great! internet works.

Now, to set up WEP.
Enable WEP in your router, set a key (I am assuming it is 12345678, a 64-bit hex key), and select shared key as your system.

Now, write a new script containing the following:

sudo rmmod prism2_usb
sudo modprobe prism2_usb prism2_doreset
sudo wlanctl-ng wlan0 lnxreq_ifstate ifstate=enable
sudo wlanctl-ng wlan0 lnxreq_hostwep decrypt=true encrypt=true
sudo wlanctl-ng wlan0 dot11req_mibset mibattribute=dot11PrivacyInvoked=true
sudo wlanctl-ng wlan0 dot11req_mibset mibattribute=dot11WEPDefaultKeyID=0
sudo wlanctl-ng wlan0 dot11req_mibset mibattribute=dot11WEPDefaultKey0=""
sudo wlanctl-ng wlan0 lnxreq_autojoin ssid="XXX" authtype=sharedkey
sudo dhclient wlan0

Did it work?

Yes? Great, you are all set!
No? Spend 15 bux and get a wireless card that works with your distro. It will save you countless hours of hacking.

No comments: