Solved wpa_supplicant file with three wifi connections

Hi
I used to connect my FreeBSD to different wifi connections (one in my office and two in my home). For this reason, I have created /etc/wpa_supplicant.conf and put following settings in it:
Code:
network={
    ssid="MS Dept WIFI"
    psk="office_pass"
    priority=0
}

network={
    ssid="Home1"
    psk="home1_pass"
    priority=1
}

network={
    ssid="Home2"
    psk="home2_pass"
    priority=2  ## preferred home wifi
}
Although, my FreeBSD manage to connect all three WIFIs, but is this the correct (or preferred) way to create this file? Kindly give your thoughts (and suggestions)?
Regards
 
but is this the correct (or preferred) way to create this file?
Yes.
Code:
     The configuration file consists of optional global parameter settings and
     one or more network blocks, e.g. one for each used SSID.  The
     wpa_supplicant(8) utility will automatically select the best network
     based on the order of the network blocks in the configuration file,
     network security level (WPA/WPA2 is preferred), and signal strength.
     Comments are indicated with the `#' character; all text to the end of the
     line will be ignored.
From wpa_supplicant.conf(5).
 
I have created my wpa_supplicant.conf as follows. As you can see that Home2 has highest priority, but when I boot my system, FreeBSD is connecting to Home1:
Code:
network={
    ssid="Home1"
    psk="home1_pass"
    priority=1
}

network={
    ssid="Home2"
    psk="home2_pass"
    priority=2  ## preferred home wifi
}

network={
    ssid="MS Dept WIFI"
    psk="office_pass"
    priority=0
}
Why it is happening here? Is it due to order of networks in the file? and how can I fix it?
Thanks
 
Back
Top