You might have a case where you have multiple APs broadcasting the same SSID, and you want to ensure that you connect to a specific one. DD-WRT uses wpa_supplicant, which allows us to configure out-of-band. Note that DD-WRT advertises a similar feature in the UI (by using MAC filters), but I have not been able to get it to work reliably.
In Administration -> Commands , save the following as a startup script (don’t forget to change the BSSID!).
until pidof "wpa_supplicant"; do
echo "waiting for wpa_supplicant to start..."
sed -i "3ibssid=$bssid" /tmp/ath0_wpa_supplicant.conf
kill -HUP $(pidof "wpa_supplicant")