Estou tentando definir um AP em um Raspberry Pi 3 usando uma placa WiFi USB externa e hostapd e dsnmasq. Consegui consegui-lo usando a placa WiFi interna, mas quando tento mudar para o meu externo, recebi o seguinte erro:
$ 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
Eu acredito que é porque por padrão o hostapd está usando o driver nl80211
. Esta é a saída de lsusb
- Bus 001 Device 004: ID 148f:3072 Ralink Technology, Corp. RT3072 Wireless Adapter
. E esta é a saída de 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
Parece que este cartão está usando o driver rt2080usb
, mas quando tento colocá-lo dentro do hostapd.conf
e inicio manualmente o hostapd
, recebi o seguinte erro:
$ 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
E este é o meu arquivo 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]
[EDIT] Esta é a saída do comando 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
E esta é a saída do comando iw list
:
valid interface combinations:
* #{ AP, mesh point } <= 8,
total <= 8, #channels <= 1
[EDIT 2] Esta é a saída quando eu inicio o '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
E esta é a saída de 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
E este é o hostapd
log quando tento conectar-me ao meu essi WiPi e executar o teste de velocidade:
$ 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
[EDIT 3]: Eu executei o hostapd
no modo de depuração sudo hostapd -dd -P /run/hostapd.pid -B -f /tmp/hostapd.log /etc/hostapd/hostapd.conf
definido como ativado e enviei o arquivo de registro para pastebin