atk9k は wpa_supplicant を使用して ap + クライアントに仮想デバイスをセットアップできません

atk9k は wpa_supplicant を使用して ap + クライアントに仮想デバイスをセットアップできません

私は、Ubuntu 14.04 を実行している Beagle Bone Black をアクセス ポイントとワイヤレス クライアントとして同時に使用しようとしています。目標は、アクセス ポイントを使用してクライアントが接続し、httpd サーバーを介してページを開き、ローカル ワイヤレス信号を構成/接続できるようにすることです。

Wi-Fi は、ath9k_htc ドライバーを使用する Atheros AR9271 チップセットを使用しています。これは、このチップセットに固有のものか、標準の ath9k 対応チップセットに固有のものか、それとも私がわかりにくい明白なことを見逃しているのか疑問に思っています。

仮想デバイスを使用してアクセスポイントを動作させることができます

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

/etc/network/interfacesエントリ

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

/etc/hostapd/hostapd.confのエントリを最小限にする

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

および/etc/dnsmasq.confに少なくとも

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

さまざまなツール(nmcli / wicd / iw / ...)を使用してクライアントをワイヤレスで接続できます。その後、別のルーターに接続できます。wlan0

暗号化が無効になっている場合

有効になっている別のルーターに接続しようとするとwpa1/2、どのクライアントでも複数のカーネル/ドライバー バージョン (compat 3.8.x から backports 3.19.x) でも奇妙な結果が出始めます。

wpa_supplicant直接実行することからすべて

wpa_passphrase "NETWORK_SSID" "WPA_PASS_PHRASE" > /etc/wpa_supplicant.conf
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 04:a1:51:33:f3:64 (SSID='NETWORK_SSID' freq=2462 MHz)
wlan0: SME: Authentication request to the driver failed

仮想デバイスを初期化する前にwpa_supplicantを実行する場合wap0

# 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=]

/etc/network/interfacesを次のように設定して使用する

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

ランニング

ifdown wlan0; ifup wlan0;

出力

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.

DHCPDISCOVER行は、失敗するまでさまざまな間隔値で繰り返されます。

hostapd が wap0 上で実行されている場合、wicd は何も実行できません。

これまで試したいくつかの手順を省略していますが、私が行っていることがうまくいくことを示唆する最良の参考資料です (誰かの役に立つなら、ここまでに至った部分を 12 個以上投稿できます)

Linux で単一のインターフェース上に WiFi アクセス ポイントを作成する

** 編集 **

接続しようとしているルーターのチャンネルと一致するようにhostaptdチャンネルを変更してみましたが、まだ接続できませんが、hostapdの実行中にwicdが何かを実行し始めています。

dbus を使用した python による wicd 制御 (おそらく無関係ですが、解決策が見つかったらこのスレッドが他の誰かの役に立つことを願っています)

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)

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

出力 wicd -- hostapd が停止しました

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

答え1

どのようなハードウェアをお持ちかわかりませんが、Wi-Fi に USB スティックを使用している場合 (TP-Links TL-WN722N など)、ファームウェアをハッキングせずに AP モード チャネルを設定することはできません。これは、多数の Linux ソースのコンパイルなどを必要とする、非常に非自明なタスクです。さらに、デフォルトのファームウェアは、チャネル 12 と 13 が利用できない国向けのようです。

関連情報