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 list 輸出的底部是否有類似這樣的內容:

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,以便指定的通道與您嘗試加入的網路的通道相符。

相關內容