Jump to content

WEP on ndiswrapper


d3ac0n
 Share

Recommended Posts

Well, after finally being able to get my wireless working using ndiswrapper 1.1, I decided that I didn't want to run it unprotected, so I decided that I would setup WEP on my network. I set a 13 digit WEP key on my wireless base station and saved it in. When I went to set the encryption key on Mandrake, I got some strange errors

 

[root@SUMOMO deacon]# iwconfig wlan0 enc 1234567890123
Error for wireless request "Set Encode" (8B2A) :
SET failed on device wlan0; Invalid argument.

 

It doesn't matter WHAT I use for a WEP key or the length. I always get this error.

 

Any ideas?

Link to comment
Share on other sites

most likely means that the combination of:

 

your version of ndiswrapper

your version of your device's windows driver

your device

 

doesn't support WEP. Things to try in order of easiness:

 

1, get a newer version of the Windows driver

2, upgrade ndiswrapper - you'll have to build it from source and remove the MDK-packaged ndiswrapper.ko.gz in /lib/modules with the newly built one, then run depmod -a

3, get a new card.

Link to comment
Share on other sites

most likely means that the combination of:

 

your version of ndiswrapper

your version of your device's windows driver

your device

 

doesn't support WEP. Things to try in order of easiness:

 

1, get a newer version of the Windows driver

2, upgrade ndiswrapper - you'll have to build it from source and remove the MDK-packaged ndiswrapper.ko.gz in /lib/modules with the newly built one, then run depmod -a

3, get a new card.

Iwconfig CLI can be a pain sometimes... Before you take more drastic measures, make sure that your AP broadcasts SSID, make sure that both the AP and the card are configured to use open/shared WEP (can be either, buth the same for both of them), and make sure that you're using hex or ascii key on both the IP and the card. You can pass those parameters to iwconfig by adding them to /etc/sysconfig/network-scripts/ifcfg-wlan0

DEVICE=wlan0
USERCTL=yes
BOOTPROTO=dhcp
NETMASK=255.255.255.0
ONBOOT=yes
HWADDR=xx:xx:xx:xx:xx:xx
MII_NOT_SUPPORTED=no
NEEDHOSTNAME=yes
#
TYPE=Wireless
MODE=Managed
ESSID="Your_AP_essid"
ENCRYPTION=on
KEY="restricted s:ascii_password"

in the last line, restricted stands for "shared key", and "s:" means you use ascii password. Then reboot - for some reason, iwconfig not always flashes settings, especially, if there is a problem. Hard resetting may be better.

Link to comment
Share on other sites

ok, I understand the part about having ESSID broadcast on, although I don't understand the need for that. It's always worked without encryption with no ESSID broadcast.

 

What I'm stuck on is what you mean by the KEY line. This is what my config file looks like.

DEVICE=wlan0
BOOTPROTO=dhcp
ONBOOT=yes
HWADDR=<my NIC MAC>
METRIC=10
MII_NOT_SUPPORTED=no
WIRELESS_MODE=Managed
WIRELESS_ESSID= <My essid>
ENCRPTION=on
WIRELESS_ENC_KEY=<my key>
DHCP_HOSTNAME=SUMOMO
NEEDHOSTNAME=no

 

Now, as far as the shared/not shared, are you talking about normal WEP vs WPA? and why would there be two seperate sets of info on one line for a WEP or WPA key? could you clarify please?

Link to comment
Share on other sites

most likely means that the combination of:

 

your version of ndiswrapper

your version of your device's windows driver

your device

 

doesn't support WEP. Things to try in order of easiness:

 

1, get a newer version of the Windows driver

2, upgrade ndiswrapper - you'll have to build it from source and remove the MDK-packaged ndiswrapper.ko.gz in /lib/modules with the newly built one, then run depmod -a

3, get a new card.

 

Just as a brief answer to this, I am using the most updated driver for this card, and it does support WEP, and did work while under Windows 2000 with WEP and WPA. Here's a bit from my dmesg output

ndiswrapper: using irq 9
wlan0: ndiswrapper ethernet device xx:xx:xx:xx:xx:xx using driver net2pg54
wlan0: encryption modes supported: WEP, WPA with TKIP, WPA with AES/CCMP

 

So it's not an issue of WEP function not being supported or the NIC not working. I think there is a code issue or a config issue here, I just don't know what.

 

But thanks for the help anyways. I'll take any input I can get. :thumbs:

Link to comment
Share on other sites

ok, I understand the part about having ESSID broadcast on, although I don't understand the need for that.  It's always worked without encryption with no ESSID broadcast.

 

What I'm stuck on is what you mean by the KEY line.  This is what my config file looks like.

DEVICE=wlan0
BOOTPROTO=dhcp
ONBOOT=yes
HWADDR=<my NIC MAC>
METRIC=10
MII_NOT_SUPPORTED=no
WIRELESS_MODE=Managed
WIRELESS_ESSID= <My essid>
ENCRPTION=on
WIRELESS_ENC_KEY=<my key>
DHCP_HOSTNAME=SUMOMO
NEEDHOSTNAME=no

 

Now, as far as the shared/not shared, are you talking about normal WEP vs WPA?  and why would there be two seperate sets of info on one line for a WEP or WPA key?  could you clarify please?

In regard to SSID broadcast, normally it should not matter, but in my case (WPA+driverloader+wpa_supplicant) wireless only works with SSID broadcast enabled. On the other hand, disabling SSID broadcast does not add any extra security against atack, so it can be safely enabled when true security measures are in place, such as encryption.

 

As for WPA vs WEP, no I was not talking about WPA. WPA is a different and more secure authentication/encryption protocol which was introduced to replace WEP after the latter was found vulnerable to attacks. It looks like you're setting up WEP, which by all means better than no security, and should be sufficient for a home user to deter neighbors.

 

First off (though unlikely it matters) ENCRPTION=on should be ENCRYPTION=on, or maybe, WIRELESS_ENCRYPTION=on. I've seen scripts where keywords include the prefix WIRELESS_. Don't know the difference, could be a version/distro specific thing.

 

Second, and perhaps more important, is your key must be setup correctly. There are a couple of options here. On the base station, make sure that you have chosen "WEP" security, and that the option 'shared key' is chosen. Next, choose 128 bit (or 256 bit if you can) key and type in the ASCII key of proper length (128 bit encryption-13 ascii characters). Add the same key to ifcfg-wlan0 in this format

 

WIRELESS_ENC_KEY="restricted s:<my key>"

 

The word "restricted" and the prefix "s:" are important. They correspond to the "shared ascii" setting on the base station. Alternatives are to replace "restricted/shared" with "open", or use the HEX key format (drop "s:" then). Reboot/restart, and see how it goes...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...