# wlan-ng drivers and WEP

## valkur

I have read alot of the wep related posts but have not found any with the same break that I have here,  this is the steps I have taken to setup my wireless:

First of all I am using a Microsoft (I know, but lets not go there) USB Wireless adapter (MN-510).

```
USE="usb" emerge linux-wlan-ng

emerge wireless-tools

modprobe prism2_usb prism2_doreset=1

```

added iface_wlan0="dhcp" to /etc/conf.d/net

At this point I can connect to a Non-WEP access point by doing the following:

```
/etc/init.d/wlan start

dhcpcd wlan0

```

However I need WEP so I continue....

created /etc/conf.d/wlancfg-<WEP enabled ssid> and edit to be the following:

```
lnxreq_hostWEPEncrypt=true

lnxreq_hostWEPDecrypt=true

dot11PricacyInvoked=true

dot11WEPDefaultKeyID=0

dot11ExcludeUnencrypted=true

PRIV_GENERATOR=/sbin/keygen

PRIV_KEY128=false

PRIV_GENSTR=""

dot11WEPDefaultKey0=XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX

dot11WEPDefaultKey1=

dot11WEPDefaultKey2=

dot11WEPDefaultKey3=

IS_ADHOC=n

AuthType="sharedkey"

BCNINT=100

CHANNEL=6

BASICRATES="2 4"

OPRATES="2 4 11 22"

```

Just to make sure I also have tried commenting out all the PRIV_ lines as I am using a shared key.

Now my WEP should be setup so I start the interface and try to get an IP address, which times out.  dmesg gives me the following info:

```
linkstatus=CONNECTED

wlan0: no IPv6 routers present

dhcpcd[3551]: timed out waiting for a valid DHCP server response
```

So it appears it is not using the key, I have also tried putting the key in Key1= because the access point lists them 1 - 4 and I am using 1, still no luck.

Running iwconfig wlan0 gives me the following info:

```
wlan0  IEEE 802.11-b ESSID:""

       Mode:Managed  Frequency:2.437GHz  Access Point: XX:correct MAC:XX

       Bit Rate:11Mb/s  Tx-Power:2346 dBm

       Retry min limit:8  TRS thr:off  Fragment thr:off

       Encryption key:off

       Link Quality:92/92  Signal Level:-40 dBm  Noise level:-99 dBm

       Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0

       Tx excessive retries:0  Invalid misc:0  Missed beacon:0

```

I then try to set the encryption manually using iwconfig but no matter what command I try to give it all I get is the following error:

```
iwconfig wlan0 key xxxxxxxxxxxxxxxxx

Error for wireless request "Set Encode" (8B2A) :

  SET failed on device wlan0 ; Function not implemented.

```

Any one dealt with this or am I missing something obvious?  Please shed some light.

Thanks.

----------

## UberLord

I could never get the wlan drivers to play nicely with my WEP.

Using the standard 2.6 kernel drivers and pcmcia-cs and wirelesstools I've got it to work nicely  :Smile: 

----------

## valkur

I should have mentioned, I am using the 2.4 gentoo-sources kernel with USB.

----------

## prnstr

The key to getting the wlan-ng drivers to work is to update the firmware on your card.  Most of the drivers features are based on the firware.  I was having lots of problems till I updated mine.

----------

## valkur

I checked the intersil firmware on this thing, and its 0.83.

Is there a newer one available? do you know where I can find it?

Thanks.

----------

## prnstr

Here is a link to an upgrade site.   Upgrading the firmware is a little risky because most manufactures don't support it.

http://www.macsense.com/support/aeropad/firmwareupgrade.html

Good luck.  From what I read, its best to use a windows util to update the firmware.

----------

## prnstr

One thing I missed in your previous post is that wireless tools do not work with the wlan-ng drivers, i.e. iwconfig.  You need to do the configuration via the wlan-ng config files.  Since most gui programs use wireless tools you may want to consider going with the hostap drivers.  If you stay with wlan-ng the config file is in /etc/conf.d/wlan.conf.

----------

## valkur

Thanks!  I risked the update and it went smoothly, so I am going to see what I can do now.

----------

## deeppro

do not upgrade your firmware, it's just bullshit !!!

you just need to do this before using dhcpcd eth1

```
iwconfig eth1 essid ... key open XXXXXXXXXXXXX.
```

it's just the open who was missing ...

----------

## desh

I don't think either of the above solutions is right (upgrading the firmware, or using iwconfig).  I'm running into the same problem with wlan-ng and WEP, and here's what I know for sure:

- This same card (PCI PLX card + Belkin PCMCIA card) worked fine, WEP enabled, in an older version of wlan-ng on Red Hat 8

- I have not changed the firmware since, so this has nothing to with firmware revisions

- iwconfig (i.e. wireless extensions) is supported by newer releases of wlan-ng, but wlanctl-ng should be the right way of doing this.  In particular, "iwconfig eth1 essid ... key open XXXXXXXXXXXXX" does not work.

- The Gentoo /etc/init.d/wlan script uses wlanctl-ng to enable WEP on the card, and the reported return codes indicate success, but iwconfig on wlan0 still shows that encryption is not enabled on the card.

- But iwconfig on another machine (my home-built access point running Red Hat 8 and the hostap driver) shows encryption enabled, and displays the right WEP key.

Therefore: there is something wrong with either this release of wlan-ng (0.2.1-pre11), or with the way the Gentoo scripts are initialising the card.

Here are the wlanctl-ng commands that are being issued by the startup script (I've omitted the actual WEP keys), and all are being reported successful:

```

 /sbin/wlanctl-ng wlan0 dot11req_mibset mibattribute=dot11WEPDefaultKeyID=0

 /sbin/wlanctl-ng wlan0 dot11req_mibset mibattribute=dot11ExcludeUnencrypted=true

 /sbin/wlanctl-ng wlan0 dot11req_mibset mibattribute=dot11PrivacyInvoked=true

 /sbin/wlanctl-ng wlan0 dot11req_mibset mibattribute=dot11WEPDefaultKey0=xxx

 /sbin/wlanctl-ng wlan0 dot11req_mibset mibattribute=dot11WEPDefaultKey1=xxx

 /sbin/wlanctl-ng wlan0 dot11req_mibset mibattribute=dot11WEPDefaultKey2=xxx

 /sbin/wlanctl-ng wlan0 dot11req_mibset mibattribute=dot11WEPDefaultKey3=xxx

```

----------

## benguru

Hi,

Sorry for bringing this topic back, and going off topic, but Valkur mentioned he used a MN-510, I also have one and was trying to set it up. I emerge both linux-wlan-ng, and wireless-tools, but when I do the modprobe it says prism2_usb is unknown, or something like that. Can you tell me what I am doing wrong? Please help, thanks

EDIT: I wasn't setting USE="usb" and emerge linux-wlan-ng on the sme line, or exporting. Doh.

----------

## lazaruslong

I found that if I used the genstr settings in the wlancfg-ssid file and made sure NOT to put in a specific key code - it worked!

----------

## MattSharp

I am still having problems with this. I can't for the life of me get Encryption turned on. I have the settings mentioned for the wlancfg file but it still show nothing. Anyone ever solve this?

----------

## echo6

Thanks to desh for the commands I've managed to manualy set up a D-Link DWL-122 usb with encryption doing it manually via a shell script.

----------

## MattSharp

 *echo6 wrote:*   

> Thanks to desh for the commands I've managed to manualy set up a D-Link DWL-122 usb with encryption doing it manually via a shell script.

 

I have all that info in my config file already? Should I still type it in the shell?

----------

## echo6

Worth a try!

I need to do it via a shell script as I've installed the drivers,  default install with usb,  on a remastered Knoppix boot cdrom.

Just wish I could work out how to get the device configured for Ad-Hoc.

----------

