外部WiFiカード付きRaspberry Pi 3のHostapd

外部WiFiカード付きRaspberry Pi 3のHostapd

Hostapdとdsnmasqで外部USB WiFiカードを使用してRaspberry Pi 3にAPを設定しようとしています。内部WiFiカードを使用してこれを正常に実行しましたが、外部WiFiカードに切り替えようとすると、次のエラーが発生します。

$ sudo /usr/sbin/hostapd /etc/hostapd/hostapd.conf
Configuration file: /etc/hostapd/hostapd.conf
nl80211: Could not configure driver mode
nl80211: deinit ifname=wlan1 disabled_11b_rates=0
nl80211 driver initialization failed.
wlan1: interface state UNINITIALIZED->DISABLED
wlan1: AP-DISABLED 
hostapd_free_hapd_data: Interface wlan1 wasn't started

私はこれがHostapdがデフォルトでnl80211ドライバを使用するためだと思います。lsusb- の出力ですBus 001 Device 004: ID 148f:3072 Ralink Technology, Corp. RT3072 Wireless Adapter。これはの出力ですlshw

  *-network:1
       description: Wireless interface
       physical id: 3
       bus info: usb@1:1.4
       logical name: wlan1
       serial: 98:3f:9f:24:a2:00
       capabilities: ethernet physical wireless
       configuration: broadcast=yes driver=rt2800usb driverversion=4.14.71-v7+ firmware=0.36 ip=10.100.100.254 link=no m
ulticast=yes wireless=IEEE 802.11

明らかに、このカードはrt2080usbドライバを使用していますが、ドライバを挿入してhostapd.conf手動で起動しようとすると、hostapd次のエラーが発生します。

$ sudo /usr/sbin/hostapd /etc/hostapd/hostapd.conf
Configuration file: /etc/hostapd/hostapd.conf
Line 3: invalid/unknown driver 'rt2080usb'
1 errors found in configuration file '/etc/hostapd/hostapd.conf'
Failed to set up interface with /etc/hostapd/hostapd.conf
Failed to initialize interface

これは私のhostapd.confファイルです:

interface=wlan1
ssid=WiPi
driver=rt2080usb
hw_mode=g
ieee80211n=1
wmm_enabled=1
channel=4
macaddr_acl=0
auth_algs=3
ignore_broadcast_ssid=0
wpa=3
wpa_passphrase=wifipasswordhere
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
ht_capab=[HT20][SHORT-GI-20]

[編集]これはコマンドの出力ですiwconfig

wlan1     IEEE 802.11  ESSID:off/any  
          Mode:Managed  Access Point: Not-Associated   Tx-Power=20 dBm   
          Retry short  long limit:2   RTS thr:off   Fragment thr:off
          Power Management:off

wlan0     IEEE 802.11  ESSID:off/any  
          Mode:Managed  Access Point: Not-Associated   Tx-Power=31 dBm   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:on

以下はコマンドの出力ですiw list

valid interface combinations:
         * #{ AP, mesh point } <= 8,
           total <= 8, #channels <= 1

[編集2] これは"hostapd"を起動したときの出力です。

$ sudo /usr/sbin/hostapd /etc/hostapd/hostapd.conf 
Configuration file: /etc/hostapd/hostapd.conf
Using interface wlan1 with hwaddr 98:3f:9f:24:a2:00 and ssid "WiPi"
random: Only 16/20 bytes of strong random data available from /dev/random
random: Not enough entropy pool available for secure operations
WPA: Not enough entropy in random pool for secure operations - update keys later when the first station connects
wlan1: interface state UNINITIALIZED->ENABLED
wlan1: AP-ENABLED 

出力は次のとおりですiwconfig

wlan1     IEEE 802.11  Mode:Master  Tx-Power=20 dBm   
          Retry short  long limit:2   RTS thr:off   Fragment thr:off
          Power Management:off

hostapd私のessid WiPiに接続して速度テストを実行しようとしたときのログは次のとおりです。

$ Configuration file: /etc/hostapd/hostapd.conf
Using interface wlan1 with hwaddr 98:3f:9f:24:a2:00 and ssid "WiPi"
wlan1: interface state UNINITIALIZED->ENABLED
wlan1: AP-ENABLED 
wlan1: STA 94:65:2d:d4:e0:5b IEEE 802.11: authenticated
wlan1: STA 94:65:2d:d4:e0:5b IEEE 802.11: associated (aid 1)
wlan1: AP-STA-CONNECTED 94:65:2d:d4:e0:5b
wlan1: STA 94:65:2d:d4:e0:5b RADIUS: starting accounting session 5BEC735C-00000000
wlan1: STA 94:65:2d:d4:e0:5b WPA: pairwise key handshake completed (RSN)
wlan1: AP-STA-DISCONNECTED 94:65:2d:d4:e0:5b
Failed to set beacon parameters
wlan1: INTERFACE-DISABLED 
wlan1: INTERFACE-ENABLED 
Failed to set beacon parameters
wlan1: INTERFACE-DISABLED 
wlan1: INTERFACE-ENABLED 
Failed to set beacon parameters
handle_probe_req: send failed

[編集3]:hostapdデバッグモードの実行をオンsudo hostapd -dd -P /run/hostapd.pid -B -f /tmp/hostapd.log /etc/hostapd/hostapd.confに設定し、ログファイルをアップロードしました。ペーストビン

ベストアンサー1

これは役に立ちます: https://www.ibm.com/developerworks/library/l-wifiencrypthostapd/index.html

https://wiki.gentoo.org/wiki/Hostapd

auth_algs=1 #wpaに制限

wpa=1 #wpaに制限

また:ieee80211n=1 および hw_mode=g 設定が指定されています。 ieee80211n=0 を設定するか、適切なオプションを削除して役に立つかどうかを確認してください。

内部カードをまったく使用しない場合は、内部カードをブラックリストに追加してから、外部カードをHostapdと連携するように設定するか、GUIがインストールされている場合はConnection Managerでsetup apオプションを使用して共有します。有線接続。上記のいずれかのオプションを試している場合は、変更したすべてのファイル(hostapdを制御するファイルを除く)が元のファイルに戻ることを確認してください。

おすすめ記事