wpa_supplicant

Hello!

I have defined a few networks in my wpa_supplicant.conf. My problem is that my laptop keeps preferring a "guest" network in the office. So it's quite random whether I have a network connection in meetings. I need to way to block that particular network, or to force wpa_supplicant to use only networks that are defined in my wpa_supplicant.conf.

Any ideas?
 
You might be able to indicate your preferred networks via the priority parameter in network configuration blocks of /etc/wpa_supplicant.conf. To quote wpa_supplicant.conf(5):
Code:
     priority
	     The priority of a network when selecting among multiple networks;
	     a higher value means a network is more desirable.	By default
	     networks have priority 0.	When multiple networks with the same
	     priority are considered for selection, other information such as
	     security policy and signal strength are used to select one.
 
Yes, I tried setting it with priority 0 whereas the other networks have priority 5. The "guest" network still gets picked 80% of the time. I suppose the signal strength is better.
 
Now I am in an area with ~20 networks. Since wpa_supplicant picks at random, there is a 5% chance that I will connect to the right network.
 
Would it be possible to block the MAC-address of the access points I don't want to connect to using pf, as a last resort, just to get it working?
 
After running wpa_supplicant with -d, I discovered that I had a network block that was defined with psk="". Apparently wpa_supplicant considers this an error, so it silently skips the rest of the file.

It works now. Thank you for the help!
 
wblock@ said:
That sounds like a bug to me.
I'm not sure. According to wpa_supplicant.conf(5):
Code:
     [u]psk[/u]     WPA preshared key used in WPA-PSK mode. The key is specified as
             64 hex digits or as an 8-63 character ASCII passphrase.
Apparently, if an empty key is needed this has to be specified differently. If I remember correctly, it's
Code:
key_mgmt=NONE
I'm not entirely certain, but I suspect that rejecting
Code:
psk=""
might actually be correct behaviour.
 
This is definitely an error:
Code:
psk=""

From /usr/share/examples/etc/wpa_supplicant.conf:
Code:
 psk: WPA preshared key; 256-bit pre-shared key
# The key used in WPA-PSK mode can be entered either as 64 hex-digits, i.e.,
# 32 bytes or as an ASCII passphrase (in which case, the real PSK will be
# generated using the passphrase and SSID). ASCII passphrase must be between
# 8 and 63 characters (inclusive).
 
If it rejects an invalid PSK silently and then ignores the rest of the file, that's a bug. It should at least complain about invalid options (pretty sure it does) and either report that it stopped or not stop.
 
Back
Top