There are multiple wireless networks available with same SSID.
I am looking for a solution to connect to a specific one (by BSSID).
nmcli con up ifname ap seems good, but, unfortunately, it's not working. It just connects back to the original network.
Best Answer
You can use
Network Manager
's cli interface,nmcli
.I'm sure you already have the
BSSID
. You can check and verify it with:(the
$
is the command prompt. The lines following the command is the output.)The cli for the connection to the
BSSID
is:That command will give you a GUI prompt for the password. You could enter the password on the commanline (may be a security concern):
The latter won't prompt for a password but will connect to the specified network by the BSSID in the command. If you were already previously connected to a different network, it will be replaced with the one specified in the command.
The command will also add the connection info to the
/etc/NetworkManager/system-connections
location. The location is protected.Subsequent connections can be made via the network icon in the notification area by the name created.