I have special demands and need to manually control which Wi-Fi access point I connect to on my Linux machine. The machine is a Raspberry Pi running Raspbian (Debian) but I don't think the hardware platform really matters in the contexts of this question.
Now I am using
wpa_supplicant as my wireless network manager and it auto connects my machine to some AP with its own logic. In
/etc/network/interfaces I have
allow-hotplug wlan0 iface wlan0 inet manual wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf iface default inet dhcp
/etc/wpa_supplicant/wpa_supplicant.conf I have just a few pre-configured APs and their PSK.
I have done some brief search already.
sudo iwconfig wlan0 essid <SSID> key s:<PSK> did NOT work for me. It did disconnect
wlan0 from the old AP for a few seconds but soon
wlan0 got connected to the old one again. I am wondering if I have made some mistake when executing this, or if
wpa_supplicant conflicts with manual configuration.
Is it possible that either of these can be realized:
- It connects to APs identified in
wpa_supplicantautomatically, but I can manually change the one it connects to as long as the new one is in range?
- I control if it connects to APs identified in
wpa_supplicantautomatically. When I don't want it to, I am able to make it connect to any AP in range.