# wpa_supplicant configuration difficulties

## ReefShark

I have a IBM Thinkpad T41 with a Intel Corp. PRO/Wireless LAN 2100 3B Mini PCI Adapter (rev 04) wireless card.

I installed the appropriate drivers and followed the networking guide in the handbook.

When I boot, eth1 (my wireless card) times out. Wpa_supplicant does seem to have connected to my AP:

```

# iwconfig eth1

eth1      IEEE 802.11b  ESSID:"my_essid"  Nickname:"ipw2100"

          Mode:Managed  Frequency:2.462 GHz  Access Point: 00:12:17:D5:16:DE   

          Bit Rate=11 Mb/s   Tx-Power:off   

          Retry:on   RTS thr:off   Fragment thr:off

          Encryption key:off

          Power Management:off

          Link Quality=100/100  Signal level=-48 dBm  

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

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

# ifconfig eth1

eth1      Link encap:Ethernet  HWaddr 00:0C:F1:24:A8:DE  

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

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

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

          collisions:0 txqueuelen:1000 

          RX bytes:276 (276.0 b)  TX bytes:72 (72.0 b)

          Interrupt:11 Base address:0x4000 Memory:c0210000-c0210fff

```

When I run dhcp on eth1 manually, it immediately gets its IP from the Wireless Access Point:

```

# dhcpcd eth1

# ifconfig eth1

eth1      Link encap:Ethernet  HWaddr 00:0C:F1:24:A8:DE  

          inet addr:192.168.153.201  Bcast:192.168.153.255  Mask:255.255.255.0

          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1

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

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

          collisions:0 txqueuelen:1000 

          RX bytes:866 (866.0 b)  TX bytes:1348 (1.3 Kb)

          Interrupt:11 Base address:0x4000 Memory:c0210000-c0210fff
```

I figure it must be an error on my part in my network config. My wireless network is unencrypted (for now), so no WEP or WPA is needed.

/etc/wpa_supplicant.conf:

```

ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=wheel

ap_scan=1

fast_reauth=1

network={

        ssid="my_essid"

        scan_ssid=1

        key_mgmt=NONE

} 
```

/etc/conf.d/wpa_supplicant

```
INTERFACES="eth1"

ARGS="-w"

ARGS_eth1="-Dipw"
```

(wpa_supplicant is not added to runlevel 'default')

/etc/conf.d/net

```
#

# Wireless (eth1)

#

modules=( "wpa_supplicant" )

wpa_supplicant_eth1="-Dipw"

config_starcluster=( "dhcp" )

fallback_starcluster=( "192.168.153.41/24" )

fallback_route_starcluster=( "default via 192.168.153.1" )
```

I naturally tried several variations on the config above. None worked.

Can anyone point me to any errors in my config file(s) ?

Thanks in advance  :Wink: 

----------

## volkmar

 *ReefShark wrote:*   

> /etc/conf.d/net
> 
> ```
> #
> 
> ...

 

Have you tried

/etc/conf.d/net

```
modules_eth1=( "wpa_supplicant" )

config_eth1=( "dhcp" )

#dhcpcd_eth1="-t 20"

wpa_supplicant_eth1="-Dipw"

iwconfig_eth1="essid YourESSIDname"

```

with the last line only needed for 'hidden' ESSID.

----------

## ReefShark

Not yet... will try and keep you posted. Thanks!  :Wink: 

----------

## ReefShark

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

 * Starting eth1

 *   Starting wpa_supplicant on eth1 ...                                  [ ok ]

Failed to connect to wpa_supplicant - wpa_ctrl_open: No such file or directory

Failed to connect to wpa_supplicant - wpa_ctrl_open: No such file or directory

Failed to connect to wpa_supplicant - wpa_ctrl_open: No such file or directory

Failed to connect to wpa_supplicant - wpa_ctrl_open: No such file or directory

Failed to connect to wpa_supplicant - wpa_ctrl_open: No such file or directory

Failed to connect to wpa_supplicant - wpa_ctrl_open: No such file or directory

Failed to connect to wpa_supplicant - wpa_ctrl_open: No such file or directory

Failed to connect to wpa_supplicant - wpa_ctrl_open: No such file or directory

 *     timed out                                                          [ !! ]
```

Now I'm really lost...  :Crying or Very sad: 

----------

## volkmar

 *ReefShark wrote:*   

> Now I'm really lost... 

 Will you show us your output of:

# iwlist eth1 scan

and

# wpa_cli status verbose

----------

## ReefShark

 *volkmar wrote:*   

>  *ReefShark wrote:*   Now I'm really lost...  Will you
> 
>  show us your output of:
> 
> # iwlist eth1 scan
> ...

 

Sure:

```
# iwlist eth1 scan

eth1      Scan completed :

          Cell 01 - Address: [MAC address]

          ESSID:"some_other_essid"

          Protocol:IEEE 802.11g

          Mode:Master

          Channel:2

          Encryption key:off

          Bit Rate:54 Mb/s

          Extra: Rates (Mb/s): 1 2 5.5 6 9 11 12 18 24 36 48 54 

          Signal level=-72 dBm  

          Extra: Last beacon: 492ms ago

          Cell 02 - Address: [my AP MAC address]

          ESSID:"myessid"

          Protocol:IEEE 802.11bg

          Mode:Master

          Channel:11

          Encryption key:off

          Bit Rate:54 Mb/s

          Extra: Rates (Mb/s): 1 2 5.5 6 9 11 12 18 24 36 48 54

          Signal level=-44 dBm

          Extra: Last beacon: 257ms ago
```

And....

```
# wpa_cli 

wpa_cli v0.3.8

Copyright (c) 2004-2005, Jouni Malinen <jkmaline@cc.hut.fi> and contributors

This program is free software. You can distribute it and/or modify it under the terms of the GNU General Public License version 2.

Alternatively, this software may be distributed under the terms of the                                                                                                                                                                                                                                                                                                                                 BSD license. See README and COPYING for more details.

Selected interface 'eth1'

Interactive mode

> <2>Authentication with 00:00:00:00:00:00 timed out.

<2>Trying to associate with 00:12:17:d5:16:de (SSID='starcluster' freq=0 MHz)

'PING' command failed.

Connection to wpa_supplicant lost - trying to reconnect
```

And...

```
# wpa_cli status verbose

Failed to connect to wpa_supplicant - wpa_ctrl_open: No such file or directory
```

Some other info that might be useful:

```
# emerge -pv wpa_supplicant

These are the packages that I would merge, in order:

Calculating dependencies ...done!

[ebuild   R   ] net-wireless/wpa_supplicant-0.3.8  -gsm +readline +ssl 0 kB
```

I don't have wpa_supplicant in my 'default' boot level, because I understand it's no longer needed. 

To be sure I also tried that, but no luck  :Sad: 

I do get output though:

```
# /etc/init.d/wpa_supplicant start

* Starting wpa_supplicant ...

*   eth1 ...                                        [ ok ]

# wpa_cli status verbose                                                                          

Selected interface 'eth1'

bssid=00:00:00:00:00:00

ssid=starcluster

pairwise_cipher=NONE

group_cipher=NONE

key_mgmt=NONE

wpa_state=ASSOCIATING

Supplicant PAE state=DISCONNECTED

suppPortStatus=Unauthorized

heldPeriod=60

authPeriod=30

startPeriod=30

maxStart=3

portControl=ForceAuthorized

Supplicant Backend state=INITIALIZE

EAP state=DISABLED

reqMethod=0

methodState=NONE

decision=FAIL

ClientTimeout=60

# /etc/init.d/net.eth1 restart

* Starting eth1

*   Stopping wpa_supplicant on eth1 ...                                  [ ok ]

*   Starting wpa_supplicant on eth1 ...                                  [ ok ]

Failed to connect to wpa_supplicant - wpa_ctrl_open: No such file or directory

Failed to connect to wpa_supplicant - wpa_ctrl_open: No such file or directory

Failed to connect to wpa_supplicant - wpa_ctrl_open: No such file or directory

Failed to connect to wpa_supplicant - wpa_ctrl_open: No such file or directory

Failed to connect to wpa_supplicant - wpa_ctrl_open: No such file or directory

Failed to connect to wpa_supplicant - wpa_ctrl_open: No such file or directory

Failed to connect to wpa_supplicant - wpa_ctrl_open: No such file or directory

Failed to connect to wpa_supplicant - wpa_ctrl_open: No such file or directory

*     timed out                                                          [ !! ]
```

Still can't connect through the net.eth1 script, but manually works fine (but can't start sshd and boinc this way  :Crying or Very sad:  )

Hope the data above gives you the information you need to help me tacle this issue. Thanks for all the help so far though  :Wink: 

----------

## ReefShark

I came across something that might provide an answer to my problem:

/etc/conf.d/wireless.example

```
# By default a successful association in Managed mode sets the MAC

# address of the AP connected to. However, some drivers (namely

# the ipw2100) don't set an invalid MAC address when association

# fails - so we need to check on link quality which some drivers

# don't report properly either.

# So if you have connection problems try flipping this setting

# Valid options are MAC, quality and all - defaults to MAC

#associate_test_eth0="MAC"
```

Seems the problem is definately the wificard, not the Linksys AP.

Gonna do some Googling in the morning, and for now NOT use wpa_supplicant (wifi network card goes up without a hitch if I use the default module (iwconfig).

----------

## UberLord

Do you get the same issue using the latest 0.4.x release in portage?

----------

## mspiegle

 *UberLord wrote:*   

> Do you get the same issue using the latest 0.4.x release in portage?

 

UberLord,

I seem to be having the same problems as him.  If you'll recall my other thread named "troubles with wpa_supplicant and 128bit WEP keys [SOLVED]", I had the problem solved at work where I use a WEP104 key.  When I got home, I booted my laptop and it would associate with the IP but not get a dhcp lease (it timed out).  I tried reconfiguring a few things and eventually switched my wireless config to the following:

wpa_supplicant = 0.4.1 (was 0.3. :Cool: 

ipw2200 = 1.0.4 (was 1.0.3)

ipw2200-fimware = 2.2 (was 2.3)

Things started working fine at home, but when I got back to work, it would grab a DHCP lease.  I had to kill off wpa_supplicant, configure my 128bit wep with iwconfig and bring the interface up with dhcpcd.

Got any ideas for me?  I'll be searching on the forums in the meantime...

Thanks again for your help.

----------

## mspiegle

Ok, got a positive update:

I found out that 1.0.5 just hit portage last night.  I emerged that along with 0.4.3 wpa_supplicant and it actually seems to be working (@ work with 128bit WEP).  For some reason, net.eth1 won't connect on startup, but if I issue /etc/init.d/net.eth1 afterwards, it associated, sets the WEP, and gets a DHCP lease (where as before it would just hang on DHCP lease).

SO, not sure why net.eth1 won't come up on startup.  Just to make sure, I removed it and rc-update added it again, but no cigar.  Somehow, net.eth0 DOES come up just fine... Here are my current configs:

```
asus ~ # cat /etc/wpa_supplicant.conf

ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=wireless

eapol_version=1

ap_scan=1

fast_reauth=1

network={

        ssid="Jonathan"

        scan_ssid=1

        key_mgmt=NONE

}

network={

        ssid="waves"

        key_mgmt=NONE

}

network={

        ssid="jimfig"

        scan_ssid=1

        proto=WPA

        key_mgmt=WPA-PSK

        group=CCMP TKIP WEP104 WEP40

        pairwise=TKIP CCMP

        psk="[removed]"

}

network={

        ssid="affwire"

        key_mgmt=NONE

        wep_key0=[removed]

}
```

```
asus ~ # cat /etc/conf.d/net 

# /etc/conf.d/net:

# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/conf.d/net,v 1.7 2002/11/18 19:39:22 azarah Exp $

config_eth0=( "dhcp" )

dhcpcd_eth0=( "-R -t 10" )

modules_eth1=( "wpa_supplicant" )

wpa_supplicant_eth1="-Dipw"

wpa_timeout_eth1=15

config_eth1=( "dhcp" )

dhcpcd_eth1=( "-R -t 10" )
```

----------

## mspiegle

Ok, I thought it was interesting that as soon as my laptop is booted, wpa_supplicant is running (ps -ef), but it isn't in rc-status and net.eth1 isn't in rc-status.  I attempt to issue /etc/init.d/wpa_supplicant stop, but it claims it isn't running.  I can still /etc/init.d/net.eth1 start and the WEP key gets assigned and the interface comes up with dhcpcd.

----------

## UberLord

Sounds like hotplug is starting it automatically for you

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

----------

## ReefShark

So in short, it's a baselayout problem, not a wpa_supplicant/ipw2100 problem?  :Question: 

----------

