LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 11-14-2006, 02:07 PM   #1
warmana
LQ Newbie
 
Registered: Jul 2004
Location: United Kingdom
Distribution: Slackware
Posts: 8

Rep: Reputation: 0
How do I configure wpa_supplicant to try all hidden SSIDs in quick succession?


I have wpa_supplicant working fine in a number of locations, each of which uses (amongst other things) hidden SSIDs.

When wpa_supplicant.conf has just the one network={..} definition for a location, or if that definition is the first one in the .conf file, then association and dhcp allocation works really well and quickly.

But if the wrong network definition is used (say, I forgot to change the .conf file when I moved to another location), the network connection will time out before wpa_supplicant has tried the correct definition.

I know each of the locations has good APs, as association is normally very quick.

I have to use ap_scan=2 to get wpa_supplicant to probe for the location AP. How do I get wpa_supplicant to just try for (say) less than 5 seconds, before trying the next network definition in wpa_supplicant.conf.

This is on Slackware 11.0, using a 2.6 kernel, and an IPW2200 wireless driver (all of which seem to work fine).

Thanks for any help.
 
Old 11-15-2006, 03:22 PM   #2
marsm
Member
 
Registered: Aug 2005
Distribution: Ubuntu
Posts: 62

Rep: Reputation: 15
Skimming through the manuals for wpa_supplicant, wpa_supplicant.conf and wpa_cli I don't immediately see a way of actually doing it 'within' wpa_supplicant. In this case I'd just write a script that generates the appropiate settings for the next network in wpa_supplicant.conf and restarts wpa_supplicant until it's connected.
 
Old 11-15-2006, 05:16 PM   #3
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
Quote:
But if the wrong network definition is used (say, I forgot to change the .conf file when I moved to another location), the network connection will time out before wpa_supplicant has tried the correct definition.
Why would you have to change .conf files? You can list multiple networks in the same .conf file without a problem. You can also prioritize them a bit by using a priority line in each network section. Here is an example:

Code:
network={
ssid="HomeSSID"
key_mgmt=NONE
auth_alg=SHARED
group=WEP104
wep_key0=HexWEPKey
wep_tx_keyidx=0
priority=5
}
network={
ssid="AnotherSSID"
key_mgmt=NONE
auth_alg=SHARED
group=WEP40
wep_key0="WEPHexKEy"
wep_tx_keyidx=0
priority=4
}
network={
ssid="AThirdSSID"
key_mgmt=NONE
auth_alg=SHARED
group=WEP40
wep_key0=WEPHexKey
wep_tx_keyidx=0
priority=1
}
network={
ssid="WPA_NETOWRK_SSID"
scan_ssid=1
key_mgmt=WPA-PSK
pairwise=TKIP
group=TKIP
psk="WPA_Passphrase"
priority=1
}
The higher the integer on the priority line, the sooner wpa_supplicant will connect to it.
 
Old 11-17-2006, 01:51 AM   #4
warmana
LQ Newbie
 
Registered: Jul 2004
Location: United Kingdom
Distribution: Slackware
Posts: 8

Original Poster
Rep: Reputation: 0
Hangdo42: <nods> Yes, I've tried using the "priority=.." setting. The problem is that because at least two of the networks use hidden SSIDs, I can't get the driver to scan for possible networks (using the ap_scan=0 global option). I have to use ap_scan=2. The sample configuration file has a comment which says:
"Please note that AP scanning with scan_ssid=1 and ap_scan=2 mode are not
using this priority to select the order for scanning. Instead, they try the
networks in the order that used in the configuration file."
And indeed, that is exactly what does happen.
So, if I'm working in the 'second' network location, wpa_supplicant tries the 'first' location first, but dhcp time-out occurs before wpa_supplicant tries the next ('second') location. That's why I was wondering if there is any way to get wpa_supplicant to move to the next network more quickly.

marsm: Yes, that's the same conclusion I reached for now. That, and perhaps see if I can find anything in the code itself.

Thanks for all your suggestions.
 
Old 11-17-2006, 07:14 AM   #5
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
Quote:
So, if I'm working in the 'second' network location, wpa_supplicant tries the 'first' location first, but dhcp time-out occurs before wpa_supplicant tries the next ('second') location. That's why I was wondering if there is any way to get wpa_supplicant to move to the next network more quickly.
An alternative way of looking at the problem would be to get dhcpcd to run later in the process, after the configuration has happened. You could either put some insane amount of time delay between when wpa_supplicant is started and when dhcpcd is started or your could just run dhcpcd manually so you know that the wireless card is configured properly before an IP address is requested.
 
Old 11-17-2006, 08:41 AM   #6
warmana
LQ Newbie
 
Registered: Jul 2004
Location: United Kingdom
Distribution: Slackware
Posts: 8

Original Poster
Rep: Reputation: 0
Hangdog42: Good idea, I'll look at doing that. Thank you :-)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SuSE 10.1 network manager keeps prompting me for wireless SSIDs Blade2006 SUSE / openSUSE 6 08-18-2006 09:56 AM
Configuring multiple SSIDs on one Wireless Network Adaptor suchit Linux - Wireless Networking 2 01-14-2006 03:22 PM
need help with wpa_supplicant slinky2004 Linux - Software 7 12-30-2005 07:07 PM
configure wpa_supplicant for t mobile hotspot hgoldberg Linux - Wireless Networking 1 04-13-2005 06:48 AM
WPA_Supplicant Fraudulent Linux - Wireless Networking 0 10-04-2004 07:07 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 10:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration