# wpa_config and Timeout

## Dark Ninja

I followed the http://gentoo-wiki.com/HOWTO_Wireless_Configuration_and_Startup guide to setup my wireless configuration on my laptop.

When I type /etc/init.d/net.eth1 start, I receive the following messages...

 * Starting eth1

 *    Starting wpa_supplicant on eth1 ...                                 [ ok ]

 *       timed out                                                        [ !! ]

I have *no* clue why this is happening and would love if someone could help me out.  Here are my /etc/conf.d/net and /etc/wpa_supplicant.conf files.

/etc/conf.d/net

```

modules=( "wpa_supplicant" )

wpa_supplicant_eth1="-Dipw"

wpa_timeout_eth1=15

```

/etc/wpa_supplicant.conf

```

ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=0

eapol_version=1

ap_scan=1

fast_reauth=1

# RIT Connection

network={

        ssid="my_essid"   # this is a different value

        key_mgmt=NONE # it's an unencrypted campus connection

}

```

Also, someone mentioned I needed something to do with DHCP in the net file.  Is this true?  If so, what?  (I tried some stuff with DHCP, but it didn't seem to help anything.)

Thanks for any help.

----------

## kmj0377

I have the exact same problem.

I put for my dhcp stuff:

config_eth1=( "dhcp" )

dhcpcd_eth1="-DHt 10"

in /etc/conf.d/net and still no go.

----------

## Dark Ninja

I can actually help you with that.  Add this to your /etc/conf.d/net file before anything else...

modules_eth1=( "iwconfig" )

That'll bring up your eth1.  Then, continue with those other commands as listed below.  I'll be writing a tutorial about wireless networking in Gentoo-Wiki soon as I have just figured everything out.  Give me a couple days to finish that.  I'll post the link back here.

----------

## kmj0377

 *Dark Ninja wrote:*   

> I can actually help you with that.  Add this to your /etc/conf.d/net file before anything else...
> 
> modules_eth1=( "iwconfig" )
> 
> That'll bring up your eth1.  Then, continue with those other commands as listed below.  I'll be writing a tutorial about wireless networking in Gentoo-Wiki soon as I have just figured everything out.  Give me a couple days to finish that.  I'll post the link back here.

 

Actually I've almost got it working by upgrading to ipw2200 1.0.2 (had to apply a patch to it I found in bugzilla or it segfaulted on modprobe), it just freezes up on dhcp for some reason  :Shocked: 

I tried dhcpcd and udhcpc and it freezes up on both  :Mad: 

----------

## Dark Ninja

Well, I'll get that guide up as soon as possible (I'm in the middle of writing another one right now that I want to finish first).  Keep an eye on this thread and I'll post the link here once I have written it.  Maybe something I've figured out can help you.  It sounds like we *basically* have the same setup.

----------

## kmj0377

Hmm, actually this is odd, I rebooted (actually killed using the power button) and then started up again and it froze up on Setting user font, so apparently I've got something else wrong  :Rolling Eyes: 

Which version of ipw2200 are you using?

Edit:  Ok, apparently that freeze is caused by ipw2200 as well.  I commented out the modules and it started up fine.  Guess 1.0.2 isn't going to work for me.

----------

## kmj0377

Hmm, another oddity I've found is that the tgz portage gets doesn't match the one on the ipw2200 site  :Exclamation: 

Seems there's a bug reported about that: https://bugs.gentoo.org/show_bug.cgi?id=86801

Ok, I've solved my problem.  I downloaded the tgz from the ipw2200 site, patched it with the patch from http://www.bughost.org/bugzilla/show_bug.cgi?id=616 and used udhcpc with it and it now gets an ip.  For some reason it doesn't seem to work with dhcpcd.

----------

## daff

I have the same problem as described in the initial post. I don't know why it does that, it all worked very well two weeks ago. I did an emerge -uvD world a week ago though. Yesterday I saw wpa_supplicant times out connecting to my university network, yet associating with my WPA encrypted home network works just fine.

The uni network has key_mgmt=NONE, apart from that they are not very different concerning the configuration in /etc/wpa_supplicant.conf. Oh, yes, on my homenetwork I don't use DHCP for the machine, instead I have /etc/conf.d/wireless set so that the machine assigns itself a valid IP address. I am using the latest ~x86 madwifi drivers (it's an IBM laptop).

I do the following steps.

1. Power on wireless radio 

2. /etc/init.d/net.ath0 start

3. According to the configuration (which is untouched and worked just fine 2 weeks ago), it should now associate with the WLAN called "uninet" (on one of two channels, 6 and 11).

4. Calling iwconfig ath0 every other second or so shows how the card tries to associate with the network on the different channels (and frequencies).

5. Here's the oddity: for about 5 seconds the association with "uninet" is set up (channel 6), iwconfig shows the MAC address of the nearest AP. But wpa_supplicant doesn't stay associated, it jumps away again and looks to connect on other channels. The same happens a few seconds later, associated on channel 11, and shows the MAC address of another valid AP on uninet. 

6. After that (without staying associated) wpa_supplicant says "timed out [!!]" and exists. 

Mind you, associating manually via iwconfig works just fine. It also works just fine on my WPA encrypted homenetwork.

This is the fault of wpa_supplicant, isn't it?

----------

## kmj0377

Yeah, I can't get it to associate with WEP or unencrypted APs either.  Seems to work fine with WPA APs though.

----------

## Dark Ninja

I use the wpa_supplicant, and it appears to work.  It does flake out sometimes, but I can't tell if it's my setup, or if it's the network.  From my tests so far, it appears to be the network (because other people tend to have the same issues on the network).  You may want to look into it.

----------

## kmj0377

 *Dark Ninja wrote:*   

> I use the wpa_supplicant, and it appears to work.  It does flake out sometimes, but I can't tell if it's my setup, or if it's the network.  From my tests so far, it appears to be the network (because other people tend to have the same issues on the network).  You may want to look into it.

 

Naw, it's not the network, I can connect and stay connected just fine with iwconfig.  However, if I use wpa_supplicant it just times out on WEP and non-encrypted networks but works just fine on my personal WPA network at home.

----------

## nobspangle

I was having similar problems on my laptop with the ipw2200 drivers until I changed

ap_scan=1

to

ap_scan=2

in wpa_supplicant.conf

now my system connects no problem.

Also try 

ap_scan=0

----------

## daff

ap_scan=1 or

ap_scan=2 or

ap_scan=3, neither works, unfortunately.

I don't get it...

----------

## Simsonite

I have a very similar problem.  

I have no problem connecting to my home network which does not broadcast and ssid and has WEP enabled but when it comes to the open campus network it times out.  I did notice that after it has found an AP and shows the correct MAC it will then attempt to authenticate with 000000000000.  I have authentication turned off for this network, but yet it still attempts and then times out.

My config is simply my ssid statement and key_mgmt=NONE, I will attempt ap_scan=2 or 3 tomorrow as I have tried ap_scan=1.  I have no problem using iwconfig to set the ssid and then run dhcpcd ath0, this gets me an ip immediately with no issues.  I see some of you are using ipw2200 so we can assume this occurs with madwifi as well.

----------

## daff

Simsonite: My uni network configuration in /etc/wpa_supplicant.conf is just as yours, but has ssid_scan=1 set since the SSID is not broadcasted. Trying ap_scan=(1|2|3) did not help. 

Could this really be a driver issue (madwifi and ipw2x00) with wpa_supplicant? I am getting frustrated.

----------

## nichocouk

Hello,

I'm using wpa_supplicant  to configure my Wifi along with madwifi. It works perfectly well when I choose WEP encryption, however it does not when I want to use WPA-PSK with TKIP encryption... Could this problem be similar to yours guys?

Here is what I get:

```

 Starting ath0

    Loading networking modules for ath0

       modules: wpa_supplicant essidnet iptunnel ifconfig adsl dhcpcd apipa

          wpa_supplicant provides wireless

          ifconfig provides interface

          dhcpcd provides dhcp

    Starting wpa_supplicant on ath0 ...

       Waiting for association

       timed out

```

My /etc/wpa_supplicant.conf is:

```

ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=0

eapol_version=1

ap_scan=1

network={

        ssid="myssid"

        key_mgmt=NONE

        wep_key0=mywepkeyhere

        #proto=WPA

        #key_mgmt=WPA-PSK

        #psk="my psk here"

        #pairwise=TKIP

        #group=TKIP

}

```

Of course when I want to use WPA-PSK I uncomment all that is commented, and comment the 'key_mgmt=NONE' and 'wep_key0=mywepkey' stuff.

I have added wlan_tkip in the /etc/modules.autoload.d/kernel-2.6, and configured the kernel (gentoo-sources-2.6.11-r5) with CRYPTO_MICHAEL_MIC [=y].

There must be something missing since WEP works but not WPA-PSK...

Any idea??

----------

## kmj0377

Hmm, well, this sucks, now I can't even get it to use WPA  :Mad: 

It just stopped working out of the blue  :Question: 

----------

## Dark Ninja

Yeah - this is what happens to me.  Things are working fine and dandy, and then, all of a sudden, things just crap out.  I can't figure out why.  I did stop using wpa_supplicant, though and started using the conf.d/net.  If anybody has any suggestions, it'd be much appreciated.

----------

## kmj0377

 *Dark Ninja wrote:*   

> Yeah - this is what happens to me.  Things are working fine and dandy, and then, all of a sudden, things just crap out.  I can't figure out why.  I did stop using wpa_supplicant, though and started using the conf.d/net.  If anybody has any suggestions, it'd be much appreciated.

 

I don't get it though, it was working for several days with WPA (stayed connected overnight even) and then one day I shut it down and start it back up and it doesn't connect  :Crying or Very sad: 

Edit:  Ah, got it back.  I had ap_scan=0 in there, commented that out and it works  :Laughing: 

----------

## daff

Same for me, it was working just fine and I was happy to finally have a flexible and working setup fÃ¼r the various WLANs I use. Just Fn-F5 on my Thinkpad would power the adapter on, ifplugd would bring the interface up and with a link beat wpa_supplicant would do the rest. It just worked. And now, a day after the holidays all I get is timeouts on the campus network.

I think I'll post to the wpa_supplicant mailing list, maybe they know something.

Edit: Just for fun I thought I'd try connecting to the unprotected, very open, default-settings-are-in-place-because-it's-convenient WLAN called "NETGEAR" across the yard, and what do you know? It worked...

My config file still looks like this, although I removed the ap_scan= parameter completely, just to be sure:

```

ctrl_interface=/var/run/wpa_supplicant

network={

        ssid="uninet"

        scan_ssid=1

        key_mgmt=NONE

}

network={

        ssid="myhomewlan"

        scan_ssid=1

        key_mgmt=WPA-PSK

        pairwise=TKIP

        psk="mypassphrase"

}

network={

        ssid="NETGEAR"

        key_mgmt=NONE

}

```

As soon as I am back there I'll try it on campus. Very confusing.

And BTW: how do you get the net.eth0 init scripts to be so verbose?

----------

## UberLord

 *daff wrote:*   

> And BTW: how do you get the net.eth0 init scripts to be so verbose?

 

/etc/conf.d/rc

```
RC_VERBOSE="yes"
```

----------

## daff

Thanks!

----------

## BDickson

UberLord:

Didn't you say in earlier posts that iwconfig and wpa_supplicant don't play well together?

Also, there's a notice of a new ebuild for wpa_supplicant 0.3.8, but I don't know how to retrieve it, or point to it, or whatever it is I'm supposed to do, but I can't emerge wpa_supplicant 0.3.8 without it.

************************************************************************************************

carlosman

n00b

Joined: 15 Oct 2004

Posts: 1

 Posted: Sat Oct 16, 2004 5:20 am    Post subject: Maybe you should try this   

--------------------------------------------------------------------------------

I have been trying to find info on how to configure my IBM Thinkpad T40 for wireless networking, using its Intel PRO/Wireless 2100 built-in card (Centrino?). It has been a rough search. Just thought this post maybe helpful for other newbies like myself. 

I just found this ebuild for the wpa_supplicant: 

http://packages.gentoo.org/search/?sstring=wpa_supplicant (was wpa-supplicant) 

I am going to try it on my T40 now and will post notes on my experience later. 

Good luck!  

************************************************************************************************

 Can you help?

Britt Dickson

----------

## kmj0377

Yes, iwconfig and wpa_supplicant don't play well together really, which is why you have to specify:

modules=( "!iwconfig" "wpa_supplicant" )

and that ebuild is in the unstable branch, so you'll need to have ACCEPT_KEYWORD="~x86"

----------

## BDickson

Thanks very much.

BD

----------

## UberLord

 *kmj0377 wrote:*   

> Yes, iwconfig and wpa_supplicant don't play well together really, which is why you have to specify:
> 
> modules=( "!iwconfig" "wpa_supplicant" )
> 
> 

 

Actually you can just do

```
modules=( "wpa_supplicant" )
```

Both provide "wireless" so you can only use one or the other. This says "use wpa_supplicant if available"

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

This says "use iwconfig if available".

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

Means "don't use iwconfig" - so if you have wpa_supplicant installed then it will use that.

However, you're saying what *not* to use, so behaviour of this may change as you install, remove things

----------

## kmj0377

Interesting, I though I remembered when I had just modules=( "wpa_supplicant" ) that it still tried to use iwconfig for some reason.

----------

## Simsonite

Well I have tried as many things as I can think of now, ap_scan settings, adding !iwconfig to the modules, newest version of wpa_supplicant and still no luck.  When I debug there is always an attempt to authenticate to a full zero mac address, but only after it finds and begins to connect to a vaild AP.  I know I have key_mgmt set to 'NONE' so I really dont see what this is happening.  I may attempt to remove iwconfig all togeather and see if that helps.  Good luck to everyone else, I will try to keep you posted.

----------

## BDickson

I just noticed that both of you have pretty short timeouts (16 sec & 10 sec). Have you tried 60 sec?

It mightt just take longer than you're giving it?

BD

----------

## kmj0377

 *BDickson wrote:*   

> I just noticed that both of you have pretty short timeouts (16 sec & 10 sec). Have you tried 60 sec?
> 
> It mightt just take longer than you're giving it?
> 
> BD

 

I have mine at 60 secs, however if I use iwconfig on the WEP and non-encrypted APs it connects right away.

----------

## fov

I had the exactly same problems with my D-Link card (using madwifi drivers): associating to my WPA APs worked, but the unencrypted APs at the campus always failed with timeout. I was able to fix that problem by manually upgrading to the latest development wpa_supplicant. As their Changelog states, there seems to be a problem with unencrypted networks if you use the madwifi drivers. From http://hostap.epitest.fi/cgi-bin/viewcvs.cgi/*checkout*/hostap/wpa_supplicant/ChangeLog?rev=HEAD&content-type=text/plain:

```
* driver_madwifi: fixed association in plaintext mode
```

Unfortunately I wasn't able to find an ebuild for this and I'm not familiar enough with writing one, so currently the only option seems to manually compile/install the latest development wpa_supplicant (or wait for a new version and ebuild to be released).

----------

## BDickson

If you emerge baselayout-1.11.10-r6, you'll get wirelwss-tools-27_pre27.

Might that help?

BD

----------

## fov

While the latest wpa_supplicant seems to work fine for my madwifi card, the net.ath0 script still times out while waiting for an association. The net.ath0 script seems to call wpa_cli to get the status and waits for a successful scan. Unfortunately for key_mgmt=NONE, it waits for wpa_state=ASSOCIATED, which never ocurs, because my wpa_supplicant returns wpa_state=COMPLETE. Thus the net.ath0 script does never recognize the successful association and aborts with a timeout. The problem seems to be in the wpa_supplicant module of baselayout-1.11.10-r6 (/lib/rcscripts/net.modules.d/wpa_supplicant).

If you feel adventuresome, you might try to change /lib/rcscripts/net.modules.d/wpa_supplicant at line 99 from:

```
                "NONE"  )               [[ ${status[1]} == "ASSOCIATED" ]] ;;
```

to

```
                "NONE"  )               [[ ${status[1]} == "ASSOCIATED" || ${status[1]} == "COMPLETED" ]] ;;
```

This change (and using the latest development wpa_supplicant) made it work for me again.

----------

## BDickson

That will be interesting when I get baselayout-1.11.10 emerged. I'm slowly getting it the files it wants, but it keeps coming up with additional patches it wants that I can't find on the mirror.

Back to it.

BD

----------

## UberLord

 *fov wrote:*   

> While the latest wpa_supplicant seems to work fine for my madwifi card, the net.ath0 script still times out while waiting for an association. The net.ath0 script seems to call wpa_cli to get the status and waits for a successful scan. Unfortunately for key_mgmt=NONE, it waits for wpa_state=ASSOCIATED, which never ocurs, because my wpa_supplicant returns wpa_state=COMPLETE. Thus the net.ath0 script does never recognize the successful association and aborts with a timeout. The problem seems to be in the wpa_supplicant module of baselayout-1.11.10-r6 (/lib/rcscripts/net.modules.d/wpa_supplicant).
> 
> If you feel adventuresome, you might try to change /lib/rcscripts/net.modules.d/wpa_supplicant at line 99 from:
> 
> ```
> ...

 

That's odd - my wpa_supplicant returns ASSOCIATED when I use key_mgmt=NONE

I'm using wpa_supplicant-0.3.8 with madwifi-driver-0.1_pre20050224

----------

## fov

 *UberLord wrote:*   

>  *fov wrote:*   This change (and using the latest development wpa_supplicant) made it work for me again. 
> 
> That's odd - my wpa_supplicant returns ASSOCIATED when I use key_mgmt=NONE
> 
> I'm using wpa_supplicant-0.3.8 with madwifi-driver-0.1_pre20050224

 

That's odd indeed. It seems to be a known problem that wpa_supplicant doesn't work with the madwifi driver with key_mgmt=NONE. I manually called wpa_supplicant 0.3.8 and it always disconnects after being associated for a few seconds. For some reason it was expecting some authentication even in key_mgmt=NONE mode. This seems to be a known problem and they fixed it in CVS already (http://hostap.epitest.fi/cgi-bin/viewcvs.cgi/hostap/wpa_supplicant/driver_madwifi.c.diff?r1=1.8&r2=1.9), but there wasn't a new version released yet.

After I installed wpa_supplicant-cvs, it now works, but for some reason wpa_cli now reports CONNECTED instead of ASSOCIATED, which breaks the net.ath0 script. I suppose they changed this behavior somewhere in CVS as well. Probably it will become an issue after they release wpa_supplicant-0.4.0 and we get an ebuild for it.

----------

## UberLord

 *fov wrote:*   

> After I installed wpa_supplicant-cvs, it now works, but for some reason wpa_cli now reports CONNECTED instead of ASSOCIATED, which breaks the net.ath0 script. I suppose they changed this behavior somewhere in CVS as well. Probably it will become an issue after they release wpa_supplicant-0.4.0 and we get an ebuild for it.

 

OK, that clears that up.

I'll wait until they release a new version to see if I need to change baselayout or not.

----------

## Simsonite

Well its good to know that this issue has been addressed in CVS.  I also plan to wait for a new ebuild then, right now I can simple go around my problem using iwconfig when I am on campus.  Guess this wouldnt be a bad time to try and figure out how to write an ebuild for cvs snapshots.

----------

## daff

It seems that wpa_supplicant 4.0 (~x86 version in portage, changelog) "fixes association in plaintext mode for the madwifi driver".

Haven't had a chance to try it out yet but it seems to be the fix for the problems described above. At least I hope so.

----------

## mcguire

it seems that I have the same problem : i'm not abble to connect to a wireless network using WEP with wpa_supplicant but it works when using wireless-tolls

i'm currently using baselayout 1.11.12-r4 and wpa_supplicant 0.4.1

my wireless card use ipw2200 driver 1.0.4

----------

## Tanisete

I have a similar problem using madwifi(CVS, 20/04/2005, portage) and wpa_supplicant (0.3.8, because 0.4.1 gave me trouble with SIOCSIMPKS operations..)

The log i get is:

```
* Starting ath0

 *   Loading networking modules for ath0

 *     modules: apipa wpa_supplicant essidnet iptunnel ifconfig

 *       wpa_supplicant provides wireless

 *       ifconfig provides interface

 *   Starting wpa_supplicant on ath0 ...

 *     Waiting for association                                                       [ ok ]

 *     timed out                                                                     [ !! ]

```

```

wpa_supplicant.conf:

network={

        ssid="XXX"

        scan_ssid=1

        proto=WPA

        key_mgmt=WPA-PSK

        pairwise=CCMP TKIP

        group=CCMP TKIP WEP104 WEP40

        psk=XX

        #priority=2

}

```

And i know the device gets connected, because the AP has the log identifying my card connected...

What can be the problem??

Thanks a lot!

----------

## mcguire

here is more information about my connection

/etc/init.d/net.eth1 start

```

 * Starting eth1

 *   Starting wpa_supplicant on eth1 ...

ioctl[SIOCSIWPMKSA]: Operation not supported                              [ ok ]

 *     timed out                                                          [ !! ]

```

/etc/wpa_supplicant.conf

```

network={

        ssid="Sartre3rdFloor"

        key_mgmt=NONE

        wep_key0=8657...

        wep_tx_keyidx=0

        priority=1

}

```

----------

## nichocouk

 *mcguire wrote:*   

> here is more information about my connection
> 
> /etc/init.d/net.eth1 start
> 
> ```
> ...

 

I might be wrong but I would recommend you to downgrade to a stable version of wpa-supplicant. Or check out on the Host-AP mailing list archives, but afaik there is nothing to do apart going back to 0.3.8.

Again, please double check what I'm saying in case I got it wrong!

----------

## eltino

 *mcguire wrote:*   

> it seems that I have the same problem : i'm not abble to connect to a wireless network using WEP with wpa_supplicant but it works when using wireless-tolls
> 
> i'm currently using baselayout 1.11.12-r4 and wpa_supplicant 0.4.1
> 
> my wireless card use ipw2200 driver 1.0.4

 

Go back to wpa_supplicant 0.3.8 and ipw2200 1.0.3  -- It's a known problem I think. Should be fixed with next ipw2200 release.

----------

## CLsystems

hello everyone,it seems nichocouk had the right idea! 

 *nichocouk wrote:*   

> 
> 
> I might be wrong but I would recommend you to downgrade to a stable version of wpa-supplicant. Or check out on the Host-AP mailing list archives, but afaik there is nothing to do apart going back to 0.3.8.
> 
> Again, please double check what I'm saying in case I got it wrong!

 

in the mailing list it's said there's a patch available for wpa_supplicant version 0.4.1 that fixes the problems with the new ipw2200 driver. the url of the mail in the archive is http://lists.shmoo.com/pipermail/hostap/2005-May/010353.html in the mail ther's a link to directly download the patch...

cheers, daniel

----------

