# [SOLVED] wifi with WEP

## pacianotto

Hello everyone,

I have one problem that is starting to drive me nuts... When trying to connect to some wifi networks, my gentoo simply dont stay connected.

Normally I use wicd, but as it wasn't working, I tryed to use dhcpcd directly on the command line and differently from other people, my connection seems to fall right after it was up.

1) wicd: Sometimes it shows 'bad password' and sometimes it connects (a message 'done connecting' on the progress bar still running, a little strange) but it works for some seconds and then I lose the ip.

    using tail during the connection gives (/var/log/wicd/wicd.log):

```

2012/03/02 21:39:37 :: Connecting to wireless network DDLM

2012/03/02 21:39:37 :: iwconfig eth1

2012/03/02 21:39:37 :: /sbin/dhcpcd -k eth1

2012/03/02 21:39:37 :: ifconfig eth1 0.0.0.0 

2012/03/02 21:39:37 :: /sbin/route del dev eth1

2012/03/02 21:39:37 :: ifconfig eth1 down

2012/03/02 21:39:37 :: ifconfig eth1 up

2012/03/02 21:39:37 :: wpa_cli -i eth1 terminate

2012/03/02 21:39:37 :: /sbin/dhcpcd -k eth0

2012/03/02 21:39:37 :: ifconfig eth0 0.0.0.0 

2012/03/02 21:39:37 :: /sbin/route del dev eth0

2012/03/02 21:39:37 :: ifconfig eth0 down

2012/03/02 21:39:38 :: ifconfig eth0 up

2012/03/02 21:39:38 :: Putting interface down

2012/03/02 21:39:38 :: ifconfig eth1 down

2012/03/02 21:39:38 :: Releasing DHCP leases...

2012/03/02 21:39:38 :: /sbin/dhcpcd -k eth1

2012/03/02 21:39:38 :: Setting false IP...

2012/03/02 21:39:38 :: ifconfig eth1 0.0.0.0 

2012/03/02 21:39:38 :: Stopping wpa_supplicant

2012/03/02 21:39:38 :: wpa_cli -i eth1 terminate

2012/03/02 21:39:38 :: Flushing the routing table...

2012/03/02 21:39:38 :: /sbin/route del dev eth1

2012/03/02 21:39:38 :: iwconfig eth1 mode managed

2012/03/02 21:39:38 :: Putting interface up...

2012/03/02 21:39:38 :: ifconfig eth1 up

2012/03/02 21:39:40 :: enctype is wep-hex

2012/03/02 21:39:40 :: Attempting to authenticate...

2012/03/02 21:39:40 :: ['wpa_supplicant', '-B', '-i', 'eth1', '-c', '/var/lib/wicd/configurations/00260bc90780', '-D', 'wext']

2012/03/02 21:39:40 :: ['iwconfig', 'eth1', 'essid', '--', 'DDLM']

2012/03/02 21:39:40 :: iwconfig eth1 channel 5

2012/03/02 21:39:40 :: iwconfig eth1 ap 00:26:0B:C9:07:80

2012/03/02 21:39:40 :: WPA_CLI RESULT IS DISCONNECTED

2012/03/02 21:39:41 :: WPA_CLI RESULT IS SCANNING

2012/03/02 21:39:42 :: WPA_CLI RESULT IS ASSOCIATING

2012/03/02 21:39:43 :: WPA_CLI RESULT IS ASSOCIATING

2012/03/02 21:39:44 :: WPA_CLI RESULT IS ASSOCIATING

2012/03/02 21:39:45 :: WPA_CLI RESULT IS ASSOCIATING

2012/03/02 21:39:46 :: WPA_CLI RESULT IS ASSOCIATING

2012/03/02 21:39:47 :: WPA_CLI RESULT IS SCANNING

2012/03/02 21:39:48 :: WPA_CLI RESULT IS SCANNING

2012/03/02 21:39:49 :: WPA_CLI RESULT IS ASSOCIATING

2012/03/02 21:39:50 :: WPA_CLI RESULT IS ASSOCIATING

2012/03/02 21:39:51 :: WPA_CLI RESULT IS ASSOCIATING

2012/03/02 21:39:52 :: WPA_CLI RESULT IS ASSOCIATING

2012/03/02 21:39:53 :: WPA_CLI RESULT IS ASSOCIATING

2012/03/02 21:39:54 :: WPA_CLI RESULT IS SCANNING

2012/03/02 21:39:55 :: WPA_CLI RESULT IS SCANNING

2012/03/02 21:39:56 :: WPA_CLI RESULT IS DISCONNECTED

2012/03/02 21:39:57 :: WPA_CLI RESULT IS DISCONNECTED

2012/03/02 21:39:58 :: WPA_CLI RESULT IS DISCONNECTED

2012/03/02 21:39:59 :: WPA_CLI RESULT IS DISCONNECTED

2012/03/02 21:39:59 :: wpa_supplicant rescan forced...

2012/03/02 21:40:00 :: WPA_CLI RESULT IS SCANNING

2012/03/02 21:40:01 :: WPA_CLI RESULT IS ASSOCIATING

2012/03/02 21:40:02 :: WPA_CLI RESULT IS ASSOCIATING

2012/03/02 21:40:03 :: WPA_CLI RESULT IS ASSOCIATING

2012/03/02 21:40:04 :: WPA_CLI RESULT IS ASSOCIATING

2012/03/02 21:40:05 :: WPA_CLI RESULT IS ASSOCIATING

2012/03/02 21:40:06 :: WPA_CLI RESULT IS SCANNING

2012/03/02 21:40:07 :: WPA_CLI RESULT IS SCANNING

2012/03/02 21:40:08 :: WPA_CLI RESULT IS ASSOCIATING

2012/03/02 21:40:09 :: WPA_CLI RESULT IS ASSOCIATING

2012/03/02 21:40:10 :: WPA_CLI RESULT IS ASSOCIATING

2012/03/02 21:40:11 :: WPA_CLI RESULT IS ASSOCIATING

2012/03/02 21:40:12 :: WPA_CLI RESULT IS ASSOCIATING

2012/03/02 21:40:13 :: WPA_CLI RESULT IS SCANNING

2012/03/02 21:40:14 :: WPA_CLI RESULT IS SCANNING

2012/03/02 21:40:15 :: WPA_CLI RESULT IS ASSOCIATING

2012/03/02 21:40:16 :: WPA_CLI RESULT IS ASSOCIATING

2012/03/02 21:40:17 :: WPA_CLI RESULT IS ASSOCIATING

2012/03/02 21:40:18 :: WPA_CLI RESULT IS ASSOCIATING

2012/03/02 21:40:19 :: WPA_CLI RESULT IS ASSOCIATING

2012/03/02 21:40:20 :: wpa_supplicant authentication may have failed.

2012/03/02 21:40:20 :: connect result is failed

2012/03/02 21:40:20 :: exiting connection thread

2012/03/02 21:40:20 :: Sending connection attempt result bad_pass

2012/03/02 21:40:20 :: ifconfig eth0

2012/03/02 21:40:20 :: ifconfig eth1

2012/03/02 21:40:20 :: iwconfig eth1

2012/03/02 21:40:20 :: Forced disconnect on

2012/03/02 21:40:20 :: /sbin/dhcpcd -k eth1

2012/03/02 21:40:20 :: ifconfig eth1 0.0.0.0 

2012/03/02 21:40:20 :: /sbin/route del dev eth1

2012/03/02 21:40:20 :: ifconfig eth1 down

2012/03/02 21:40:20 :: ifconfig eth1 up

2012/03/02 21:40:20 :: wpa_cli -i eth1 terminate

2012/03/02 21:40:20 :: /sbin/dhcpcd -k eth0

2012/03/02 21:40:20 :: ifconfig eth0 0.0.0.0 

2012/03/02 21:40:20 :: /sbin/route del dev eth0

2012/03/02 21:40:20 :: ifconfig eth0 down

2012/03/02 21:40:20 :: ifconfig eth0 up

2012/03/02 21:40:23 :: ifconfig eth0

2012/03/02 21:40:23 :: ifconfig eth1

2012/03/02 21:40:26 :: ifconfig eth0

2012/03/02 21:40:26 :: ifconfig eth1

```

Other times, it shows only this:

```

03/02 20:58:16 :: ifconfig eth1

2012/03/02 20:58:16 :: ifconfig eth0

2012/03/02 20:58:16 :: iwconfig eth1

2012/03/02 20:58:18 :: ifconfig eth1

2012/03/02 20:58:18 :: Forced disconnect on

2012/03/02 20:58:18 :: /sbin/dhcpcd -k eth1

2012/03/02 20:58:18 :: ifconfig eth1 0.0.0.0 

2012/03/02 20:58:18 :: /sbin/route del dev eth1

2012/03/02 20:58:18 :: ifconfig eth1 down

2012/03/02 20:58:18 :: ifconfig eth1 up

2012/03/02 20:58:18 :: wpa_cli -i eth1 terminate

2012/03/02 20:58:18 :: /sbin/dhcpcd -k eth0

2012/03/02 20:58:18 :: ifconfig eth0 0.0.0.0 

2012/03/02 20:58:18 :: /sbin/route del dev eth0

2012/03/02 20:58:18 :: ifconfig eth0 down

2012/03/02 20:58:18 :: ifconfig eth0 up

```

But I am sure that I'm using the correct password, because sometimes it connects for 3 or 4 seconds and I can download something on the browser.

When trying by hand it gives the same result:

```

 wpa_cli -i eth1 terminate

 wpa_supplicant -B -i eth1  -c /var/lib/wicd/configurations/00260bc90780 -D wext

 wpa_cli status 

 /sbin/dhcpcd -h gpg --noipv4ll eth1

 ifconfig eth1

```

[/list]

starts, connects, and then falls.

I already tryed some solutions in:

https://forums.gentoo.org/viewtopic-t-913964.html

also adding rc_dhcpcd_provide="!net" on /etc/rc.conf

but nothing have solved the problem.

I also tryed to install pump to see if the problem was with dhcpcd, but it didn't work neither.

what more can I try? already spent more than 5 hours today, if this doesn't works, I am condemned to use windows for 5 months.   :Shocked:   :Shocked: 

----------

## Gusar

Which wireless card (check with lspci -nn)? The ath9k driver has a known bug with WEP in the early 3.2 kernels, it was fixed in 3.2.7. Then, iwlwifi has issues with any kind of encryption in the 3.2 kernels. The fix for this one is not yet in a kernel release I think, but there is a patch available.

----------

## pacianotto

```

gpggentoo gustavo # lspci -nn

00:00.0 Host bridge [0600]: Advanced Micro Devices [AMD] Device [1022:1510]

00:01.0 VGA compatible controller [0300]: ATI Technologies Inc Device [1002:9806]

00:01.1 Audio device [0403]: ATI Technologies Inc Device [1002:1314]

00:04.0 PCI bridge [0604]: Advanced Micro Devices [AMD] Device [1022:1512]

00:11.0 SATA controller [0106]: ATI Technologies Inc SB700/SB800 SATA Controller [AHCI mode] [1002:4391]

00:12.0 USB Controller [0c03]: ATI Technologies Inc SB700/SB800 USB OHCI0 Controller [1002:4397]

00:12.2 USB Controller [0c03]: ATI Technologies Inc SB700/SB800 USB EHCI Controller [1002:4396]

00:13.0 USB Controller [0c03]: ATI Technologies Inc SB700/SB800 USB OHCI0 Controller [1002:4397]

00:13.2 USB Controller [0c03]: ATI Technologies Inc SB700/SB800 USB EHCI Controller [1002:4396]

00:14.0 SMBus [0c05]: ATI Technologies Inc SBx00 SMBus Controller [1002:4385] (rev 42)

00:14.2 Audio device [0403]: ATI Technologies Inc SBx00 Azalia (Intel HDA) [1002:4383] (rev 40)

00:14.3 ISA bridge [0601]: ATI Technologies Inc SB700/SB800 LPC host controller [1002:439d] (rev 40)

00:14.4 PCI bridge [0604]: ATI Technologies Inc SBx00 PCI to PCI Bridge [1002:4384] (rev 40)

00:14.5 USB Controller [0c03]: ATI Technologies Inc SB700/SB800 USB OHCI2 Controller [1002:4399]

00:15.0 PCI bridge [0604]: ATI Technologies Inc Device [1002:43a0]

00:15.1 PCI bridge [0604]: ATI Technologies Inc Device [1002:43a1]

00:15.2 PCI bridge [0604]: ATI Technologies Inc Device [1002:43a2]

00:15.3 PCI bridge [0604]: ATI Technologies Inc Device [1002:43a3]

00:18.0 Host bridge [0600]: Advanced Micro Devices [AMD] Device [1022:1700] (rev 43)

00:18.1 Host bridge [0600]: Advanced Micro Devices [AMD] Device [1022:1701]

00:18.2 Host bridge [0600]: Advanced Micro Devices [AMD] Device [1022:1702]

00:18.3 Host bridge [0600]: Advanced Micro Devices [AMD] Device [1022:1703]

00:18.4 Host bridge [0600]: Advanced Micro Devices [AMD] Device [1022:1704]

00:18.5 Host bridge [0600]: Advanced Micro Devices [AMD] Device [1022:1718]

00:18.6 Host bridge [0600]: Advanced Micro Devices [AMD] Device [1022:1716]

00:18.7 Host bridge [0600]: Advanced Micro Devices [AMD] Device [1022:1719]

03:00.0 Network controller [0280]: Broadcom Corporation Device [14e4:4727] (rev 01)

05:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller [10ec:8168] (rev 06)

```

it's a broadcom...

btw...

```

gustavo@gpggentoo ~ $ cat /proc/version 

Linux version 3.1.6-gentoo (root@gpggentoo) (gcc version 4.5.3 (Gentoo 4.5.3-r1 p1.0, pie-0.4.5) ) #1 SMP Mon Jan 23 17:12:32 CET 2012

```

another thing, if I keep running ifconfig eth1, I can see my ip appearing and desapearing... really strange for a good network (I have a mobile phone and another old notebook on the same network).

----------

## Gusar

You mentioned eth1, so you're using the broadcom-sta driver, right? You could instead try the brcmsmac driver. However I've lately seen quite a few mentions that not even brcmsmac works well with this particular card. But try it anyway - uninstall broadcom-sta, activate brcmsmac in the kernel and install the linux-firmware package. And note that with this driver, wireless will be wlan0 instead of eth1

----------

## pacianotto

And how do I do it? I have no internet and my kernel conf was erased when doing emerge gentoo-sources. this driver brcmsmac is for mac computers? I actually have a samsung, does that changes something?

----------

## Gusar

 *pacianotto wrote:*   

> this driver brcmsmac is for mac computers?

 

LOL! No, nothing to do with Macs.

It's a driver like any other Linux driver. It's in the kernel, just tick the appropriate options when configuring it.

 *pacianotto wrote:*   

> I have no internet

 

Err, you're online now, are you not? You must be, otherwise you wouldn't be able to post. Use this connection to obtain the linux-firmware package.

----------

## pacianotto

Yes, but i'm using an old computer here.

hehe, I though this because of http://en.gentoo-wiki.com/wiki/Apple_Macbook_Air#Installing_brcmsmac_drivers

but really, I have no idea of how to do it, I did a emerge -C broadcom-sta. But now, I must compile the kernel, I have no internet connection on this pc to download my old kernel and the configurations are lost (I used genkernel to compile it).

When using a new version of the kernel, I have other problems with my graphic card.

----------

## wrc1944

In cases like this, you use another machine to download the necessary packages (kernel, linux-firmware, or whatever) from a Gentoo /distfiles mirror, then copy them to a usb flash drive (or burn to a cd), and then copy them over to the /distfiles directory on your other computer with the broken internet connection.  Then you can install/reinstall the needed packages using emerge without having an active connection.

----------

## pacianotto

Ok, I've tryed to copy the files as described in http://wireless.kernel.org/en/users/Drivers/brcm80211#Get_the_code

Copy brcm/bcm43xx-0.fw and brcm/bcm43xx_hdr-0.fw to /lib/firmware/brcm (or wherever firmware is normally installed on your system).

but it doesn't worked, modprobe -l hasn't brcmfmac.

Then i tryed to compile a new kernel, with the broadcom driver:

```

-> Network device support

   -> Wireless LAN

      -> < > Broadcom IEEE802.11n PCIe SoftMAC WLAN driver

      -> < > Broadcom IEEE802.11n embedded FullMAC WLAN driver

         -> [ ] SDIO bus interface support for FullMAC driver

         -> [ ] USB bus interface support for FullMAC driver

```

but there was not a option for SoftMAC, only FullMAC. (the kernel version is 3.2.1-r2)

compiled just to see if it could work, but with no luck....

----------

## Gusar

You probably have bcma support enabled. Disable it, then the option for brcmsmac will show up.

----------

## pacianotto

Thanks! I can see it now, compiling the kernel and with hope that it will work! The page says BCMA is needed.

----------

## pacianotto

ok, when running modprobe -l, brcmmac appears, but when doing 

```

modprobe brcmsmac

```

The iwconfig shows only eth0 and lo.  :Crying or Very sad: 

----------

## Gusar

As always...

Use pastebin to post the output of dmesg. And the kernel config too.

----------

## pacianotto

HA! just unmerged my amd driver (radeon-ucode) and merged linux-firmware and it worked!

Thanks gusar! You directly and undirectly soved my problem, just need a WPA network to be sure. at least, in my room the WEP will work perfectly! 

https://forums.gentoo.org/viewtopic-t-899002-start-0.html

----------

