Hostapd BSSID配置 [英] Hostapd BSSID configuration
问题描述
我们有一台使用wlan1的MAC地址作为BSSID创建访问点的设备。我们正在尝试更改此默认的BSSID,并且设法以某种方式做到了这一点,但是似乎我们的更改并未影响客户端对网络的BSSID。
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.
问题是如何正确配置hostapd以使用我们希望它具有的BSSID运行访问点。
The question is how to properly configure hostapd to run the access point with the BSSID we want it to have.
我们可以看到我们的配置对我们希望拥有它的所有3个地方都有影响。
We can see that our configuration has an effect on all the 3 places where we expect it to have it.
# 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
运行/ usr / sbin / hostapd /etc/hostapd_wlan1.conf
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
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
/sys/class/net/wlan1/address
02:03:7f:d7:00:04
在客户端
服务器公开了错误的BSSID,因此协商失败。
On the client side
The server is exposing the wrong BSSID and therefore the negotiation fails.
我们可以看到服务器从正确的地址发送邮件,但是客户端响应了错误的地址。
We can see that the server sends from the proper address, but the client responds to the wrong one.
推荐答案
最后,这是我们使用的硬件软件的组合造成了问题。我们正在运行在Digi cc6ul模块中与Digi Embedded Yocto 2.0一起烘焙的Yocto Linux映像。这些模块带有一个U引导,该引导具有3个用于虚拟接口MAC地址的变量: wlan1adrr
, wlan2adrr
和 wlan3adrr
。事实证明,在cc6ul上, wlan1adrr
变量用于为 p2p0
接口提供一个MAC。用于向 wlan1
接口提供MAC地址的是 wlan2addr
。最重要的是,用于BSSID的hostapd用户配置不会覆盖广播的BSSID,它直接是 wlan2adrr
值。解决方案是只需更改 wlan2addr
U-Boot变量,然后重新启动后一切正常!
Finally, it was the combination of hardware software we are using that was causing the problem. We are running a Yocto Linux image baked with Digi Embedded Yocto 2.0 in a Digi cc6ul module. These modules come with a U-Boot that has 3 variables for virtual interface MAC addresses: wlan1adrr
, wlan2adrr
and wlan3adrr
. Turns out that on the cc6ul, the wlan1adrr
variable is used to give a MAC to the p2p0
interface, where the one used to give a MAC to the wlan1
interface is wlan2addr
. On top of that, the hostapd user configuration for the BSSID does not override the BSSID that is broadcast, which is directly the wlan2adrr
value. The solution is the just change the wlan2addr
U-Boot variable, then after reboot everything works!
这篇关于Hostapd BSSID配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!