When multiple access points (APs) share the same SSID, your device may struggle to connect to the desired one. Here’s how to connect to a specific AP:
- Identify the AP by BSSID: Each AP has a unique BSSID (MAC address).
- Manually Select the AP:
- Windows:
- Open Command Prompt and use netsh wlan show networks mode=bssid to view available networks and their BSSIDs.
netsh wlan export profile name="SSID_NAME" folder="C:\Path\To\Folder" key=clear
- Connect to a specific AP by creating a Wi-Fi profile with the BSSID. Create an XML file (e.g., wifi-profile.xml) with: xmlCopy
<?xml version="1.0"?> <WLANProfile xmlns="http://www.microsoft.com/networking/WLAN/profile/v1"> <name>SSID_NAME</name> <SSIDConfig> <SSID> <name>SSID_NAME</name> </SSID> </SSIDConfig> <connectionType>ESS</connectionType> <connectionMode>auto</connectionMode> <MSM> <security> <authEncryption> <authentication>WPA2PSK</authentication> <encryption>AES</encryption> <useOneX>false</useOneX> </authEncryption> <sharedKey> <keyType>passPhrase</keyType> <protected>false</protected> <keyMaterial>YOUR_PASSWORD</keyMaterial> </sharedKey> </security> </MSM> <MacFilter> <BSSIDList> <BSSID>XX:XX:XX:XX:XX:XX</BSSID> </BSSIDList> </MacFilter> </WLANProfile>
Replace SSID_NAME with the SSID, YOUR_PASSWORD with the Wi-Fi password, and XX:XX:XX:XX:XX:XX with the desired AP’s BSSID. Then, apply it using: cmdCopynetsh wlan add profile filename="wifi-profile.xml" netsh wlan connect name="SSID_NAME"
- macOS:
- Use the airport command-line tool. First, access it via: bashCopy
sudo /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -s
This lists APs with BSSIDs. To connect to a specific BSSID: bashCopysudo /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport en0 associate --ssid=SSID_NAME --password=YOUR_PASSWORD --bssid=XX:XX:XX:XX:XX:XX
Replace en0 with your Wi-Fi interface (check with networksetup -listallhardwareports).
- Use the airport command-line tool. First, access it via: bashCopy
- Linux:
- Use nmcli or iwconfig. Scan for networks: bashCopy
nmcli dev wifi list
Connect to a specific BSSID: bashCopynmcli con up id SSID_NAME --ap XX:XX:XX:XX:XX:XX
If not already added, add the connection: bashCopynmcli con add type wifi con-name SSID_NAME ssid SSID_NAME wifi.bssid XX:XX:XX:XX:XX:XX wifi-sec.key-mgmt wpa-psk wifi-sec.psk YOUR_PASSWORD
- Use nmcli or iwconfig. Scan for networks: bashCopy
- Windows: