atk9k no puede configurar el dispositivo virtual en ap + cliente con wpa_supplicant

atk9k no puede configurar el dispositivo virtual en ap + cliente con wpa_supplicant

Estoy intentando usar un beagle bone black con ubuntu 14.04 que actúa como punto de acceso y cliente inalámbrico al mismo tiempo. El objetivo es usar el punto de acceso para permitir que un cliente se conecte, abra una página a través de un servidor httpd y luego configurar/conectar a una señal inalámbrica local

el wifi usa el chipset Atheros AR9271 que usa el controlador ath9k_htc. Me pregunto si esto es específico de este chipset versus un chipset estándar compatible con ath9k o me estoy perdiendo lo obvio y esquivo.

Puedo hacer que el punto de acceso funcione usando un dispositivo virtual

iw phy phy0 interface add wap0 type __ap
ifconfig wap0 hw ether 0a:35:9f:fe:44:01  # or any fake HW address
ifconfig wap0 192.168.8.1 netmask 255.255.255.0
ifconfig wap0 192.168.8.1 up

con entrada /etc/network/interfaces

auto wap0
iface wap0 inet static
    hostapd /etc/hostapd/hostapd.conf
    address 192.168.8.1
    netmask 255.255.255.0

y entrada /etc/hostapd/hostapd.conf al mínimo

interface=wap0
driver=nl80211
ssid=BeagleBoneBlack
channel=1

y /etc/dnsmasq.conf como mínimo con

interface=lo,wap0
listen-address=127.0.0.1
no-dhcp-interface=lo
dhcp-range=192.168.8.10,192.168.8.50,255.255.255.0,12h
cache-size=0

Puedo hacer que un cliente se conecte de forma inalámbrica, usando una variedad de herramientas (nmcli/wicd/iw/...). Luego puedo conectarme a otro enrutador usandowlan0

si el cifrado está deshabilitado

cuando intento conectarme a otro enrutador con wpa1/2la opción habilitada, empiezo a obtener resultados extraños con cualquier cliente y múltiples versiones de kernel/controlador (compatible con 3.8.x a través de backports 3.19.x)

todo, desde ejecutar wpa_supplicantdirectamente

wpa_passphrase "NETWORK_SSID" "WPA_PASS_PHRASE" > /etc/wpa_supplicant.conf
wpa_supplicant -i wlan0 -Dwext -Dn180211 -c/etc/wpa_supplicant.conf

salida (repetida unas cuantas docenas de veces en varios orden)

Successfully initialized wpa_supplicant
wlan0: CTRL-EVENT-SCAN-STARTED 
wlan0: SME: Trying to authenticate with 04:a1:51:33:f3:64 (SSID='NETWORK_SSID' freq=2462 MHz)
wlan0: SME: Authentication request to the driver failed

al ejecutar wpa_supplicant antes de inicializar el dispositivo virtualwap0

# wpa_supplicant -i wlan0 -Dwext -Dn180211 -c/etc/wpa_supplicant.conf

Successfully initialized wpa_supplicant
wlan0: CTRL-EVENT-SCAN-STARTED 
wlan0: SME: Trying to authenticate with 98:fc:11:b7:48:a0 (SSID='mycomountain' freq=2437 MHz)
wlan0: Trying to associate with 98:fc:11:b7:48:a0 (SSID='NETWORK_SSID' freq=2437 MHz)
wlan0: Associated with 98:fc:11:b7:48:a0
wlan0: WPA: Key negotiation completed with 98:fc:11:b7:48:a0 [PTK=CCMP GTK=TKIP]
wlan0: CTRL-EVENT-CONNECTED - Connection to 98:fc:11:b7:48:a0 completed [id=0 id_str=]

para usar /etc/network/interfaces configurado en

auto wlan0
iface wlan0 inet dhcp
    wpa-ssid "NETWORK_SSID"
    wpa-psk "WPA_PASS_PHRASE"

y corriendo

ifdown wlan0; ifup wlan0;

producción

Internet Systems Consortium DHCP Client 4.2.4
Copyright 2004-2012 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/wlan0/e8:de:27:1f:6e:60
Sending on   LPF/wlan0/e8:de:27:1f:6e:60
Sending on   Socket/fallback
Internet Systems Consortium DHCP Client 4.2.4
Copyright 2004-2012 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/wlan0/e8:de:27:1f:6e:60
Sending on   LPF/wlan0/e8:de:27:1f:6e:60
Sending on   Socket/fallback
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 3 (xid=0x39ec90a3)
# ...
No DHCPOFFERS received.
No working leases in persistent database - sleeping.

la línea DHCPDISCOVER luego se repite con varios valores de intervalo hasta que falla

wicd simplemente no hace nada cuando hostapd se ejecuta en wap0

Ciertamente me estoy saltando un par de pasos que he probado hasta ahora, la mejor referencia que sugiere que lo que estoy haciendo debería funcionar (puedo publicar una docena más con piezas que me han llevado hasta aquí si son útiles para alguien).

Creación de un punto de acceso WiFi en una única interfaz en Linux

** EDITAR **

Intenté cambiar el canal hostaptd para que coincida con el canal del enrutador al que estoy intentando conectarme; todavía no me conecto, pero empiezo a hacer que wicd haga algo cuando hostapd se está ejecutando.

control wicd a través de python con dbus (probablemente irrelevante, pero espero que este hilo ayude a alguien más una vez que se encuentre una solución)

import dbus

bus = dbus.SystemBus()
wireless = dbus.Interface(bus.get_object('org.wicd.daemon', '/org/wicd/daemon/wireless'),
                          'org.wicd.daemon.wireless')
network_id = 0
wireless.ConnectWireless(network_id)

Salida del registro Wicd

2015/04/20 16:47:30 :: Putting interface down
2015/04/20 16:47:30 :: Releasing DHCP leases...
2015/04/20 16:47:30 :: attempting to set hostname with dhclient
2015/04/20 16:47:30 :: using dhcpcd or another supported client may work better
2015/04/20 16:47:31 :: Setting false IP...
2015/04/20 16:47:31 :: Stopping wpa_supplicant
2015/04/20 16:47:31 :: Flushing the routing table...
2015/04/20 16:47:31 :: Putting interface up...
2015/04/20 16:47:33 :: Attempting to authenticate...
2015/04/20 16:48:09 :: wpa_supplicant authentication may have failed.
2015/04/20 16:48:09 :: connect result is 
2015/04/20 16:48:09 :: exiting connection thread
2015/04/20 16:48:10 :: Sending connection attempt result bad_pass
2015/04/20 16:48:10 :: Autoconnecting...
2015/04/20 16:48:10 :: No wired connection present, attempting to autoconnect to wireless network
2015/04/20 16:48:13 :: Unable to autoconnect, you'll have to manually connect
2015/04/20 16:48:13 :: attempting to set hostname with dhclient
2015/04/20 16:48:13 :: using dhcpcd or another supported client may work better
2015/04/20 16:48:13 :: attempting to set hostname with dhclient
2015/04/20 16:48:13 :: using dhcpcd or another supported client may work better

Salida wicd - hostapd detenido

2015/04/20 16:58:58 :: Putting interface down
2015/04/20 16:58:58 :: Releasing DHCP leases...
2015/04/20 16:58:58 :: attempting to set hostname with dhclient
2015/04/20 16:58:58 :: using dhcpcd or another supported client may work better
2015/04/20 16:58:58 :: Setting false IP...
2015/04/20 16:58:58 :: Stopping wpa_supplicant
2015/04/20 16:58:58 :: Flushing the routing table...
2015/04/20 16:58:58 :: Putting interface up...
2015/04/20 16:59:00 :: Attempting to authenticate...
2015/04/20 16:59:02 :: Running DHCP with hostname HOSTNAME
2015/04/20 16:59:02 :: attempting to set hostname with dhclient
2015/04/20 16:59:02 :: using dhcpcd or another supported client may work better
2015/04/20 16:59:02 :: Internet Systems Consortium DHCP Client 4.2.4
2015/04/20 16:59:02 :: Copyright 2004-2012 Internet Systems Consortium.
2015/04/20 16:59:02 :: All rights reserved.
2015/04/20 16:59:02 :: For info, please visit https://www.isc.org/software/dhcp/
2015/04/20 16:59:02 :: 
2015/04/20 16:59:02 :: Listening on LPF/wlan0/64:70:02:20:08:35
2015/04/20 16:59:02 :: Sending on   LPF/wlan0/64:70:02:20:08:35
2015/04/20 16:59:02 :: Sending on   Socket/fallback
2015/04/20 16:59:02 :: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 3 (xid=0x136a5e8e)
2015/04/20 16:59:02 :: DHCPREQUEST of 192.168.0.15 on wlan0 to 255.255.255.255 port 67 (xid=0x136a5e8e)
2015/04/20 16:59:02 :: DHCPOFFER of 192.168.0.15 from 192.168.0.1
2015/04/20 16:59:02 :: DHCPACK of 192.168.0.15 from 192.168.0.1
2015/04/20 16:59:02 :: bound to 192.168.0.15 -- renewal in 42862 seconds.
2015/04/20 16:59:02 :: DHCP connection successful
2015/04/20 16:59:02 :: not verifying
2015/04/20 16:59:03 :: Connecting thread exiting.
2015/04/20 16:59:03 :: Sending connection attempt result success

Respuesta1

No estoy seguro de qué hardware tiene, pero si está utilizando una memoria USB para Wifi (como TP-Links TL-WN722N), no puede configurar el canal del modo AP sin piratear el firmware. Esta es una tarea nada trivial que requiere compilar un montón de fuentes de Linux, etc. Además, el firmware predeterminado parece ser para un país donde los canales 12 y 13 no están disponibles.

información relacionada