WPA 請求者丟棄/斷開酒店 wifi 中的 NIC
TL; 博士
使用 USB Wifi 加密狗時,WPA Supplicant 在我的 Raspberry Pi 3 上間歇性失敗。在“重新連接”或更改酒店的接入點時,它似乎會這樣做。
WPA GUI 狀態:“wpa_gui 無法從 wpa_supplicant 獲取狀態”,並且無線連接的圖示從連接的“waves”變為狀態為“未找到無線介面”的兩個監視器。
如何阻止我的wifi卡斷開連接?
我嘗試過的配置/事情:
- 將 USB wifi 加密狗單獨連接到有源的外部 USB 集線器(USB 3.0、4 安培電源)
/etc/network/interfaces
通過使用術語“無線電源關閉”並重新啟動網路服務,將 wlan1(加密狗)的文件中的“電源管理”切換為“關閉”- 修改
/etc/default/crda
文件以將變數“REGDOMAIN”從空白值更改為“US”- 使用指向接入點的 10dbi 增益值的定向平板天線
Pi & dongle的相關資料:
- 執行 Raspbian Jessie 核心版本 4.1(2016 年 3 月 18 日發布)
uname -a
表示“Linux raspberrypi 4.1.19-v7+”#858 SMP Tue Mar 15 15:56:00lsusb
表示 RT5730 無線晶片組;這張卡應該被 raspbian 原生支持- 加密狗目前連接了一個 2dbi 增益全向天線。
有關該問題的其他資訊:
- 無線網卡連接到具有多個接入點和許多其他使用者的酒店 wifi 網路。
- 我周圍至少有 18 個不同的接入點,最強的廣播在 -47db 左右。儘管可能存在干擾,但信號強度似乎不是問題。
- 當設備重新驗證或(可能)更改為同一網路上的不同接入點(同一 ESS 上的不同 ap)時,似乎會出現問題
- 問題發生後 ifconfig 仍然顯示 wlan1(問題卡),但沒有分配給它的 IP 地址。
- 問題發生後,iwconfig 仍然顯示 wlan1 並聲明它未關聯到接入點。
- 通過將 USB wifi 加密狗插回 pi 或 USB 集線器可以暫時解決該問題。
- pi 正在執行內部卡作為我個人使用的訪問點
- 來自 wlan1(加密狗)的流量經過 NAT,然後橋接到 wlan0(AP)
- pi 的 AP 網卡在 802.11g 模式下以大約 -27 dbi 的速度廣播(我假設為 2.4 ghz)
- pi 通過頓悟瀏覽器處理酒店網路上的強制門戶身份驗證
- 集線器和 USB wifi 加密狗距離 pi 大約 1 英尺
- 連接有時會保持 30 秒,有時會保持 4 小時。變化很大。
斷開連接時的系統日誌(抱歉,這有點長。markdown 中沒有隱藏/取消隱藏功能)
Apr 28 02:35:58 raspberrypi wpa_supplicant[4587]: wlan1: SME: Trying to authenticate with 24:c9:a1:36:d7:e8 (SSID='Hyatt' freq=2412 MHz) Apr 28 02:35:58 raspberrypi rsyslogd-2007: action 'action 18' suspended, next retry is Thu Apr 28 02:36:58 2016 [try http://www.rsyslog.com/e/2007 ] Apr 28 02:35:58 raspberrypi kernel: [ 3397.175336] wlan1: authenticate with 24:c9:a1:36:d7:e8 Apr 28 02:35:58 raspberrypi dhcpcd[658]: wlan1: carrier lost Apr 28 02:35:58 raspberrypi wpa_supplicant[4587]: wlan1: Trying to associate with 24:c9:a1:36:d7:e8 (SSID='Hyatt' freq=2412 MHz) Apr 28 02:35:58 raspberrypi kernel: [ 3397.197559] wlan1: send auth to 24:c9:a1:36:d7:e8 (try 1/3) Apr 28 02:35:58 raspberrypi kernel: [ 3397.198411] cfg80211: Calling CRDA to update world regulatory domain Apr 28 02:35:58 raspberrypi kernel: [ 3397.200688] wlan1: authenticated Apr 28 02:35:58 raspberrypi kernel: [ 3397.204852] wlan1: associate with 24:c9:a1:36:d7:e8 (try 1/3) Apr 28 02:35:58 raspberrypi kernel: [ 3397.208157] wlan1: RX AssocResp from 24:c9:a1:36:d7:e8 (capab=0x421 status=0 aid=3) Apr 28 02:35:58 raspberrypi kernel: [ 3397.212839] brcmfmac: brcmf_cfg80211_reg_notifier: not a ISO3166 code Apr 28 02:35:58 raspberrypi kernel: [ 3397.212863] cfg80211: World regulatory domain updated: Apr 28 02:35:58 raspberrypi kernel: [ 3397.212869] cfg80211: DFS Master region: unset Apr 28 02:35:58 raspberrypi kernel: [ 3397.212874] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time) Apr 28 02:35:58 raspberrypi kernel: [ 3397.212882] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A) Apr 28 02:35:58 raspberrypi kernel: [ 3397.212889] cfg80211: (2457000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A) Apr 28 02:35:58 raspberrypi kernel: [ 3397.212895] cfg80211: (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 mBm), (N/A) Apr 28 02:35:58 raspberrypi kernel: [ 3397.212903] cfg80211: (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A) Apr 28 02:35:58 raspberrypi kernel: [ 3397.212911] cfg80211: (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s) Apr 28 02:35:58 raspberrypi kernel: [ 3397.212918] cfg80211: (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A, 2000 mBm), (0 s) Apr 28 02:35:58 raspberrypi kernel: [ 3397.212924] cfg80211: (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A) Apr 28 02:35:58 raspberrypi kernel: [ 3397.212931] cfg80211: (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm), (N/A) Apr 28 02:35:58 raspberrypi kernel: [ 3397.213813] cfg80211: Calling CRDA for country: GB Apr 28 02:35:58 raspberrypi wpa_supplicant[4587]: wlan1: CTRL-EVENT-REGDOM-CHANGE init=CORE type=WORLD Apr 28 02:35:58 raspberrypi wpa_supplicant[4587]: wlan1: Associated with 24:c9:a1:36:d7:e8 Apr 28 02:35:58 raspberrypi wpa_supplicant[4587]: wlan1: CTRL-EVENT-CONNECTED - Connection to 24:c9:a1:36:d7:e8 completed [id=5 id_str=] Apr 28 02:35:58 raspberrypi kernel: [ 3397.214789] wlan1: associated Apr 28 02:35:58 raspberrypi wpa_supplicant[4587]: wlan1: CTRL-EVENT-REGDOM-CHANGE init=USER type=COUNTRY alpha2=GB Apr 28 02:35:58 raspberrypi kernel: [ 3397.227388] cfg80211: Regulatory domain changed to country: GB Apr 28 02:35:58 raspberrypi kernel: [ 3397.227406] cfg80211: DFS Master region: ETSI Apr 28 02:35:58 raspberrypi kernel: [ 3397.227412] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time) Apr 28 02:35:58 raspberrypi kernel: [ 3397.227420] cfg80211: (2402000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A) Apr 28 02:35:58 raspberrypi kernel: [ 3397.227428] cfg80211: (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A) Apr 28 02:35:58 raspberrypi kernel: [ 3397.227435] cfg80211: (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s) Apr 28 02:35:58 raspberrypi kernel: [ 3397.227442] cfg80211: (5490000 KHz - 5710000 KHz @ 160000 KHz), (N/A, 2700 mBm), (0 s) Apr 28 02:35:58 raspberrypi kernel: [ 3397.227448] cfg80211: (57000000 KHz - 66000000 KHz @ 2160000 KHz), (N/A, 4000 mBm), (N/A) Apr 28 02:35:58 raspberrypi dhcpcd[658]: wlan1: deleting address fe80::53dd:8f07:3be8:9d0a Apr 28 02:35:58 raspberrypi dnsmasq[2376]: no servers found in /var/run/dnsmasq/resolv.conf, will retry Apr 28 02:35:58 raspberrypi avahi-daemon[638]: Withdrawing address record for fe80::53dd:8f07:3be8:9d0a on wlan1. Apr 28 02:35:58 raspberrypi avahi-daemon[638]: Leaving mDNS multicast group on interface wlan1.IPv6 with address fe80::53dd:8f07:3be8:9d0a. Apr 28 02:35:58 raspberrypi avahi-daemon[638]: Interface wlan1.IPv6 no longer relevant for mDNS. Apr 28 02:35:58 raspberrypi avahi-daemon[638]: Withdrawing address record for 172.17.187.9 on wlan1. Apr 28 02:35:58 raspberrypi avahi-daemon[638]: Leaving mDNS multicast group on interface wlan1.IPv4 with address 172.17.187.9. Apr 28 02:35:58 raspberrypi avahi-daemon[638]: Interface wlan1.IPv4 no longer relevant for mDNS. Apr 28 02:35:58 raspberrypi dhcpcd[658]: wlan1: deleting route to 172.17.0.0/16 Apr 28 02:35:58 raspberrypi dhcpcd[658]: wlan1: deleting default route via 172.17.1.1 Apr 28 02:35:58 raspberrypi dhcpcd[658]: wlan1: carrier acquired Apr 28 02:35:58 raspberrypi dhcpcd[658]: wlan1: adding address fe80::53dd:8f07:3be8:9d0a Apr 28 02:35:58 raspberrypi dhcpcd[658]: wlan1: IAID b0:20:34:21 Apr 28 02:35:58 raspberrypi dhcpcd[658]: wlan1: rebinding lease of 172.17.187.9 Apr 28 02:35:59 raspberrypi dhcpcd[658]: wlan1: soliciting an IPv6 router Apr 28 02:35:59 raspberrypi ntpd[873]: Deleting interface #11 wlan1, 172.17.187.9#123, interface stats: received=33, sent=33, dropped=0, active_time=234 secs Apr 28 02:35:59 raspberrypi ntpd[873]: 204.2.134.162 interface 172.17.187.9 -> (none) Apr 28 02:35:59 raspberrypi ntpd[873]: 198.144.194.12 interface 172.17.187.9 -> (none) Apr 28 02:35:59 raspberrypi ntpd[873]: 204.9.54.119 interface 172.17.187.9 -> (none) Apr 28 02:35:59 raspberrypi ntpd[873]: 45.127.113.2 interface 172.17.187.9 -> (none) Apr 28 02:35:59 raspberrypi ntpd[873]: Deleting interface #10 wlan1, fe80::53dd:8f07:3be8:9d0a#123, interface stats: received=0, sent=0, dropped=0, active_time=240 secs Apr 28 02:35:59 raspberrypi ntpd[873]: peers refreshed Apr 28 02:35:59 raspberrypi avahi-daemon[638]: Joining mDNS multicast group on interface wlan1.IPv6 with address fe80::53dd:8f07:3be8:9d0a. Apr 28 02:35:59 raspberrypi avahi-daemon[638]: New relevant interface wlan1.IPv6 for mDNS. Apr 28 02:35:59 raspberrypi avahi-daemon[638]: Registering new address record for fe80::53dd:8f07:3be8:9d0a on wlan1.*. Apr 28 02:35:59 raspberrypi dhcpcd[658]: wlan1: ipv6nd_sendrsprobe: sendmsg: Operation not permitted Apr 28 02:36:02 raspberrypi dhcpcd[4979]: sending commands to master dhcpcd process Apr 28 02:36:02 raspberrypi dhcpcd[658]: control command: /sbin/dhcpcd -k wlan1 Apr 28 02:36:02 raspberrypi dhcpcd[658]: wlan1: removing interface Apr 28 02:36:02 raspberrypi kernel: [ 3401.226725] wlan1: deauthenticating from 24:c9:a1:36:d7:e8 by local choice (Reason: 3=DEAUTH_LEAVING) Apr 28 02:36:02 raspberrypi wpa_supplicant[4587]: wlan1: CTRL-EVENT-DISCONNECTED bssid=24:c9:a1:36:d7:e8 reason=3 locally_generated=1 Apr 28 02:36:02 raspberrypi avahi-daemon[638]: Interface wlan1.IPv6 no longer relevant for mDNS. Apr 28 02:36:02 raspberrypi avahi-daemon[638]: Leaving mDNS multicast group on interface wlan1.IPv6 with address fe80::53dd:8f07:3be8:9d0a. Apr 28 02:36:02 raspberrypi kernel: [ 3401.313626] cfg80211: Calling CRDA to update world regulatory domain Apr 28 02:36:02 raspberrypi avahi-daemon[638]: Withdrawing address record for fe80::53dd:8f07:3be8:9d0a on wlan1. Apr 28 02:36:02 raspberrypi kernel: [ 3401.331043] brcmfmac: brcmf_cfg80211_reg_notifier: not a ISO3166 code Apr 28 02:36:02 raspberrypi kernel: [ 3401.331067] cfg80211: World regulatory domain updated: Apr 28 02:36:02 raspberrypi kernel: [ 3401.331075] cfg80211: DFS Master region: unset Apr 28 02:36:02 raspberrypi kernel: [ 3401.331080] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time) Apr 28 02:36:02 raspberrypi kernel: [ 3401.331087] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A) Apr 28 02:36:02 raspberrypi kernel: [ 3401.331094] cfg80211: (2457000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A) Apr 28 02:36:02 raspberrypi kernel: [ 3401.331100] cfg80211: (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 mBm), (N/A) Apr 28 02:36:02 raspberrypi kernel: [ 3401.331108] cfg80211: (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A) Apr 28 02:36:02 raspberrypi kernel: [ 3401.331116] cfg80211: (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s) Apr 28 02:36:02 raspberrypi kernel: [ 3401.331122] cfg80211: (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A, 2000 mBm), (0 s) Apr 28 02:36:02 raspberrypi kernel: [ 3401.331128] cfg80211: (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A) Apr 28 02:36:02 raspberrypi kernel: [ 3401.331136] cfg80211: (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm), (N/A) Apr 28 02:36:02 raspberrypi kernel: [ 3401.579305] IPv6: ADDRCONF(NETDEV_UP): wlan1: link is not ready Apr 28 02:36:02 raspberrypi kernel: [ 3401.579353] cfg80211: Calling CRDA for country: GB Apr 28 02:36:02 raspberrypi wpa_supplicant[4587]: wlan1: CTRL-EVENT-REGDOM-CHANGE init=USER type=COUNTRY alpha2=GB Apr 28 02:36:02 raspberrypi kernel: [ 3401.595533] cfg80211: Regulatory domain changed to country: GB Apr 28 02:36:02 raspberrypi kernel: [ 3401.595548] cfg80211: DFS Master region: ETSI Apr 28 02:36:02 raspberrypi kernel: [ 3401.595554] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time) Apr 28 02:36:02 raspberrypi kernel: [ 3401.595562] cfg80211: (2402000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A) Apr 28 02:36:02 raspberrypi kernel: [ 3401.595570] cfg80211: (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A) Apr 28 02:36:02 raspberrypi kernel: [ 3401.595577] cfg80211: (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s) Apr 28 02:36:02 raspberrypi kernel: [ 3401.595584] cfg80211: (5490000 KHz - 5710000 KHz @ 160000 KHz), (N/A, 2700 mBm), (0 s) Apr 28 02:36:02 raspberrypi kernel: [ 3401.595590] cfg80211: (57000000 KHz - 66000000 KHz @ 2160000 KHz), (N/A, 4000 mBm), (N/A) Apr 28 02:36:02 raspberrypi wpa_supplicant[4587]: wlan1: CTRL-EVENT-TERMINATING Apr 28 02:36:12 raspberrypi dhcpcd[5086]: sending commands to master dhcpcd process Apr 28 02:36:12 raspberrypi dhcpcd[658]: control command: /sbin/dhcpcd -k eth0 Apr 28 02:36:12 raspberrypi kernel: [ 3411.753638] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup Apr 28 02:36:12 raspberrypi kernel: [ 3411.825436] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup Apr 28 02:36:12 raspberrypi kernel: [ 3411.825930] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready Apr 28 02:36:13 raspberrypi kernel: [ 3412.149174] IPv6: ADDRCONF(NETDEV_UP): wlan1: link is not ready Apr 28 02:39:32 raspberrypi hostapd: wlan0: STA 16:39:db:60:cb:bf WPA: group key handshake completed (RSN) Apr 28 02:39:32 raspberrypi rsyslogd-2007: action 'action 18' suspended, next retry is Thu Apr 28 02:40:32 2016 [try http://www.rsyslog.com/e/2007 ] Apr 28 02:39:32 raspberrypi hostapd: wlan0: STA a4:77:33:51:31:9e WPA: group key handshake completed (RSN) Apr 28 02:49:32 raspberrypi hostapd: wlan0: STA a4:77:33:51:31:9e WPA: group key handshake completed (RSN) Apr 28 02:49:32 raspberrypi hostapd: wlan0: STA 16:39:db:60:cb:bf WPA: group key handshake completed (RSN) Apr 28 02:49:32 raspberrypi rsyslogd-2007: action 'action 18' suspended, next retry is Thu Apr 28 02:51:02 2016 [try http://www.rsyslog.com/e/2007 ] Apr 28 02:59:32 raspberrypi hostapd: wlan0: STA 16:39:db:60:cb:bf WPA: group key handshake completed (RSN) Apr 28 02:59:32 raspberrypi hostapd: wlan0: STA a4:77:33:51:31:9e WPA: group key handshake completed (RSN) Apr 28 02:59:32 raspberrypi rsyslogd-2007: action 'action 18' suspended, next retry is Thu Apr 28 03:01:02 2016 [try http://www.rsyslog.com/e/2007 ] Apr 28 03:08:34 raspberrypi rsyslogd-2007: action 'action 18' suspended, next retry is Thu Apr 28 03:10:04 2016 [try http://www.rsyslog.com/e/2007 ] Apr 28 03:08:34 raspberrypi systemd[1]: Starting Session c3 of user pi. Apr 28 03:08:34 raspberrypi systemd[1]: Started Session c3 of user pi. Apr 28 03:09:32 raspberrypi hostapd: wlan0: STA 16:39:db:60:cb:bf WPA: group key handshake completed (RSN) Apr 28 03:09:32 raspberrypi hostapd: wlan0: STA a4:77:33:51:31:9e WPA: group key handshake completed (RSN) Apr 28 03:10:29 raspberrypi rsyslogd-2007: action 'action 18' suspended, next retry is Thu Apr 28 03:11:59 2016 [try http://www.rsyslog.com/e/2007 ] Apr 28 03:10:29 raspberrypi systemd[1]: Starting Session c4 of user pi. Apr 28 03:10:29 raspberrypi systemd[1]: Started Session c4 of user pi.
wlan1: deauthenticating ... by local choice (Reason: 3=DEAUTH_LEAVING)
我感興趣(看日誌的底部 3/4)。CTRL-EVENT-TERMINATING
我也很感興趣。WPA 請求者調試日誌
似乎AP (8c:0c:90:01:12:88) 正在生成deauth:
CTRL_IFACE: GET_NETWORK id=0 name='disabled' nl80211: Drv Event 20 (NL80211_CMD_DEL_STATION) received for wlan1 nl80211: Delete station 8c:0c:90:01:12:88 nl80211: Drv Event 39 (NL80211_CMD_DEAUTHENTICATE) received for wlan1 nl80211: Deauthenticate event wlan1: Event DEAUTH (12) received <----- wlan1: Deauthentication notification <----- wlan1: * reason 3 (locally generated) <----- wlan1: * address 8c:0c:90:01:12:88 <----- Deauthentication frame IE(s) - hexdump(len=0): [NULL] wlan1: CTRL-EVENT-DISCONNECTED bssid=8c:0c:90:01:12:88 reason=3 locally_generated=1 CTRL_IFACE monitor sent successfully to /tmp/libdhcpcd-wpa-7751.50\x00 CTRL_IFACE monitor sent successfully to /tmp/wpa_ctrl_11606-5471\x00 wlan1: Auto connect enabled: try to reconnect (wps=0/0 wpa_state=9) wlan1: Setting scan request: 0.100000 sec Added BSSID 8c:0c:90:01:12:88 into blacklist wlan1: Another BSS in this ESS has been seen; try it next BSSID 8c:0c:90:01:12:88 blacklist count incremented to 2
解決方案
我安裝
network-manager
並network-manager-gnome
把我的 wlan1 卡從/etc/network/interfaces
. 該卡保持穩定連接超過 20 小時,只有在我關閉樹莓派時才斷開連接。WPA Gui 說“無法從 wpa_supplicant 獲取狀態”,但該卡仍然可以使用。看起來
nm-applet
權限有問題。我必須sudo pkill nm-applet
然後sudo nm-applet
才能network-manager-gnome
連接到無線。我將不得不解決這些錯誤。
解決方案
我從.
network-manager
_ 該卡保持穩定連接超過 20 小時,只有在我關閉樹莓派時才斷開連接。WPA Gui 說“無法從 wpa_supplicant 獲取狀態”,但該卡仍然可以使用。network-manager-gnome``/etc/network/interfaces
看起來
nm-applet
權限有問題。我必須sudo pkill nm-applet
然後sudo nm-applet
才能network-manager-gnome
連接到無線。我將不得不解決這些錯誤。
/etc/modprobe.d/rt2800usb.conf
使用以下行創建一個新文件:options rt2800usb nohwcrypt=1
重啟
或將預設驅動程序列入黑名單並使用
nl80211
驅動程序連接wpa_supplicant
:nano /etc/modprobe.d/blacklist.conf
添加以下行:
blacklist rt2800usb blacklist rt2x00lib blacklist rt2x00usb
通過命令行連接:
wpa_supplicant -Dnl80211 -iwlan0 -c/etc/wpa_supplicant.conf
如果您需要 GUI,請安裝 WICD,選擇您的界面,然後轉到首選項並選擇
nl80211