WPA 请求方在酒店 wifi 中丢弃/断开网卡

Shr*_*ut1 5 networking wifi wpa-supplicant authentication raspbian

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 和加密狗的信息:

  • 运行 Raspbian Jessie Kernel 4.1 版(2016 年 3 月 18 日发布)
  • uname -a 表示“Linux raspberrypi 4.1.19-v7+”#858 SMP Tue Mar 15 15:56:00
  • lsusb表示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 小时。变化很大。

断开连接时的系统日志(对不起,这有点长。降价中没有隐藏/取消隐藏功能)

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.
Run Code Online (Sandbox Code Playgroud)
  • 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
Run Code Online (Sandbox Code Playgroud)

解决方案

我安装network-managernetwork-manager-gnome并放弃我WLAN1卡出来的/etc/network/interfaces。该卡保持稳定连接超过20小时,直到我关闭树莓派时才断开连接。WPA Gui 说“无法从 wpa_supplicant 获得状态”,但该卡仍然可以工作。

看起来nm-applet权限有问题。我必须sudo pkill nm-applet然后sudo nm-applet才能network-manager-gnome连接到无线网络。我将不得不解决这些错误。

Shr*_*ut1 0

解决方案

我安装network-managernetwork-manager-gnome删除了我的 wlan1 卡/etc/network/interfaces。该卡稳定连接了 20 多个小时,直到我关闭树莓派时才断开连接。WPA Gui 说“无法从 wpa_supplicant 获取状态”,但该卡仍然可以工作。

看起来nm-applet权限有问题。我必须sudo pkill nm-applet然后sudo nm-applet才能network-manager-gnome连接到无线网络。我必须解决这些错误。