0

I call

    wpa_supplicant -c"$CONF" -i"$IFACE" -B

where $CONF is a file with many network={} definitions. wpa_supplicant does connect to any one of those in range.

How can I query with which AP is my laptop associated?

I tried adding -dd and parsing the output. What I found is:

Priority group 1
   id=3 ssid='UP-Campus'
Priority group 0
   id=0 ssid='Sauron'
   id=1 ssid='futurenet'

Can I rely on this, that wpa_supplicant fill surely connect to 'UP-Campus'.

And another question, does wpa_supplicant reconnect? If I walk out of the range of one of the cells in the config file and walk into the range of another, will it reconnect?

1
  • 2
    Have a look at wpa_cli. The man page is outdated, wpa_cli help will list all commands. Yes, wpa_supplicant will reconnect if configured properly. Yes, it will respect priorities. It will also connect to lower priorities if higher priorities are not available...
    – dirkt
    Jul 10, 2018 at 12:35

1 Answer 1

2

Here are a few ways on the command line to query for the AP you are connected to (Change wlan0 to the name of your wireless Interface):

1)

iw wlan0 link

2)

iwconfig wlan0

3)

wpa_cli -i wlan0 STATUS    

Regarding your other questions, I can confirm from my experience what @dirkt has written in his comment:
First connection:
The first Connection will always be to the Access Point with the highest priority at the Moment.
Connection lost:
Once this connection is lost, it will connect to the one AP that has the highest priority of the remaining available ones.
Already connected, but new AP with higher priority available:
When a new AP becomes available with higher priority than the one you are currently connected to, it will switch the connection to the one with the higher priority within a few seconds.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .