# wpa_supplicant not connecting to my network[SOLVED]

## jewdan

Sorry for another one of these threads but searching hasn't helped me fix this problem.

I am using wpa_supplicant and the ipw2200 drivers to try to connect to my WEP network.  Right now, here's what happens when I try to start it up.

```
/etc/init.d/net.eth0 restart

 * Starting eth0

 *   Configuring wireless network for eth0

 *   WEP key is not set for "a_network_that_isnt_mine" - not connecting

 *   WEP key is not set for "my_network" - not connecting

 *   eth0 connected to ESSID "linksys" at...

```

linksys is some other unprotected network that my card is picking up and trying to connect to.

My wpa_supplicant.conf:

```
ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=0

eapol_version=1

ap_scan=0  #not sure what this should be, tried all values

fast_reauth=1

network={

    ssid="my_network"

    key_mgmt=NONE

    wep_key0_0123456789ABCDEF...

    wep_tx_keyidx=0

    priority=5

}
```

My /etc/conf.d/net file only contains:

```
iface_eth0="dhcp"
```

because modules=... and wpa_supplicant_eth0=... causes errors.  Any idea how I can connect to my network?  Let me know what other information you might need.

ThanksLast edited by jewdan on Wed Sep 20, 2006 10:21 pm; edited 1 time in total

----------

## rsa4046

I have ipw2200 and wpa_supplicant, and a Linksys WAP54G router AP. My security reasons I set it up to use a WPA pre-shared key (TKIP algorithm) rather than WEP,  

my kernel loads the Intel PRO/Wireless 2200BG driver,

```
#

# Wireless 802.11b ISA/PCI cards support

#

# CONFIG_IPW2100 is not set

CONFIG_IPW2200=m

CONFIG_IPW2200_MONITOR=y

CONFIG_IPW_QOS=y

# CONFIG_IPW2200_DEBUG is not set
```

and here's my /etc/wpa_supplicant.conf

```
ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=0

eapol_version=1

ap_scan=1

fast_reauth=1

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

network={

        ssid="Valhalla"

        proto=WPA

        key_mgmt=WPA-PSK

        pairwise=CCMP TKIP

        group=CCMP TKIP WEP104 WEP40

## obviously use your own key here ##

        psk=erptop2049k34kk234234i23-00w0er9w92340234234ijriji234239409j3j4i334bw

        priority=2

}
```

This setup works flawlessly, maybe you could modify this for a WEP setup?

Edit, Added later: Forget to add /etc/conf.d/net

```
modules=( "wpa_supplicant" )

wpa_supplicant_eth1="-Dwext"

config_eth1=( "dhcp" )

iwconfig_eth1="essid Valhalla"

associate_timeout_eth1=60

config_Valhalla=("dhcp")

preferred_aps=("Valhalla")
```

----------

## jewdan

Trying to use the kernels ipw2200 give me a ton of other problems so I would prefer to use the version in portage.

Is there any hope?

----------

## rsa4046

Assuming static WEP, the possibilities below are taken from the wpa_supplicant.cont.example file:

```

# Plaintext connection (no WPA, no IEEE 802.1X)

network={

        ssid="plaintext-test"

        key_mgmt=NONE

}

# Shared WEP key connection (no WPA, no IEEE 802.1X)

network={

        ssid="static-wep-test"

        key_mgmt=NONE

        wep_key0="abcde"

        wep_key1=0102030405

        wep_key2="1234567890123"

        wep_tx_keyidx=0

        priority=5

}

# Shared WEP key connection (no WPA, no IEEE 802.1X) using Shared Key

# IEEE 802.11 authentication

network={

        ssid="static-wep-test2"

        key_mgmt=NONE

        wep_key0="abcde"

        wep_key1=0102030405

        wep_key2="1234567890123"

        wep_tx_keyidx=0

        priority=5

        auth_alg=SHARED

}

```

One of these should work, depending on how the router is set up ...

For example,

```
ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=0

eapol_version=1

# ap_scan=0  #not sure what this should be, tried all values

#

# I would change this to 1 to allow wpa_supplicant to take care of AP selection

#

ap_scan=1

fast_reauth=1

network={

    ssid="my_network"

# you don't have key_mgmt declared, so it defaults to WPA-PSK WPA-EAP, which I don't think you want ... so declare NONE

    key_mgmt=NONE

    auth_alg=SHARED

#  group=WEP104 WEP40

#

# obviously fill in keys

#

    wep_key0="fill_in_your_ascii_key0"

    wep_key1="fill_in_your_ascii_key1"

    wep_key2="fill_in_your_ascii_key2"

    wep_tx_keyidx=0

    priority=5

```

Does that work?

----------

## rsa4046

Also, in /etc/conf.d/net, with

```
modules=( "wpa_supplicant" )

wpa_supplicant_eth0="-Dwext"

config_eth0=( "dhcp" ) 
```

you shouldn't be getting errors ... are you sure you have:

```
Important: You have to have CONFIG_PACKET enabled in your kernel for wpa_supplicant to work.
```

----------

## jewdan

Thanks.  /etc/init.d/net.eth0 now runs with no errors:

```
# /etc/init.d/net.eth0 restart

 * Starting eth0

 *   Starting wpa_suppliant on eth0 ...    [ok]

 *   Starting wpa_cli on eth0 ...          [ok]

 *     Backgrounding ...

#

```

However, I still have no network or internet access.  I have a feeling it's because I don't have WEP encryption enabled in my kernel.  When I try to enable "Generic IEEE 802.11 Network Stack" and "IEEE 802.11 WEP encryption," the kernel won't compile.  This is the error message:

```
...

  CC      kernel/configs.o

  LD      kernel/built-in.o

make[2]: *** No rule to make target 'net/ieee80211/ieee80211_module.s', needed by 'net/ieee80211/ieee80211_module.o'. Stop.

make[1]: *** [net/ieee80211] Error2

make: *** [net] Error2

```

Do I need to get those things turned on somehow, and if so, how?  Nothing I tried seemed to work.

Alternately, I don't see any evidence of dhcp running.  Is there something wrong there?

----------

## rsa4046

 *jewdan wrote:*   

> Thanks.  /etc/init.d/net.eth0 now runs with no errors:
> 
> ```
> # /etc/init.d/net.eth0 restart
> 
> ...

 Progress. *jewdan wrote:*   

> make[2]: *** No rule to make target 'net/ieee80211/ieee80211_module.s', needed by 'net/ieee80211/ieee80211_module.o'. Stop.
> 
> make[1]: *** [net/ieee80211] Error2
> 
> make: *** [net] Error2[/code]

 Which kernel sources are you using?

```
uname -r
```

 Can you list the versions (if any) you've emerged for the following? Try

```
# equery l $package
```

where $package is each of the following in turn: wpa_supplicant, ieee80211, ipw2200.

Edit: Later added, also ipw2200-firmware

----------

## rsa4046

Sorry for the serial replies, but in answer to the kernel problem, I think there is a conflict between the ieee80211 support supplied by the ipw2200 package and that present in the kernel. Check that you've enabled the wireless extensions but disabled the ieee80211 stack in the kernel, then

```
# cd /usr/src/linux

# make clean && make && make modules_install
```

install the new kernel, reboot, and then emerge ipw2200; it may stop with an error and suggest a command to remove the kernel ieee80211 stack. Run this command, and re-emerge ipw2200.

----------

## jewdan

Edit: ^^^ I'm pretty sure that's the way I've had it throughout all this.

 *rsa4046 wrote:*   

> Which kernel sources are you using?
> 
> ```
> uname -r
> ```
> ...

 

2.6.17-r8

 *rsa4046 wrote:*   

> Can you list the versions (if any) you've emerged for the following? Try
> 
> ```
> # equery l $package
> ```
> ...

 

wpa_supplicant-0.4.9

ieee80211-1.1.13-r1

ipw2200-1.1.3

ipw2200-firmware-3.0

----------

## rsa4046

jewdan,

Okay, see my previous post. Also see this thread.

----------

## jewdan

Did all that.  eth0 starts, doesn't complain, wireless led is on, can't ping my router or anything else.  Must be a problem with my config files.

/etc/conf.d/net:

```
modules=("wpa_supplicant")

wpa_supplicant_eth0("-Dwext")

config_eth0=("dhcp")
```

/etc/wpa_supplicant.conf

```
ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=0

eapol_version=1

ap_scan=1

fast_reauth=1

network={

    ssid="my_network"

    key_mgmt=NONE

    wep_key0=hexkeyhere

    wep_tx_keyidx=0

    priority=5

}
```

/etc/conf.d/wireless is empty.

----------

## rsa4046

 *jewdan wrote:*   

> /etc/conf.d/wireless is empty.

 But you're using wpa_supplicant versus iwconfig (from wireless-tools?) anyway, so this shouldn't be important. Hmmm ...  not sure why this doesn't work: What does 

```
# ifconfig 
```

report? Also post the output of

```
/etc/init.d/net.eth0 restart
```

----------

## jewdan

```
# ifconfig

eth0   Link encap:Ethernet  HWaddr 00:13:CE:D2:F8:AC

       UP BROADCAST NOTRAILES RUNNING MULTICAST  MTU:1500  Metric:1

       RX packets:1 errors:903 dropped:915 overruns:0 frame:0

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

       collisions:0 txqueuelen:1000

       RX byte:3941 (3.8 Kb)  TX bytes:15768 (15.3 Kb)

       Interrupt:23 Base address:0xe000 Memory:a8401000-a8401fff

lo     Link encap:Local Loopback

       inet addr:127.0.0.1  Mask:255.0.0.0

       UP BROADCAST RUNNING  MTU:16436 Metric:1

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

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

       collisions:0 txqueuelen:0

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

```
# iwconfig

lo     no wireless extensions.

eth0   unassociated  ESSID:"my_network"

       Mode:managed  Channel=0  Access Point: 00:18:39:7A:DC:47

       Bit Rate:0 kb/s   Tx-Power=20 dBm   Sensitivity=8/0

       Retry Limit:7   RTS thr:off   Fragment thr:off

       Encryption key:my_hex_key_here   Security mode:open

       Power Management:off

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

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

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

```

```
# /etc/init.d/net.eth0 restart

 * Stopping eth0

 *   Bring down eth0

 *     Shutting down eth0 ...                 [ ok ]

 *     Stopping wpa_cli on eth0 ...           [ ok ]

 *     Stopping wpa_supplicant on eth0 ...    [ ok ]

 * Starting eth0

 *   Starting wpa_supplicant on eth0 ...      [ ok ]

 *   Starting wpa_cli on eth0 ...             [ ok ]

 *     Backgrounding ...

#

```

----------

## jewdan

```
# ifconfig eth0 down

# rmmod ipw2200

# modprobe ipw2200

# ifconfig eth0 up

# iwconfig eth0 key ...

# dhcpcd eth0

Error, recvfrom: Network is down

#
```

Hmmm...

----------

## rsa4046

I'm stumped ... It looks like it's not even bothering to try the AP. I believe the default wpa_timeout is 60 seconds, should be plenty of time for WEP. I've heard that WEP is finicky, but I also know what I've gotten my hardware to work using the setup you describe. Does inserting 

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

into /etc/conf.d/net make any difference?

----------

## rsa4046

The only thing I can think of doing is to use iwconfig on the command line to see if you can connect without wpa_supplicant (you may have to kill/disable the wpa_supplicant statements in /etc/conf.d/net, not sure about this).

Anyway, e.g.

```
# iwconfig eth0 essid YOURESSID

# iwconfig eth0 key s:asciikeyor-hexkey-not-sure

# dhcpcd eth0
```

and then see what iwconfig reports

----------

## rsa4046

Okay I tested my laptop (ipw2200) and router (Linksys WAP54G AP), and it works with WEP authentication. Here's the /etc/wpa_supplicant.conf (my wireless is eth1)

```
ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=0

eapol_version=1

ap_scan=1

fast_reauth=1

network={

        ssid="MyNet"

        scan_ssid=1

        key_mgmt=NONE

#

# obviously phony keys here

#

        wep_key0=205B9CF3D0

        wep_key1=03B9943917

        wep_key2=C9C0E3D69F

        wep_key3=4C5965582F

        wep_tx_keyidx=0

        priority=5

        }
```

and /etc/conf.d/net

```
modules=( "wpa_supplicant" )

wpa_supplicant_eth1="-Dwext"

config_eth1=( "dhcp" )

```

Check your setup on the router; this works for me. I don't have wireless-tools emerged. I do have ipw2200 in the kernel, and 

```
net-wireless/ipw2200-firmware-2.4 (2.4)

net-wireless/ipw2200-firmware-3.0 (0)

net-wireless/wpa_supplicant-0.5.5
```

Here's the result

```
zeus # /etc/init.d/net.eth1 stop

 * Unmounting network filesystems ...                                                 [ ok ]

 * Stopping ntpd ...                                                                  [ ok ]

 * samba -> stop: smbd ...                                                            [ ok ]

 * samba -> stop: nmbd ...                                                            [ ok ]

 * Stopping sshd ...                                                                  [ ok ]

 * Stopping eth1

 *   Bringing down eth1

 *     Stopping dhcpcd on eth1 ...                                                    [ ok ]

 *     Shutting down eth1 ...                                                         [ ok ]

 *     Stopping wpa_cli on eth1 ...                                                   [ ok ]

 *     Stopping wpa_supplicant on eth1 ...                                            [ ok ]

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

 * Starting eth1

 *   Starting wpa_supplicant on eth1 ...                                              [ ok ]

 *   Starting wpa_cli on eth1 ...                                                     [ ok ]

 *     Backgrounding ...

zeus # ping www.gentoo.org

PING www.gentoo.org (66.219.59.46) 56(84) bytes of data.

64 bytes from kiwi.gentoo.org (66.219.59.46): icmp_seq=1 ttl=53 time=30.3 ms

64 bytes from kiwi.gentoo.org (66.219.59.46): icmp_seq=2 ttl=53 time=30.3 ms

--- www.gentoo.org ping statistics ---

2 packets transmitted, 2 received, 0% packet loss, time 999ms

rtt min/avg/max/mdev = 30.308/30.350/30.393/0.179 ms

```

HTH

----------

## jewdan

Added the line 'scan_ssid=1' to my wpa_supplicant.conf file and it worked.

Thanks for all your help.    :Very Happy: 

----------

