We have a device that creates an access point using the MAC address of wlan1 as the BSSID. We are trying to change this default BSSID, and we somehow manage to do it, but it seems our changes don't take an effect on what the clients see as BSSID for the network.
The question is how to properly configure hostapd to run the access point with the BSSID we want it to have.
On the server side
We can see that our configuration has an effect on all the 3 places where we expect it to have it.
hostapd configuration file
# ctrl_interface=/var/run/hostapd
ctrl_interface_group=0
interface=wlan1
driver=nl80211
country_code=DK
# WPA2-AES encryption
ssid=ap-wlan1-ccee
bssid=02:03:7f:d7:00:04
auth_algs=1
wpa=2
wpa_key_mgmt=WPA-PSK
wpa_pairwise=CCMP
wpa_passphrase=password-wpa2aes
max_num_sta=5
# IEEE 802.11ac
hw_mode=g
channel=7
ieee80211ac=1
ieee80211n=1
logger_stdout=-1
logger_stdout_level=2
hostapd output running /usr/sbin/hostapd /etc/hostapd_wlan1.conf
Configuration file: /etc/hostapd_wlan1.conf
wlan1: interface state UNINITIALIZED->COUNTRY_UPDATE
Using interface wlan1 with hwaddr 02:03:7f:d7:00:04 and ssid "ap-wlan1-ccee"
wlan1: interface state COUNTRY_UPDATE->ENABLED
wlan1: AP-ENABLED
ifconfig wlan1
wlan1 Link encap:Ethernet HWaddr 02:03:7F:D7:00:04
inet addr:192.168.46.30 Bcast:192.168.46.255 Mask:255.255.255.0
inet6 addr: fe80::3:7fff:fed7:4%2126838504/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:14 errors:0 dropped:0 overruns:0 frame:0
TX packets:63 errors:0 dropped:15 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1890 (1.8 KiB) TX bytes:5588 (5.4 KiB)
/sys/class/net/wlan1/address
02:03:7f:d7:00:04
On the client side
The server is exposing the wrong BSSID and therefore the negotiation fails.
WirelessNetView result
Wireshark result
We can see that the server sends from the proper address, but the client responds to the wrong one.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…