wpa_supplicant 和 hostapd 有问题。救命!

wpa_supplicant 和 hostapd 有问题。救命!

我正在尝试共享我的无线网络(wlan0),并按照本教程操作:https://linuxalfi.wordpress.com/2011/11/08/connectify-for-linux-with-single-wireless-interface/

问题是:如果启动了 hostapd,我将无法使用 wpa_supplicant 连接到我的网络。另一方面,如果我连接到网络,我无法启动 hostapd。这两个 hostapd 和 wpa_supplicant 不能一起启动。

当我尝试启动 hostapd 时出现以下错误: root@me:~# hostapd /etc/hostapd.conf Configuration file: /etc/hostapd.conf Using interface new1 with hwaddr 84:4b:f5:4c:89:ab and ssid "Linux-Hotspot" Failed to set beacon parameters new1: Unable to setup interface.

如果启动了 hostapd,则使用 wpa_supplicant 时会产生以下错误: Successfully initialized wpa_supplicant new0: CTRL-EVENT-SCAN-STARTED new0: SME: Trying to authenticate with ac:86:74:26:54:72 (SSID='Ktx My Dinh' freq=2432 MHz) new0: SME: Authentication request to the driver failed new0: CTRL-EVENT-SCAN-STARTED

这是iw list

root@me:~$ sudo iw list Wiphy phy0 max # scan SSIDs: 4 max scan IEs length: 2257 bytes Retry short limit: 7 Retry long limit: 4 Coverage class: 0 (up to 0m) Device supports RSN-IBSS. Device supports AP-side u-APSD. Device supports T-DLS. Supported Ciphers: * WEP40 (00-0f-ac:1) * WEP104 (00-0f-ac:5) * TKIP (00-0f-ac:2) * CCMP (00-0f-ac:4) * CMAC (00-0f-ac:6) Available Antennas: TX 0x1 RX 0x3 Configured Antennas: TX 0x1 RX 0x3 Supported interface modes: * IBSS * managed * AP * AP/VLAN * WDS * monitor * mesh point * P2P-client * P2P-GO

我该怎么做才能解决这些问题?提前致谢。

答案1

检查 iw 列表输出的底部是否有类似这样的内容:

valid interface combinations:
     * #{ managed } <= 1, #{ P2P-device } <= 1, #{ P2P-client, P2P-GO } <= 1,
       total <= 3, #channels <= 2
     * #{ managed } <= 1, #{ AP } <= 1, #{ P2P-client } <= 1, #{ P2P-device } <= 1,
       total <= 4, #channels <= 1

(这是我的 Raspberry Pi 3 对 wlan0 显示的。)请注意,该设备仅支持两个(托管和 AP)接口之间的单个通道。

尝试更改您的 hostapd.conf,以便指定的频道与您尝试加入的网络的频道相匹配。

相关内容