# [SOLVED][WiFi/WPA] no connection with WPA encrypt

## Poe

Hi. I have a problem with wifi connect on my gentoo. I have a laptop with integrated card broadcom (driver in kernel, bcm43xx) and on router I set WPA-PSK encrypt. I've compiled wpa_supplicant and I configured it

```

ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=wheel

eapol_version=1

ap_scan=1

fast_reauth=1

# Only WPA-PSK is used. Any valid cipher combination is accepted.

network={

        ssid="x"

        key_mgmt=WPA-PSK

        pairwise=CCMP

        group=CCMP

        psk=xxx

        priority=2

} 

```

(change ap_scan option from 1 to 2 didnt gave a positive result)

/etc/conf.d/net

```

modules_eth1=( "wpa_supplicant" )

wpa_supplicant_eth1="-Dwext"

config=( "dhcp" )

```

I changed wext option to broadcom, but when I've tryed start eth1 (my wifi card) then I had a information that driver "broadcom" is not support (in man wpa_supplicant driver "broadcom" is supported  :Neutral:  ). I've tryed ndiswrapper too. I downloaded windows drivers for my card (for 64bit system), and I installed it succesfull. I changed option from wext to ndiswrapper, but I had this error

```

 * Starting eth1

SIOCSIFFLAGS: No such file or directory

 *   Starting wpa_supplicant on eth1 ...

SIOCSIFFLAGS: No such file or directory

SIOCSIFFLAGS: No such file or directory

Could not set interface 'eth1' UP

/lib/rcscripts/sh/rc-daemon.sh: line 229: 13863 Killed                  /sbin/start-stop-daemon '--start' '--exec' '/sbin/wpa_supplicant' '--pidfile' '/var/run/wpa_supplicant-eth1.pid' '--' '-Dndiswrapper' '-c/etc/wpa_supplicant.conf' '-W' '-B' '-ieth1' '-P/var/run/wpa_supplicant-eth1.pid'                        [ !! ]

 * ERROR:  net.eth1 caught an interrupt 

```

when I have set 'wext' I have this

```

 * Starting eth1

SIOCSIFFLAGS: No such file or directory

 *   Starting wpa_supplicant on eth1 ...

SIOCSIFFLAGS: No such file or directory

SIOCSIFFLAGS: No such file or directory

Could not set interface 'eth1' UP                                         [ ok ]

 *   Starting wpa_cli on eth1 ...                                         [ ok ]

 *     Backgrounding ... 

```

and network still doesnt work. 

iwconfig eth1

```

eth1      IEEE 802.11b/g  ESSID:off/any  Nickname:"Broadcom 4318"

          Mode:Managed  Access Point: Invalid   Bit Rate=11 Mb/s   

          RTS thr:off   Fragment thr:off

          Encryption key:off

          Link Quality:0  Signal level:0  Noise level:0

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

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

```

I tryed bcm43xx-fwcutter, but....

```

freeze poe # bcm43xx-fwcutter -w bcmwl15.sys /usr/local/firmware/

Sorry, the input file is either wrong or not supported by bcm43xx-fwcutter.

I can't find the MD5sum d41d8cd98f00b204e9800998ecf8427e :( 

```

I foud some very simillar topics with these problem, but I couldnt found good solve :\

I havent others ideas. I dont want change encryption to WEP on router. 

cheers

----------

## koprimer

Check out my post of tips, it might help.

----------

## Poe

O, Thank You. I'll try when my laptop come back  :Wink:  (My father got it for a few days, because he needed)

cheers

----------

## all-inc.

 *Quote:*   

> bcm43xx-fwcutter -w bcmwl15.sys /usr/local/firmware/

 

perhaps try this one:

```
bcm43xx-fwcutter -w /lib/firmware/ bcmwl15.sys
```

 :Wink: 

(I think the firmware dir changed to /lib ... didn't it?)

Whats about WEP? Does WEP and bcm43xx work together for you? I have the same card and bcm43xx doesn't work for me...so far. but fwcutter does ^^

----------

## Poe

 *all-inc. wrote:*   

>  *Quote:*   bcm43xx-fwcutter -w bcmwl15.sys /usr/local/firmware/ 
> 
> perhaps try this one:
> 
> ```
> ...

 

ok, i'll try.  :Smile: 

 *all-inc. wrote:*   

> 
> 
> Whats about WEP? Does WEP and bcm43xx work together for you? I have the same card and bcm43xx doesn't work for me...so far. but fwcutter does ^^

 

I dont use WEP because it's not secure. I tryed used a WEP but it didnt works too :/

----------

## Poe

Still I have a problems with wifi, but I have a small, better progress

```

freeze# /etc/init.d/net.eth1 start

 * Starting eth1

SIOCSIFFLAGS: No such file or directory

 *   Starting wpa_supplicant on eth1 ...

SIOCSIFFLAGS: Protocol error                                              [ ok ]

 *   Starting wpa_cli on eth1 ...                                         [ ok ]

 *     Backgrounding ... 

```

and now I'm restarting again eth1 and I havent errors.

iwconfig

```

eth1      IEEE 802.11b/g  ESSID:off/any  Nickname:"Broadcom 4318"

          Mode:Managed  Frequency=2.484 GHz  Access Point: Invalid   

          Bit Rate=1 Mb/s   Tx-Power=18 dBm   

          RTS thr:off   Fragment thr:off

          Encryption key:off

          Link Quality:0  Signal level:0  Noise level:0

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

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

```

Now we can see two new options: Frequency and TX-Power (I hadnt it earlyer). so now in THEORY I have a connection BUT: (in terminal, loop)

```

SoftMAC: Associate: Scanning for networks first.

SoftMAC: Start scanning with channel: 1

SoftMAC: Scanning 14 channels

SoftMAC: Scanning finished

SoftMAC: Associate: Scanning for networks first.

SoftMAC: Start scanning with channel: 1

SoftMAC: Scanning 14 channels

SoftMAC: Scanning finished

SoftMAC: Unable to find matching network after scan!

SoftMAC: Start scanning with channel: 1

SoftMAC: Scanning 14 channels

SoftMAC: Scanning finished 

```

and when I have it then in X I have a big problems with use a touchpad - jumping, clicking etc. and I havent conection still... We can see that I havent essid in iwconfig (I have set in config), but iwlist is working

```

eth1      Scan completed :

          Cell 01 - Address: 00:14:6C:D0:xx:xx

                    ESSID:"<hidden>"

                    Protocol:IEEE 802.11bg

                    Mode:Master

                    Channel:3

                    Encryption key:on

                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 6 Mb/s; 9 Mb/s

                              11 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s

                              48 Mb/s; 54 Mb/s

                    Quality=100/100  Signal level=-193 dBm 

                    IE: WPA Version 1

                        Group Cipher : WEP-40

                        Pairwise Ciphers (1) : WEP-40

                        Authentication Suites (1) : PSK

                    Extra: Last beacon: 1714ms a go 

```

I unhide my essid in options of router, but still is same. I tryed wifi-radar. I see my essid, but without signal and I cant connect to it. 

I tryed change a timeout of loading a firmware 

```

echo 100 > /sys/class/firmware/timeout

```

but it didnt give a results....  :Sad:  I'm desperated...

----------

## shrtckt

Hello, I have the same computer and problems as you. After hours of frustration, I have had success only with using the ndiswrapper and this driver. 

((ftp://ftp.support.acer-euro.com/notebook/aspire_3020_5020/driver/winxp64bit/80211g.zip

I have not been able to get it to play nicely with the wpa_supplicant, but WEP works very well. It gets max range and speed, with no drop problems at all. Heh, even the little blue "connected" led works.

Some info:

```
node1 sss # dmesg | grep wlan0  

wlan0: vendor: ''

wlan0: ethernet device 00:14:a5:bd:1f:4e using NDIS driver bcmwl5, 14E4:4318.5.conf

wlan0: encryption modes supported: WEP; TKIP with WPA, WPA2, WPA2PSK; AES/CCMP with WPA, WPA2, WPA2PSK
```

```
node1 sss # cat /etc/conf.d/net

# This blank configuration will automatically use DHCP for any net.*

# scripts in /etc/init.d.  To create a more complete configuration,

# please review /etc/conf.d/net.example and save your configuration

# in /etc/conf.d/net (this file :]!).

# eth0

##########

config_eth0=( "dhcp" )

dhcp_eth0="nodns nontp nonis"

# wlan0

##########

modules_wlan0=( "iwconfig" )

iwconfig_wlan0="mode managed"

config_wlan0=( "dhcp" )

dhcp_wlan0="nodns nontp nonis"
```

```
node1 sss # cat /etc/conf.d/wireless

key_short562_UNIX_network="XXXXXXXXXX enc open" 
```

```
node1 sss # iwconfig

lo        no wireless extensions.

eth0      no wireless extensions.

sit0      no wireless extensions.

wlan0     IEEE 802.11g  ESSID:"short562_UNIX_network"  

          Mode:Managed  Frequency:2.462 GHz  Access Point: 00:18:39:53:E2:DE   

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

          RTS thr:2347 B   Fragment thr:2346 B   

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

          Power Management:off

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

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

          Tx excessive retries:11  Invalid misc:27204   Missed beacon:0
```

```
node1 sss # ifconfig

eth0      Link encap:Ethernet  HWaddr 00:16:D4:3B:39:83  

          UP BROADCAST MULTICAST  MTU:1500  Metric:1

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

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

          collisions:0 txqueuelen:1000 

          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

          Interrupt:209 Base address:0x8400 

lo        Link encap:Local Loopback  

          inet addr:127.0.0.1  Mask:255.0.0.0

          inet6 addr: ::1/128 Scope:Host

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

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

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

          collisions:0 txqueuelen:0 

          RX bytes:16427 (16.0 Kb)  TX bytes:16427 (16.0 Kb)

wlan0     Link encap:Ethernet  HWaddr 00:14:A5:BD:1F:4E  

          inet addr:192.168.1.104  Bcast:192.168.1.255  Mask:255.255.255.0

          inet6 addr: fe80::214:a5ff:febd:1f4e/64 Scope:Link

          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1

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

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

          collisions:0 txqueuelen:1000 

          RX bytes:1427024 (1.3 Mb)  TX bytes:156098 (152.4 Kb)

          Interrupt:50 Memory:c0204000-c0206000 
```

Hope this helps. I would rather not run WEP, but until I can get these WPA issues worked out, I set my AP to accept only predefined MAC  addresses (every little bit helps). 

Strange enough; The same computer running FreeBSD 6.1 64bit with the same driver built with ndisgen works perfect with wpa_supplicant and AES/CMPP.

UPDATE: ok, I managed to get AES/CCMP working with wpa_supplicant. I was making some stupid mistakes (over-configured useless settings)

new config info:

```
sss@node1 ~ $ cat /etc/conf.d/net

# This blank configuration will automatically use DHCP for any net.*

# scripts in /etc/init.d.  To create a more complete configuration,

# please review /etc/conf.d/net.example and save your configuration

# in /etc/conf.d/net (this file :]!).

# eth0

##########

config_eth0=( "dhcp" )

dhcp_eth0="nodns nontp nonis"

# wlan0

##########

modules_wlan0=( "!iwconfig" )

modules_wlan0=( "wpa_supplicant" )

wpa_supplicant_wlan0="-Dwext"

config_wlan0=( "dhcp" )

dhcp_wlan0="nodns nontp nonis"
```

```
sss@node1 ~ $ cat /etc/wpa_supplicant/wpa_supplicant.conf

network={                       

        ssid="short562_UNIX_network"

        key_mgmt=WPA-PSK        

        psk="XXXXXXXXXXXXXXXX"  

}
```

```
node1 sss # iwconfig            

lo        no wireless extensions.

                                

eth0      no wireless extensions.

                                

sit0      no wireless extensions.

                                

wlan0     IEEE 802.11g  ESSID:"short562_UNIX_network"  

          Mode:Managed  Frequency:2.462 GHz  Access Point: 00:18:39:53:E2:DE   

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

          RTS thr:2347 B   Fragment thr:2346 B   

          Encryption key:XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX   Security mode:restricted

          Power Management:off  

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

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

          Tx excessive retries:56  Invalid misc:10560   Missed beacon:0
```

Success finally  :Very Happy:  I hope this helps point you in the right direction. Wireless configuration can be brutal.

----------

## Poe

I did that I added to my /etc/conf.d/wireless option

```

key_MY_ESSID="s:key"

```

and on the router I changed to WEP encr. I updated my /etc/conf.d/net for modules for iwconfig (modules_eth1=( "iwconfig" ),and I started eth1. all was started well, my iwconfig show signallevel, noise, essid, nickname etc. but I still havent a networ connection. I tryed ping to google, but ping didnt give me results, ping to router gave me "192.16..........: Network is unrechable" (or smthg)...

for WPA encr. is still same like previous

----------

## shrtckt

(eth1) I'm assuming  you are still using the in-kernel broadcom driver support. I had to remove it & install the ndiswrapper w/the above driver. This was the only I way I could get the 4318 card to work. I've used it with several WPA, WEP, and open networks. Still, 100% flawless since my last post   :Very Happy: 

----------

## Poe

I downloaded a driver from 2 posts upper, I compiled ndiswrapper, but my card still doesnt work. 

```

# ndiswrapper -i BCMWL564.SYS

installing bcmwl564.sys ...

couldn't get manufacturer section - installation may be incomplete

#ndiswrapper -l

installed drivers:

b57amd64                driver installed 

bcmwl564.sys    invalid driver!

netbc564                driver installed 

#ndiswrapper -m

```

```

modprobe ndiswrapper

```

and then

```

freeze# /etc/init.d/net.eth1 start

 * Starting eth1

 *   Bringing up eth1

 *     192.168.1.4

 *     network interface eth1 does not exist

 *     Please verify hardware or kernel module (driver)                   [ !! ]

```

iwconfig didnt gave me results (doesnt see my card)

```

modules_eth1=( "wpa_supplicant" )

wpa_supplicant_eth1="-Dndiswrapper"

config_eth1=( "192.168.x.x netmask 255.255.255.0 brd 192.168.x.255" )

routes_eth1=( "default gw 192.168.x.x" )

```

 :Sad: 

----------

## shrtckt

You need to resolve your ndiswrapper problems first - then the card should show up as wlan0 from #iwconfig. Don't use the *.SYS file, use the *.inf file. Try this:

```
# ndiswrapper -i /path/to/bcmwl5.inf
```

*remove those other drivers from ndiswrapper.  Also, don't forget to add "ndiswrapper" to your /etc/modules.autoload.d/kernel-2.6 file. Also, change your /etc/conf.d/net configuration to use the wlan0 interface - not eth1, and set wpa_supplicant to use the -Dwext driver like posted in my config above. Reboot & you should be good to go.

----------

## Poe

why I have to use wlan0 interface? I have eth1 interface after load these module to ndiswrapper...

----------

## shrtckt

Because a successfully loaded ndiswrapper module will show up as wlan0.

----------

## Poe

yes, yes, I did some changes and I have wlan0 but still havent a connection :\  

```

 * Starting wlan0

 *   Starting wpa_supplicant on wlan0 ...                                 [ ok ]

 *   Starting wpa_cli on wlan0 ...                                        [ ok ]

 *     Backgrounding ...

```

I tryed with ndiswrapper driver in conf.d/net and wext. 

```

wlan0     IEEE 802.11g  ESSID:off/any  

          Mode:Managed  Frequency:2.417 GHz  Access Point: Not-Associated   

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

          RTS thr:2347 B   Fragment thr:2346 B   

          Encryption key:off

          Power Management:off

          Link Quality:0  Signal level:0  Noise level:0

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

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

```

I did some changes again and I have this:

```

wlan0     IEEE 802.11g  ESSID:"******"  

          Mode:Managed  Frequency:2.422 GHz  Access Point: ************   

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

          RTS thr:2347 B   Fragment thr:2346 B   

          Encryption key:*********   Security mode:restricted

          Power Management:off

          Link Quality:100/100  Signal level:-31 dBm  Noise level:-96 dBm

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

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

```

and in wpa_gui I have status COMPLETED, but still I havent connection. 

```

freeze# ping google.pl

ping: unknown host google.pl

freeze# ping 192.168.xx

connect: Network is unreachable

```

.....

```

modules_wlan0=( "!iwconfig" )

modules_wlan0=( "wpa_supplicant" )

wpa_supplicant_wlan0="-Dwext"

config_wlan0=( "192.168.xx netmask 255.255.255.0 brd 192.168.xx" )

routes_wlan0=( "default gw 192.168.x.x" )

```

----------

## shrtckt

Cool, we are making progress. First let's make sure your system can find your AP: 

```
#iwlist wlan0 scan
```

Also, you may have already done this, but in the dir /etc/init.d you need a simlink pointing to net.lo from net.wlan0 (like eth0 or eth1 does). Ex: 

```
sss@node1 ~ $ ls -l /etc/init.d | grep net

lrwxrwxrwx 1 root root     6 Nov  3 09:59 net.eth0 -> net.lo

-rwxr-xr-x 1 root root 30341 Nov  3 09:59 net.lo

lrwxrwxrwx 1 root root     6 Oct  6 00:46 net.wlan0 -> net.lo

-rwxr-xr-x 1 root root  3046 Nov  3 09:59 netmount

```

Post the output of the iwlist scan, /etc/conf.d/net, /etc/wpa_supplicant/wpa_supplicant.conf ("X" out the psk stuff ). You are almost there  :Smile: 

----------

## Poe

```

wlan0     Scan completed :

          Cell 01 - Address: *** (mac of my router)

                    ESSID:"**" (my ssid)

                    Protocol:IEEE 802.11g

                    Mode:Managed

                    Frequency:2.422 GHz (Channel 3)

                    Quality:100/100  Signal level:-28 dBm  Noise level:-96 dBm

                    Encryption key:on

                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 6 Mb/s; 9 Mb/s

                              11 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s

                              48 Mb/s; 54 Mb/s

                    Extra:bcn_int=100

                    Extra:atim=0

                    IE: WPA Version 1

                        Group Cipher : WEP-40

                        Pairwise Ciphers (1) : WEP-40

                        Authentication Suites (1) : PSK

```

```

network={                       

        ssid="**"

        key_mgmt=WPA-PSK       

        psk="**" 

}

```

conf.d/net is at end of my last post. and I have a correct symlinks.

----------

## shrtckt

Sorry, overlooked it. Looks like your AP is set up for WEP, it should still work. But, try changing it to WPA personal with TKIP or AES algorithms. Also, I had to close my "wired" eth0 connection before the router would let me connect on another interface for some reason. Sometimes the output of:

```
# wpa_supplicant -iwlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf -d
```

can give some useful hints to where it's breaking down. If worst comes to worst, post the output of this.

----------

## Poe

YUPEE!! I have a connection  :Very Happy: 

Thank You so much for big help. A problem was configuration wpa_supplicant. I had " " in place where is wpa key, and I forgot that I had 2 configs. In /etc and in /etc/wpa_supplicant... 

Thanks again  :Smile: 

----------

## shrtckt

Great!   :Very Happy:  Glad I could be of some help. I still believe wireless networking is one of the most difficult things to setup in Gentoo.

----------

## Poe

 *shrtckt wrote:*   

> Great!   Glad I could be of some help. 
> 
> 

 

some?! so much  :Smile:  tahnks!

 *shrtck wrote:*   

> 
> 
> I still believe wireless networking is one of the most difficult things to setup in Gentoo.

 

Yes, thats true, because still are so much problems with drivers.

----------

