# Wireless - Broadcom WEP Support

## xante

I have successfully got a Broadcom wireless access working without a WEP key on  a D-Link router, but when I attempt to enable the wepkey I can never get a connection.

```
lappy xante # iwlist wlan0 scan

wlan0     Scan completed :

          Cell 01 - Address: 00:0E:2A:31:7A:B6

                    ESSID:"hellscoming"

                    Protocol:IEEE 802.11g

                    Mode:Managed

                    Frequency:2.437 GHz (Channel 6)

                    Quality:0/100  Signal level:-52 dBm  Noise level:-256 dBm

                    Encryption key:on

                    Bit Rate:1 Mb/s

                    Bit Rate:2 Mb/s

                    Bit Rate:5.5 Mb/s

                    Bit Rate:11 Mb/s

                    Bit Rate:6 Mb/s

                    Bit Rate:12 Mb/s

                    Bit Rate:24 Mb/s

                    Bit Rate:36 Mb/s

                    Bit Rate:9 Mb/s

                    Bit Rate:18 Mb/s

                    Bit Rate:48 Mb/s

                    Bit Rate:54 Mb/s

                    Extra:bcn_int=20

                    Extra:atim=0

lappy xante #  iwconfig wlan0 essid hellscoming 

lappy xante # iwconfig wlan0 key restricted 12345123451234512345123451

lappy xante # iwconfig wlan0

wlan0     IEEE 802.11g  ESSID:off/any  

          Mode:Managed  Frequency:2.412 GHz  Access Point: 00:00:00:00:00:00   

          Bit Rate=54 Mb/s   Tx-Power:25 dBm   

          RTS thr:off   Fragment thr:off

          Encryption key: 1234-5123-4512-3451-2345-1234-51   Security mode:restricted

          Power Management:off

          Link Quality:100/100  Signal level:-10 dBm  Noise level:-256 dBm

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

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

lappy xante # 

```

Am I doing something wrong...I am positive the wepkey is correct.  I also know that the key is already in hex format...Im not sure what else to correct. Any suggestions would be appreciated.

----------

## tamarian

I think it's just a matter of supplying the channel id (6) to the config, I know mine was picky and required that.

iwconfig wlan0 channel [channel number] essid [your wireless net essid name] key [your WEP key]

----------

## xante

Sorry for the long time-no post but I tried adding a channel 6 to it and this made no difference...Any other suggestions?

----------

## tamarian

O.k., check my post here at the bottom, it has the full sequence, from installing the driver to dhcp:

https://forums.gentoo.org/viewtopic-t-313162-highlight-.html

This thread should be helpful as well (I'm assumping you have an AMD notebook HP/Compaq?)

https://forums.gentoo.org/viewtopic-t-228288-highlight-.html

----------

## xante

Actually, If you check the last to pages of your second link...Its mostly me and fcgreg trying to get it working...He eventually tells me to fork off into a new thread because wireless security and networking isnt directly related to compaq presarios.

As for the first link, It says the same thing you told me to do.  Which as you can see was unsuccessful... Is there anything else I'm missing?

----------

## fcgreg

Xante... just a quick note on this.  I am also experiencing this problem when attempting to connect to certain access points.  For some AP's, however, it works just fine.  For the failing AP's the behavior is the same as yours:  If I connect with no encryption it works perfectly.  If I attempt to enable WEP, WPA, or anything of the sort, it fails.  I've had the same results with and without wpa_supplicant (all recent versions, stable and development).

As I said, there are other WEP-enabled AP's that I'm connecting to just fine.  I'm not sure what's going on with the others (DLink for you and Orinoco for me).

I've done a boatload of searching around the net and the forums for the issues I'm seeing in the debug output.  The only thing even remotely helpful that I can find is that the problem seems to be prominent with NDISWrapper users.  However, since it works for some AP's and not for others, I'm not sure what to think about this.

Anyone else have any helpful suggestions?

----------

## xante

Maybe this still is a bit of a hardware/software problem then?  What kind of access points are you able to connect to with a wep key fcgreg?  Maybe I'll just update my wireless point instead of fooling around with an already working wireless card.  If you do find a solution...Please remember to post  :Smile: .

----------

## fcgreg

 *xante wrote:*   

> Maybe this still is a bit of a hardware/software problem then?

 

It's possible.  At this point I'm ready to throw up my hands.  For starters, I'm about to enhance some of the error output in wpa_supplicant, because I'm getting REALLY TIRED of the never-answered problem of:

```
Authentication with 00:00:00:00:00:00 timed out
```

The above error is what I get when trying to connect to my enterprise Orinoco access point using wpa_supplicant.  I get this same error when trying any type of encryption on the AP:  WEP, WPA-PSK, etc.  No matter how high you turn up the debug output it shows me nothing that seems verbose enough to be useful about what is happening.

BTW, I see this same error reported out on the Web and I've never seen an answer.  The only common thread I could find is what I reported earlier:  It seems they were also using NDISWrapper (but with different drivers it seems).  I couldn't find all that many posts, though, so I'm not sure if NDISWrapper involvement was just a coincidence or not.

 *xante wrote:*   

> What kind of access points are you able to connect to with a wep key fcgreg?  Maybe I'll just update my wireless point instead of fooling around with an already working wireless card.

 

I've considered doing the same thing.  To answer your question, I've been able to connect to LinkSys AP's using WEP with absolutely no problems so far.  FYI:  These were standard LinkSys devices using the factory firmware.  I haven't tried the Linux port of the firmware.

 *xante wrote:*   

> If you do find a solution...Please remember to post .

 

I always do.  I know you'll do the same.  Thanks.

----------

## tamarian

re: access points, I'm using a D-Link (DI-614) with no problems using Wep

----------

## fcgreg

 *tamarian wrote:*   

> re: access points, I'm using a D-Link (DI-614) with no problems using Wep

 

Xante, maybe you could tell us which model of D-Link you are using?  If you're using the same model as Tamarian, that would indicate to us that our problem may be related to 64-bit hardware (which Tamarian may not be using).

I'm trying to find common threads here that may help us.

----------

## tamarian

I'm using the AMD-64 tree: uname -a => "Linux Presario 2.6.11-gentoo-r5 #1 Tue Apr 5 22:00:17 EDT 2005 x86_64 AMD Athlon(tm) 64 Processor 3400+ AuthenticAMD GNU/Linux". 

Am using ndsiwrapper with the 64 bit Boardcom driver fir Windows  (downloaded from the Ubuntu forums)

From lspci:  Network controller: Broadcom Corporation BCM4306 802.11b/g Wireless LAN Controller (rev 03)

----------

## fcgreg

 *tamarian wrote:*   

> I'm using the AMD-64 tree: uname -a => "Linux Presario 2.6.11-gentoo-r5 #1 Tue Apr 5 22:00:17 EDT 2005 x86_64 AMD Athlon(tm) 64 Processor 3400+ AuthenticAMD GNU/Linux". 

 

Excellent!  You're a perfect test-case.

 *tamarian wrote:*   

> Am using ndsiwrapper with the 64 bit Boardcom driver fir Windows  (downloaded from the Ubuntu forums)

 

I see in their forums a link to the Linuxant drivers (e.g., to the Linuxant site).  Can you confirm exactly where you downloaded it from?  I just want to make sure there isn't a problem lurking in the driver sources somehow.

I downloaded mine directly from the Linuxant site.

 *tamarian wrote:*   

> From lspci:  Network controller: Broadcom Corporation BCM4306 802.11b/g Wireless LAN Controller (rev 03)

 

That's the exact same internal card that I have, and it should be identical for Xante.  This is a perfect testing scenario for us.  We should be able determine fairly easily if this is related to our software builds/configuration or the AP's.

----------

## fcgreg

Tamarian, could you also advise which baselayout you are using?  I'm using the current stable version -- sys-apps/baselayout-1.9.4-r7.

I never bothered upgrading to the newer baselayout to get the wireless configuration tools.  However, I will if we need to rule that out as a possible problem.

How about you, Xante (which version of baselayout)?

----------

## tamarian

 *fcgreg wrote:*   

> Tamarian, could you also advise which baselayout you are using?  I'm using the current stable version -- sys-apps/baselayout-1.9.4-r7.
> 
> I never bothered upgrading to the newer baselayout to get the wireless configuration tools.  However, I will if we need to rule that out as a possible problem.

 

I'm using the same baselayout as you, 1.9.4-r7. I don't use the auto init scripts, just enter the commands through the shell.

----------

## fcgreg

Same here.  OK, this is a bit frustrating.  We have practically identical configurations in hardware and software, and no obvious problems can be found.  I wonder if my system would work properly with your AP as well.  I'm a little far away from you, otherwise I'd be inclined to try.  :Smile: 

FYI:  I found the attachment download link from the Ubuntu forums.  I verified it against mine and they are identical, byte for byte.  So this isn't a driver difference.

At this point I'm looking forward to hearing back from Xante.  If he has the same AP as you I'll REALLY be stumped.  Otherwise I'm going to assume at this point that some AP's just don't work well with the NDISWrapper system.

----------

## xante

My hardware is exactly the same as Tamarians as well as the drivers...I have upgraded to the "unstable" version of baselayout but have not used any init scipts, Just the command line. My router is a D-Link (DL-624), so a little bit different. Doubt by much though.

Linux lappy 2.6.11-gentoo-r6 #1 Fri May 13 13:57:33 CST 2005 x86_64 AMD Athlon(tm) 64 Processor 3000+ AuthenticAMD GNU/Linux

sys-apps/baselayout-1.11.12-r2

----------

## fcgreg

 *xante wrote:*   

> My hardware is exactly the same as Tamarians as well as the drivers...
> 
> My router is a D-Link (DL-624), so a little bit different. Doubt by much though.

 

Still, it is a difference and really the only one we have at this point:  different AP's.

Well, I'm feeling stumped with this one.  We've ruled out wireless driver differences, PC hardware differences, and PC software/driver differences.  Therefore, I see only possible cause at this point:

There may be differences between the way certain access points handle encryption and/or authentication.  These differences must not play well with NDISWrapper or our wireless drivers.  In other words, this problem appears to be AP-specific.

Incidentally, such things may explain the proliferation of posts saying things like "Sometimes WEP is a fickle beast", "WEP can be hard to get working", etc.  It really isn't that hard, normally.

I'll try to get mine working with newer wireless drivers at some point.  If I ever find the cause of the problem (or a solution) I'll report back.  Thanks for all of the help.

----------

## gen2g33k

I just got my wireless working on a Compaq Presario R3190US with ndiswrapper, Broadcom 64bit drivers, 2wire homeportal router and dhcpcd.  I did the following to bring up wlan0 interface:

```

gen2g33k # iwconfig wlan0 channel 6 essid Ub3rB0x3n key open 0123456789 commit

gen2g33k # rm /var/run/dhcpcd-wlan0.pid

gen2g33k # dhcpcd wlan0

gen2g33k # ifconfig wlan0 up

gen2g33k # ping -c 3 www.yahoo.com

```

Since im using WEP-open authentication (as opposed to WEP-PSK and WPA-PSK), I use security mode "open" with the "key" parameter and enter my 10-digit hex encryption key (in your case, you'd use restricted instead of open). The "commit" paramater at the end forces to apply all changes. If your using DHCP, make sure you remove any previous .pid files, then dhcpcd your wireless interface (wlan0). You have to bring up the Broadcom card via "ifconfig wlan0 up" and you should be set to ping some address.

Hope this helps. :Very Happy: 

----------

## fcgreg

We've basically tried all of this already, but at this point it would be prudent for me to make one final verification.  We done so many tests in different orders with different encryption scenarios that we may have missed something.

Thanks for the info... I'll give your command sequence (and a few common-sense variations) one final shot.

----------

## maKKus

I have a HP nx9105 since last week and the same lspci message:

0000:02:02.0 Network controller: Broadcom Corporation BCM4306 802.11b/g Wireless LAN Controller (rev 03)  (same network controller).

Using base-layout 1.11.12-r4 and wireless-tools-28_pre6 (I use ~amd64).

Didn't get it working by hand either. But there were a lot of problems together. First eth0 was still configured and up and running even if not being added in the runlevels. This caused problems with routing (same rooter), only removing eth0 from the configuration (net in conf.d) solved it. 

I still don't understand why "iwconfig wlan0 essid makkus" doesn't set the ESSID on the network card , your first post shows the same, ESSID set to off/any.

Second I'm glad that I did got it working two days ago because yesterdays upgrade of wireless-tools (form pre6 to pre7) did cause the network card stop working dmesg gave a error:

ndiswrapper (iw_set_encr:692): removing encryption key 0 failed (c0010015).

In short the ap got recognized the card got configured, but there is no traffic between ap and card, dhcp is not getting assigned. If iwconf is not able to set the right encryption no wonder it fails. With this I want to show you that wireless-tools are hardly stable and maybe you should look at what for a wireless-tools you use. Going back to pre6 fixed it. Bug submitted:

https://bugs.gentoo.org/show_bug.cgi?id=94206

In desperation I started to read how I could configure the card the gentoo way (through /etc/conf.d/wireless) and behold I got it running  :Smile:  . 

/etc/conf.d/net is empty (dhcpcd by default)

/etc/conf.d/wireless:

essid_wlan0="hom"

key_hom="s:XXXXXXXXXXXXX enc open"

mode_wlan0="auto"

channel_wlan0="6"

preferred_aps=( "hom" )

ndiswrapper things:

ndiswrapper -i  /etc/ndiswrapper/netbc564/netbc564.inf  (the Linuxant drivers)

modprobe ndiswrapper (putting ndiswrapper in /etc/modules.autoload.d/kernel-2.6 does this at boot)

ndiswrapper -l 

Installed ndis drivers:

netbc564        driver present, hardware present

Command:

/etc/init.d/net.wlan0 start (/etc/init.d/net.wlan0 is a soft link to /etc/init.d/net.lo)

Later rc-update add net.wlan0 default for starting at boot.

iwlist wlan0 scan:  (An Acer WLAN-G-RU1 by the way)

 wlan0     Scan completed :

          Cell 01 - Address: XX:XX:XX:XX:XX:XX

                    ESSID:"hom"

                    Protocol:IEEE 802.11g

                    Mode:Managed

                    Frequency:2.437 GHz (Channel 6)

                    Quality:0/100  Signal level:-59 dBm  Noise level:-256 dBm

                    Encryption key:on

                    Bit Rate:1 Mb/s

                    Bit Rate:2 Mb/s

                    Bit Rate:5.5 Mb/s

                    Bit Rate:6 Mb/s

                    Bit Rate:9 Mb/s

                    Bit Rate:11 Mb/s

                    Bit Rate:12 Mb/s

                    Bit Rate:18 Mb/s

                    Bit Rate:24 Mb/s

                    Bit Rate:36 Mb/s

                    Bit Rate:48 Mb/s

                    Bit Rate:54 Mb/s

                    Extra:bcn_int=100

                    Extra:atim=0

iwconfig wlan0

iwlan0     IEEE 802.11g  ESSID:"hom"  Nickname:"hom"

              Mode:Auto  Frequency:2.437 GHz  Access Point: 00:09:F3:09:98:53

              Bit Rate=54 Mb/s   Tx-Power:24 dBm

              RTS thr:off   Fragment thr:off

              Encryption key:XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XX   Security mode:open

              Power Management:off

              Link Quality:99/100  Signal level:-60 dBm  Noise level:-256 dBm

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

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

gentoo script manages to get the ESSID set, got the figure that one out sometime!

ifconfig wlan0

iwlan0     Link encap:Ethernet  HWaddr 00:90:4B:A5:1A:52

              inet addr:192.168.1.3  Bcast:192.168.1.255  Mask:255.255.255.0

              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

              RX packets:1575 errors:0 dropped:0 overruns:0 frame:0

              TX packets:569 errors:0 dropped:0 overruns:0 carrier:0

              collisions:0 txqueuelen:1000

              RX bytes:380493 (371.5 Kb)  TX bytes:60570 (59.1 Kb)

              Memory:e0104000-e0105fff

Hope this is helping, I know I've put obvious things in my reply, but I wanted to show every step. I know the desperation.

----------

## fcgreg

OK, I've got mine working finally.  I first tried gen2g33k's command sequence using WEP on my AP (except that I changed the channel to the one my AP was currently showing during a scan).  It worked perfectly!  Then I began working backwards until I had narrowed down the exact cause why mine was failing, in hopes that it may help others here.

Summary:

1) With my Orinoco AP, using "restricted" security mode causes it to fail.  Using "open" mode works perfectly.  This is different than the LinkSys system I also use, which liked the "restricted" mode just fine.

2) It seems that I needed to add the "commit" to the command to make sure the settings were accepted properly.  Previous tests with "open" mode probably didn't work because I hadn't used the "commit" command after making settings changes.

Final note:

For me, it doesn't matter if I set the channel or not.  It also doesn't matter if I have eth0 up or not.  If the mode is "open" and I use the "commit" command, it works.

Therefore, the command sequence that works perfectly for me is:

```
iwconfig wlan0 essid "MyAccessPoint" key open 1111111111 commit

dhcpcd wlan0

ifconfig wlan0 up   (if needed)

```

That's it.  It is now working perfectly.  Thanks to gen2g33k for getting me to try the full sequence from scratch!  :Smile: 

Note:  It is also working properly now with WPA supplicant (version 0.3.8 ) with the following configuration:

```
ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=0

eapol_version=1

ap_scan=1

fast_reauth=1

network={

        ssid="MyAccessPoint"

        key_mgmt=NONE

        wep_key0=1111111111

        wep_key1=1111111111

        wep_key2=1111111111

        wep_key3=1111111111

        wep_tx_keyidx=0

        priority=2

}

```

----------

## fcgreg

Oh joy.  Just when I get all of your hopes up, I am here to tell you there are still MAJOR problems.

To put it simply, sometimes it works and sometimes it fails miserably.  And when I mean fails, I mean FAILS.  For example, I can be sitting right next to the AP, and run:

```
iwlist wlan0 scan
```

... and absolutely NOTHING will return.  Then I reboot the laptop a few times, each time trying the above command, and it's still not finding the AP.  This was even the case once when I had all security off on the AP.  Then, suddenly, around the third reboot of the laptop, I run the command and poof -- there's my AP returning in the list!

At this point I don't know if my enterprise Orinoco AP is just total junk, or if the hardware/drivers on the laptop are junk, or both.  However, I can say that I've NEVER HAD THIS PROBLEM when connecting with the LinkSys AP we use at the office (with this laptop, of course).

Whatever... if I ever find more positive information about this I'll post back.  However, my suspicions are that the developers of the wireless tools are testing against LinkSys AP's.  :Surprised:    I'm also considering the possibility that there are compatibility issues between NDISWrapper and the broadcom drivers.

Oh well.

----------

## xante

fcgreg, dont forget about the little on/off button for the wireless...ive done it so many times now its starting to worry me...hopefully you arnt as frustrated over something this small as i am

----------

## fcgreg

 *xante wrote:*   

> fcgreg, dont forget about the little on/off button for the wireless...ive done it so many times now its starting to worry me...hopefully you arnt as frustrated over something this small as i am

 

I wish it were that simple.  Nope, sorry, I've checked that several times (both directions) when this stuff starts to happen.  Alas, nothing.

I haven't messed with it much over the past several days.  However, given that I've NEVER EVER had a problem connecting to the LinkSys AP I'm going to assume it is something related to the Orinoco AP (at least partially).

----------

## Randseed

This is unrelated, except that it underscores the flaky behavior of D-Link routers and Broadcom cards. I have a DI-650+ wireless router which is plugged into a switch, which is then plugged into a two NIC Linux router. The wired Ethernet works flawlessly, save for the occasional problem with the ISP. I have two wireless systems in the house. One is a HP zv5000 laptop with a Broadcom card in it. The other is a desktop with a store-bought acx100 card. WEP is enabled on the wireless.

The laptop will occasionally totally lose sync with the wireless router, requiring that I either wait around for some ungodly amount of time or actually unload the wireless driver on the laptop and reload it. When this happens, the laptop just refuses to connect to the AP, though it still sees it on a 'iwlist wlan0 scan'. As if this wasn't bad enough, once in a blue moon the wireless driver will get in some kind of loop and hard-lock the machine, requiring a poweroff and reboot.

The desktop driver occasionally completely shits itself. It will fall off the network, spew some random messages in the syslog about being unable to connect, and die. The only way to fix it is to reboot the machine.

The point is that all this consumer-grade wireless crud is terrible. There's a huge untapped market for Linux-friendly wireless equipment.

----------

## fcgreg

Yep, good points, and I concur.

 *Randseed wrote:*   

> ... As if this wasn't bad enough, once in a blue moon the wireless driver will get in some kind of loop and hard-lock the machine, requiring a poweroff and reboot.

 

Yep, I've had this happen on my laptop (zv5000 series) twice now.  Only seems to happen when wireless is up and running.

----------

