Connect wlan interface to specific BSSID without knowledge about SSID

3

I do know the BSSID and passphrase of my wireless router and I want to connect my wireless interface to it without caring about the SSID. Thus, I do want it to work even after the SSID of the wireless router has been modified.

What I have tried to achieve this is to alter my /etc/network/interfaces:

iface wlan0 inet dhcp
        #wpa-ssid "MySSID" # old line
        wpa-bssid 01:23:45:67:89:ab # new line
        wpa-psk  "MYPASSWORD"

But using this configuration the system stays offline. I think the ssid is mandatory for wpa_supplicant but I don't understand why. Is there any technical reason? How to bypass this?

Jens Wirth

Posted 2016-05-11T18:56:20.277

Reputation: 151

By the way, "01:23:45:67:89:ab" is a bad example MAC address, because setting the one's-place bit in the first octet means it's a multicast address. BSSIDs are always unicast addresses. I've seen people try to use this address on their wireless interface and then they wondered by everything broke. :-) – Spiff – 2016-05-14T04:52:18.863

Answers

2

It works when exactly the same information, bssid and psk, is provided via the configuration file to wpa_supplicant instead of /etc/network/interfaces:

/etc/network/interfaces:

iface wlan0 inet dhcp
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

/etc/wpa_supplicant/wpa_supplicant.conf:

network={
  bssid=01:23:45:67:89:ab
  psk="MYPASSWORD"
}

I also tested changing the ssid of the wireless router and keeping the psk unchanged, works well.

Jens Wirth

Posted 2016-05-11T18:56:20.277

Reputation: 151

2

If you're using WPA-PSK or WPA2-PSK with a passphrase, the passphrase is mixed with the SSID and run through a function called PBKDF2 to generate the actual PSK.

So unless you're passing the raw PSK (64 hexadecimal digits) to your software, it can't derive the PSK unless it knows the SSID.

I suppose if your software has the smarts to look up the SSID associated with a given BSSID, and then use that SSID with he supplied passphrase to feed into PBKDF2 to create the PSK, then it could get on the network with just a BSSID and passphrase.

Spiff

Posted 2016-05-11T18:56:20.277

Reputation: 84 656