# [WPA_SUPPLICANT] WEP key problem with Iwl3945 [SOLVED]

## d2_racing

Hi, I'm using right now wireless-tool to connect to my router. I use a WEP key and everything is fine.

I have the kernel 2.6.24-Gentoo-r4 with the iwl3945 inside the kernel.

So, I want to try the wpa_supplicant with a wep_key.

I have this inside my /etc/conf.d/net

```

sylvain@gentootux ~ $ 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 :]!).

#WPA_SUPPLICANT

##modules=( "wpa_supplicant" )

##wpa_supplicant_wlan0_="-Dwext"

##config_wlan0=( "dhcp" )

#Wireless tools

dns_domain_lo="homenetwork"

config_eth0="dhcp"

dhcpcd_eth0="-N"

config_gentoonet=( "dhcp" )

key_gentoonet="307b09e7e3979a1f4988afdb82 enc open"

preferred_aps=( "gentoonet" )

#preup()

#{

#          if [[ ${IFACE} = "eth1" ]]; then

#               sleep 3

#         fi

#       return 0

# }

sylvain@gentootux ~ $           

```

Here's my /etc/wpa_supplicant/wpa_supplicant.conf

```

sylvain@gentootux ~ $ cat /etc/wpa_supplicant/wpa_supplicant.conf

# This is a network block that connects to any unsecured access point.

# We give it a low priority so any defined blocks are preferred.

network={

        key_mgmt=NONE

        priority=-9999999

}

network={

  ssid="gentoonet"

  key_mgmt=NONE

  wep_key0="specialkey"

  wep_tx_keyidx=0

  priority=5

              }

```

If I comment my Wireless tool section and I actived my WPA_SUPPLICANT config, I cannot connect to my IP.

Also, if I run this as root or as user I have this : 

```

[root@gentootux ~]# wpa_gui

The gui comes up and then I get this:

Failed to open control connection to wpa_supplicant.

PING failed - trying to reconnect

PING failed - trying to reconnect

PING failed - trying to reconnect

PING failed - trying to reconnect

PING failed - trying to reconnect

PING failed - trying to reconnect

PING failed - trying to reconnect

PING failed - trying to reconnect

PING failed - trying to reconnect

PING failed - trying to reconnect

PING failed - trying to reconnect

PING failed - trying to reconnect

PING failed - trying to reconnect

PING failed - trying to reconnect

PING failed - trying to reconnect

```

How can I debug this thing ?Last edited by d2_racing on Wed Apr 09, 2008 8:49 pm; edited 3 times in total

----------

## loisl

Hai,

it costed me many nerves to get this running ... maybe I can save some of Yours   :Smile: 

I suppose You have emerged the firmware for Your iwl3945

My findings are that 1st the hardware based scan of SSID's does not work with the iwlwifi drivers (don't ask me why), and 2nd the wlan0 interface has to be explicitly set to up before wpa_supplicant starts.

Here is my wpa_supplicant.conf

```
update_config=1

ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=wheel

eapol_version=2

ap_scan=0

fast_reauth=1

network={

        ssid="the SSID"

        proto=WPA2

        key_mgmt=WPA-PSK

        group=TKIP

        pairwise=TKIP CCMP

        psk="nixdiefingers"

}

```

The important entry is ap_scan=0. You can find a commented wpa_supplicant.conf in /usr/share/doc.

My /etc/conf.d/net reads as follows

```
modules=( "dhcpcd" "!iwconfig" "wpa_supplicant" )

dns_domain="maus.homelinux.net"

dns_search="maus.homelinux.net"

dns_servers="192.168.100.210 192.168.100.200 217.237.150.33"

dns_options=( "timeout 1" "rotate" )

config_eth0=( "dhcp" )

dhcpcd_eth0="-t 30 -L -H"

wpa_supplicant_wlan0="-Dwext"

#Comment this out otherwise a restart of wlan0 is not possible!

#associate_timeout_wlan0=90

config_wlan0=( "dhcp" )

dhcpcd_wlan0="-t 30 -L -H"

preup() {

        if [[ ${IFACE} = "wlan0" ]]; then

                ebegin "set interface to up"

                ifconfig ${IFACE} up

                eend

                ebegin "set rate to auto"

                iwconfig ${IFACE} rate auto

                eend

        fi

        return 0

}

```

Hope this helps a bitLast edited by loisl on Tue Apr 08, 2008 12:10 pm; edited 1 time in total

----------

## d2_racing

I will try that tonight.

----------

## d2_racing

I have the same result. Is there any log files or something that I could check to see what is going on ?

----------

## d2_racing

New information :

```

/etc/init.d/net.wlan0 start

 * Starting wlan0

 *   Starting wpa_supplicant on wlan0 ...

ioctl[SIOCSIWAUTH]: Operation not supported

WEXT auth param 4 value 0x0 - ioctl[SIOCSIWAUTH]: Operation not supported                                                                                                                                                                   [ ok ]th param 5 value 0x1 -

 *   Starting wpa_cli on wlan0 ...                                                                                                                                                                                                   [ ok ]

 *     Backgrounding ...

wlan0: Initial auth_alg=0

wlan0: authenticate with AP 00:17:9a:21:f8:28

wlan0: privacy configuration mismatch and mixed-cell disabled - disassociate

wlan0: Initial auth_alg=0

wlan0: authenticate with AP 00:1a:70:62:40:88

wlan0: Initial auth_alg=0

wlan0: authenticate with AP 00:1a:70:62:40:88

wlan0: authenticate with AP 00:1a:70:62:40:88

wlan0: authenticate with AP 00:1a:70:62:40:88

wlan0: authentication with AP 00:1a:70:62:40:88 timed out

wlan0: authentication frame received from 00:1a:70:62:40:88, but not in authenticate state - ignored

wlan0: authentication frame received from 00:1a:70:62:40:88, but not in authenticate state - ignored

wlan0: authentication frame received from 00:1a:70:62:40:88, but not in authenticate state - ignored

wlan0: authentication frame received from 00:1a:70:62:40:88, but not in authenticate state - ignored

wlan0: authentication frame received from 00:1a:70:62:40:88, but not in authenticate state - ignored

wlan0: authentication frame received from 00:1a:70:62:40:88, but not in authenticate state - ignored

ADDRCONF(NETDEV_UP): wlan0: link is not ready

wlan0: Initial auth_alg=0

wlan0: authenticate with AP 00:1a:70:62:40:88

wlan0: RX authentication from 00:1a:70:62:40:88 (alg=0 transaction=2 status=0)

wlan0: authenticated

wlan0: associate with AP 00:1a:70:62:40:88

wlan0: authentication frame received from 00:1a:70:62:40:88, but not in authenticate state - ignored

wlan0: RX AssocResp from 00:1a:70:62:40:88 (capab=0x411 status=0 aid=1)

wlan0: associated

ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready

wlan0: no IPv6 routers present

wlan0: disassociate(reason=3)

wlan0: Initial auth_alg=0

wlan0: authenticate with AP 00:1a:70:62:40:88

wlan0: RX authentication from 00:1a:70:62:40:88 (alg=0 transaction=2 status=0)

wlan0: authenticated

wlan0: associate with AP 00:1a:70:62:40:88

wlan0: RX AssocResp from 00:1a:70:62:40:88 (capab=0x411 status=0 aid=1)

wlan0: associated

ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready

gentootux ~ # ifconfig -a

irda0     Lien encap:IrLAP  HWaddr 00:00:00:00

          NOARP  MTU:2048  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 lg file transmission:8

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

lo        Lien encap:Boucle locale

          inet adr:127.0.0.1  Masque:255.0.0.0

          adr inet6: ::1/128 Scope:Hôte

          UP LOOPBACK RUNNING  MTU:16436  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 lg file transmission:0

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

sit0      Lien encap:IPv6-dans-IPv4

          NOARP  MTU:1480  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 lg file transmission:0

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

wlan0     Lien encap:Ethernet  HWaddr 00:1B:77:4F:4B:1A

          adr inet6: fe80::21b:77ff:fe4f:4b1a/64 Scope:Lien

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

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

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

          collisions:0 lg file transmission:1000

          RX bytes:0 (0.0 b)  TX bytes:2736 (2.6 Kb)

wmaster0  Lien encap:UNSPEC  HWaddr 00-1B-77-4F-4B-1A-C0-09-00-00-00-00-00-00-00-00

          UP BROADCAST RUNNING 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 lg file transmission:1000

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

```

It seems that I can associate my routeur, but I cannot have a IP adress ???

----------

## d2_racing

I tried also the WPA2 Personnal with no luck :

```

cat /etc/conf.d/net

#WPA_SUPPLICANT

##modules=( "wpa_supplicant" )

##wpa_supplicant_wlan0_="-Dwext"

##config_wlan0=( "dhcp" )

cat /etc/wpa_supplicant/wpa_supplicant.conf

#ctrl_interface=/var/run/wpa_supplicant

#ctrl_interface_group=wheel

#ap_scan=0

#update_config=1

network={

        ssid="gentoonet"

        psk="3zr2xbg7gentoo"

        proto=WPA2

        key_mgmt=WPA-PSK

        pairwise=CCMP

        group=CCMP

        priority=5

}

```

----------

## d2_racing

What am I doing wrong ?

----------

## d2_racing

It drive me insane, I can connect to my network with wlassistant.

----------

## d2_racing

In fact, look at my wpa_cli after a connection with wassistant

```

gentootux ~ # wpa_cli status

Selected interface 'wlan0'

bssid=00:1a:70:62:40:88

ssid=gentoonet

id=0

pairwise_cipher=CCMP

group_cipher=TKIP

key_mgmt=WPA2-PSK

wpa_state=COMPLETED

ip_address=192.168.1.102

```

----------

## d2_racing

My new config WPA2 file

```

 cat /etc/wpa_supplicant/wpa_supplicant.conf

#ctrl_interface=/var/run/wpa_supplicant

#ctrl_interface_group=wheel

ap_scan=0

#update_config=1

network={

        ssid="gentoonet"

        psk="3zr2xbg7gentoo"

        proto=WPA2

        key_mgmt=WPA-PSK

        pairwise=CCMP

        group=CCMP

        priority=5

}

```

```

gentootux ~ # 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 :]!).

#WPA_SUPPLICANT

modules=( "wpa_supplicant" )

wpa_supplicant_wlan0_="-Dwext"

config_wlan0=( "dhcp" )

##dhcpcd_wlan0="-t 30 -L - H"

#Wireless tools

##dns_domain_lo="homenetwork"

##config_eth0="dhcp"

##dhcpcd_eth0="-N"

##config_gentoonet=( "dhcp" )

##key_gentoonet="307b09e7e3979a1f4988afdb83 enc open"

##preferred_aps=( "gentoonet" )

#preup()

#{

#          if [[ ${IFACE} = "eth1" ]]; then

#               sleep 3

#         fi

#       return 0

# }

```

----------

## jcat

I use iwl3945 with wpa_supplicant, but I've not got my laptop with me.  If I get a chance later I'll post my config here for comparison.

Once thing I've noticed with the module that's included in the 2.6.24 kernel is that if you stop net.wlan0 (my WiFi interface) then you need to reload the kernel mod before starting it, otherwise the module just seems to bomb out.

Cheers,

jcat

----------

## d2_racing

In fact, I saw that last night with my testing.

----------

## loisl

 *jcat wrote:*   

> 
> 
> Once thing I've noticed with the module that's included in the 2.6.24 kernel is that if you stop net.wlan0 (my WiFi interface) then you need to reload the kernel mod before starting it, otherwise the module just seems to bomb out.

 

This was the case for mine as well, then I had a closer look to error mesages I got when I did a /etc/init.d/net.wlan restart. I had to coment out associate_timeout_wlan0 in /etc/conf.d/net. But I have a iwl4965, not a iwl3945

----------

## loisl

 *d2_racing wrote:*   

> 
> 
> ```
> 
> gentootux ~ # cat /etc/conf.d/net
> ...

 

What makes me suspicious is that "dhchcd" is missing in Your modules statement. The modules statement is a bash variable assignment and overides all defaults. So maybe without the "dhcpcd" baselayout may not know, how to run the/which DHCP deamon for the interface.

----------

## jeanfrancis

One of the problems here is the wpa_supplicant configuration file, it specifies group=CCMP, and wpa_cli, once connected, says group_cipher=TKIP  :Smile: 

----------

## d2_racing

I changed my routeur to AES and everything is fine.

Great  :Smile: 

Solved !

----------

