# WEP linux-wlan-ng pcmcia! [SOLVED]

## oiper

 :Sad:   I don't know what to think anymore. linux-wlan-ng seems to be running. changes to the ssid in /etc/conf.d/wlan.conf does affect the essid of my card when plugged in.

I'm running a 2.6 kernel

linux-wlan-ng-0.2.1-pre20

pcmcia-cs

my card will work without WEP, but not with! I have tried a number of things, and... sigh.... here's my configs:

/etc/conf.d/wlan.conf

```
WLAN_DEVICES="wlan0"

ChannelList="01:02:03:04:05:06:07:08:09:0a:0b:00:00:00"

ChannelMinTime=200

ChannelMaxTime=250

WLAN_SCAN=n

SSID_wlan0=""

ENABLE_wlan0=y

```

/etc/conf.d/wlancfg-eldorado

```
lnxreq_hostWEPEncrypt=true     # true|false

lnxreq_hostWEPDecrypt=true     # true|false

dot11PrivacyInvoked=true        # true|false

dot11WEPDefaultKeyID=0          # 0|1|2|3

dot11ExcludeUnencrypted=true    # true|false, in AP this means WEP is required.

PRIV_GENERATOR=/sbin/keygen     # nwepgen, Neesus compatible

PRIV_KEY128=true                # keylength to generate

PRIV_GENSTR="lostcityofgold"

dot11WEPDefaultKey0=            # format: xx:xx:xx:xx:xx   or

dot11WEPDefaultKey1=            #         xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx

dot11WEPDefaultKey2=            #  e.g.   01:20:03:40:05   or

dot11WEPDefaultKey3=            #         01:02:03:04:05:06:07:08:09:0a:0b:0c:0d

IS_ADHOC=n                      # y|n, y - adhoc, n - infrastructure

AuthType="sharedkey"            # opensystem | sharedkey (requires WEP)

BCNINT=100                      # Beacon interval (in Kus)

CHANNEL=6                       # DS channel for BSS (1-14, depends

                                #   on regulatory domain)

BASICRATES="2 4"                # Rates for mgmt&ctl frames (in 500Kb/s)

OPRATES="2 4 11 22"             # Supported rates in BSS (in 500Kb/s)

```

/etc/pcmcia/wireless.opts

```
case "$ADDRESS" in

##### BUNCH OF EXAMPLES #####

#####I TOOK OUT THE LINES THAT TOLD ME TO REMOVE THEM#####

# Generic example (decribe all possible settings)

*,*,*,*)

    INFO="Fill with your own settings..."

    # ESSID (extended network name) : My Network, any

    ESSID="eldorado"

    # NWID/Domain (cell identifier) : 89AB, 100, off

    NWID=""

    # Operation mode : Ad-Hoc, Managed, Master, Repeater, Secondary, auto

    MODE="Managed"

    # Frequency or channel : 1, 2, 3 (channel) ; 2.422G, 2.46G (frequency)

    FREQ=""

    CHANNEL="6"

    # Sensitivity (cell size + roaming speed) : 1, 2, 3 ; -70 (dBm)

    SENS=""

    # Bit rate : auto, 1M, 11M

    RATE="11M"

    # Encryption key : 4567-89AB-CD, s:password

    KEY="79E4-264D-A0AA-A938-576F-EE72-1C"

    # RTS threshold : off, 500

    RTS=""

    # Fragmentation threshold : off, 1000

    FRAG=""

    # Other iwconfig parameters : power off, ap 01:23:45:67:89:AB

    IWCONFIG=""

    # iwspy parameters : + 01:23:45:67:89:AB

    IWSPY=""

    # iwpriv parameters : set_port 2, set_histo 50 60

    IWPRIV=""

    ;;

esac

```

The result:

```
bash-2.05b# iwconfig  wlan0

wlan0     IEEE 802.11-b  ESSID:"eldorado"  Nickname:"eldorado"

          Mode:Managed  Frequency:2.437GHz  Access Point: 00:06:25:DA:52:51

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

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

          Encryption key:off

          Link Quality:36/92  Signal level:-75 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

```

```
bash-2.05b# iwconfig wlan0 key restricted 79E4264DA0AAA938576FEE721C

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

    SET failed on device wlan0 ; Operation not supported.

bash-2.05b# iwconfig wlan0 key 79E4264DA0AAA938576FEE721C

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

    SET failed on device wlan0 ; Operation not supported.

bash-2.05b# iwconfig wlan0 key 79E4-264D-A0AA-A938-576F-EE72-1C

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

    SET failed on device wlan0 ; Operation not supported.

```

Somebody has to have a solution for this. I've been attempting to get WEP running off and on for weeks now.   :Sad:   :Sad:   I'm getting very weary of it. Thanks.

----------

## epretorious

oiper:

I belive that /etc/conf.d/wlancfg* files are for configuring a PCI WLAN NIC and I don't know where the configuration settings for PCMCIA/CardBus adapters do go. I'm still trying to understand linux-wlan-ng.    :Embarassed: 

----------

## oiper

baaaaaaahhhhhhhhhhhhHHH!!!!!!!!!!!!!!!!!!!!

TURNS OUT, that iwconfig is simply not reporting WEP encryption correctly with the ng-wlan ... drivers... or whatever they are. It's been wanting to work all along, but each time I tried, I'd check iwconfig first, then see it UNENCRYPTED and give up! 

So, it's working! I really accidently figured this one out.   :Shocked:   :Very Happy: 

----------

## cartpullerjack

how did you actually set the encryption key?  iwconfig?

I'm having a hard time connecting to encrypted aps.

----------

## ebpowell

oiper et al:

Ok, I admit it...been at the same place wrt  linux_wlan-ng and WEP.

After reading yuor post, shut down the eth0, unplugeed the cable and brought up wlan0 and viola! I can ping the rest oif my nw.

Thanks for the tip! 

 :Very Happy: 

----------

## cartpullerjack

Would you mind walking me through the steps you take?

I"ve been doing:

```

wlanctl-ng wlan0 lnxreq_autojoin ssid=Wireless authtype=sharedkey

/etc/init.d/net.wlan0 start

```

where I have a file /etc/wlan/wlancfg-Wireless that contains the wep key and what not.  This has not been working.  Iwconfig will tell me that i'm connected and I know that my keys are correct, but starting wlan0 hangs on getting a dhcp lease, indicating to me that somehow encryption isn't working properly.  Also, I can connect unencrypted without any problems to the same access point.

So, I suspect that I'm probably initializing the thing incorrectly, or else I've setup the file incorrectly.  Thanks for any help.

----------

## ebpowell

My process was very chaotic (read half the bloody internet), but here goes, best as I can remember:

Background / Specs:

1) Using kerenl 2.6.9-gentoo-r13

2) My card is an AirVast Tiawan Prism3 (built into my laptop (ECS 535)

3) My card is a USB based card

My Process:

1) Got USB working(compiled as modules in the lernel)

2) emeregd hotlpug, coldplug, usbview, udev

3) added hotplug and coldplug to boot 

```

rc-update add hotplug default

rc-update add coldplug default

```

4)  modified/etc/modules.d/ modiles.alias and addedd:

```

alias wlan0 prsim2_usb 

#update-modules

```

5) emerged linux-wlan-ng-0.2.1.pre20

```

#ACCEPT_KEYWORDS="~x86" FEATRUES=-sandbox" USE="usb" emerge =linux-wlan-ng-0.2.1-pre20

```

6) edited /etc/conf.d/net

```

iface_wlan0="192.168.1.28 broadcast=192.168.0.1 netmask=255.255.255.0"

gateway="wlan0/192.168.1.1"

```

7) Modifed /etc/.conf.d/wlan.conf (I use 128 WEP encryption on my nw)

```

WLAN_DEVICES="wlan0"

ChannelList="01:02:03:04:05:06:07:08:09:0a:0b:00:00:00"

ChannelMinTime=200

ChannelMaxTime=250

WLAN_SCAN=n

SSID_wlan0="flyingbison"

ENABLE_wlan0=y

```

 :Cool:  Set up SSID script:

```

#cp  /etc/conf.d/wlancfg_DEFAULT ./wlancfg-flyingbison

```

9) Setup wlancfg-flyingbison to use my nw WEP:

```

lnxreq_hostWEPEncrypt=true

lnxreg_hostWEPDecrypt=true

dot11PrivacyInvoked=true

dot11WEPDefaultKeyID=0

dot11ExcludeUnencrypted=true

PRIV_GENERATOR=/sbin/keygen

PRIV_KEY128=true

PRIV_GENSTR="<insert your WEP passphrase here>"

IS_ADHOC=n

dot11DesiredSSID="flyingbison"

AuthType=opensystem"

```

10) Copied /etc/init.d/net.eth0 /etc/init.d/net.wlan0

11) Added wlan and net.wlan0 to my rc scripts:

```

rc-update add wlan default

rc-update add net.wlan0 default

```

12) Added the following line to /etc/modules_autoload.d/kernel-2.6

```

prisems2_usb prism2_doreset=1

```

Hope this helps and that I didn't leave anything out....

Remember- iwconfig WILL LIE TO YOU!  :Shocked: 

----------

