宜蘭縣教育支援平台 會員登入 會員註冊 我的i教書

« 上一篇 | 下一篇 »

因為之前的做法是無線網路連線時,不用輸入金鑰,任何人都可以連線,存在安全性上的問題,所以在這一篇做修正。
參考網站: 
Cubieboard 开箱和入门 | Name5566 
如何使用樹莓派變成無線熱點 [Raspberry Pi become a WIFI(wireless) AP] 
吉瓦小棧: 三月 2013 

編碼後的密碼
# wpa_passphrase "CubieTruck" 123456789 | grep -v '#psk' | grep psk | awk -F'=' '{print $2}'
ee07bee15c9c33bf7bcc53d84aac17e2b83f82476f96e32efcd03d716d99a4d2

修改 /etc/hostapd/hostapd.conf 設定檔
可以使用 
wpa_psk=ee07bee15c9c33bf7bcc53d84aac17e2b83f82476f96e32efcd03d716d99a4d2

wpa_passphrase=123456789
# cat /etc/hostapd/hostapd.conf
interface=wlan0
driver=nl80211
ssid=CubieTruck
channel=11
hw_mode=g
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_psk=ee07bee15c9c33bf7bcc53d84aac17e2b83f82476f96e32efcd03d716d99a4d2
wpa_key_mgmt=WPA-PSK
rsn_pairwise=CCMP

但在使用 Lubuntu 內建的 hostapd 套件時
執行之後,使用者連線之後會出現許多錯誤訊息

# hostapd /etc/hostapd/hostapd.conf
Configuration file: /etc/hostapd/hostapd.conf
Failed to create interface mon.wlan0: -95 (Operation not supported)
Using interface wlan0 with hwaddr 02:1a:11:f5:42:57 and ssid 'CubieTruck'
wlan0: STA 74:e5:43:d6:9d:91 IEEE 802.11: associated
Could not set station 74:e5:43:d6:9d:91 flags for kernel driver (errno=11).
i802_send_eapol - packet len: 131 - failed: 11 (Resource temporarily unavailable)
i802_send_eapol - packet len: 131 - failed: 11 (Resource temporarily unavailable)
i802_send_eapol - packet len: 131 - failed: 11 (Resource temporarily unavailable)
i802_send_eapol - packet len: 131 - failed: 11 (Resource temporarily unavailable)
WPA: wpa_sm_step() called recursively
Could not set station 74:e5:43:d6:9d:91 flags for kernel driver (errno=11).
wlan0: STA 74:e5:43:d6:9d:91 IEEE 802.11: disassociated
Could not set station 74:e5:43:d6:9d:91 flags for kernel driver (errno=11).

在網路上搜尋的結論是,Cubie Truck Lubuntu 內建的 hostapd 版本過舊,不支援 wpa 的方式連線

解決方式:
移除原先安裝的 hostapd
# apt-get remove hostapd

下載已經編譯好的版本
# wget https://github.com/igorpecovnik/Cubietruck-Debian/raw/master/bin/hostapd21.tgz

解壓縮
# tar xvzf hostapd21.tgz

複製解壓縮完成的檔案到 /usr/sbin
# cp hostapd hostapd_cli /usr/sbin

檢查版本
# hostapd -v
hostapd v2.1
User space daemon for IEEE 802.11 AP management,
IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator
Copyright (c) 2002-2014, Jouni Malinen <j@w1.fi> and contributors

再執行一次,使用者連線時便不會出現錯誤訊息
# hostapd /etc/hostapd/hostapd.conf
Configuration file: /etc/hostapd/hostapd.conf
Using interface wlan0 with hwaddr 02:1a:11:f7:2e:23 and ssid "CubieTruck"
wlan0: interface state UNINITIALIZED->ENABLED
wlan0: AP-ENABLED 
wlan0: STA 74:e5:43:d6:9d:91 IEEE 802.11: associated
wlan0: AP-STA-CONNECTED 74:e5:43:d6:9d:91
wlan0: STA 74:e5:43:d6:9d:91 RADIUS: starting accounting session 54369C0D-00000000
wlan0: STA 74:e5:43:d6:9d:91 WPA: pairwise key handshake completed (RSN)
wlan0: STA 74:e5:43:d6:9d:91 IEEE 802.11: disassociated
wlan0: AP-STA-DISCONNECTED 74:e5:43:d6:9d:91
wlan0: STA 74:e5:43:d6:9d:91 IEEE 802.11: associated
wlan0: AP-STA-CONNECTED 74:e5:43:d6:9d:91
wlan0: STA 74:e5:43:d6:9d:91 RADIUS: starting accounting session 54369C0D-00000001

以 Windows 7 測試連線時,也會出現要輸入 網路安全性金鑰 的畫面




 
 
 
用LINE傳送

發表迴響

 暱稱 (必填)

 悄悄話

 標題

 個人網頁

 電子郵件

authimage 
 認證碼 (必填)