![无法将 Debian Jessie 与 USB Wi-Fi(802.11n)连接到 AirMac 2.4GHz](https://linux22.com/image/1526580/%E6%97%A0%E6%B3%95%E5%B0%86%20Debian%20Jessie%20%E4%B8%8E%20USB%20Wi-Fi%EF%BC%88802.11n%EF%BC%89%E8%BF%9E%E6%8E%A5%E5%88%B0%20AirMac%202.4GHz.png)
Debian Jessie 在 ESXi 6.5 上运行。USB 加密狗是 PLANEX GW-USNano2 802.11n 无线适配器 [Realtek RTL8188CUS],并在 ESXi 上配置为直通。AirMac 配置为 WPA2-PSK。其他 STA(iPod touch、Mac 和一些 PC)已成功连接到 AirMac。
这是尝试结果和配置文件。哪里出了问题?请指教。
iwconfig 的结果:
# iwconfig
lo no wireless extensions.
wlan0 unassociated Nickname:"<WIFI@REALTEK>"
Mode:Managed Frequency=2.412 GHz Access Point: Not-Associated
Sensitivity:0/0
Retry:off RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off
Link Quality:0 Signal level:0 Noise level:0
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0
eth0 no wireless extensions.
iwlist扫描的结果:
# iwlist wlan0 scanning
wlan0 No scan results
/etc/wpa_supplicant/wpa_supplicant.conf:
ctrl_interface=/run/wpa_supplicant
update_config=1
network={
ssid="myssidhere"
proto=RSN WPA
key_mgmt=WPA-PSK
pairwise=CCMP TKIP
group=CCMP TKIP
psk=<generated by `wpa_passphrase ssid passphrase`>
scan_ssid=0
}
在 /etc/网络/接口:
source /etc/network/interfaces.d/*
auto lo
iface lo inet loopback
allow-hotplug eth0
iface eth0 inet dhcp
allow-hotplug wlan0
auto wlan0
iface wlan0 inet static
wireless-essid myssidhere
address 192.168.xx.xx
netmask 255.255.255.xx
network 192.168.xx.xx
broadcast 192.168.xx.xx
gateway 192.168.xx.xx
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
wpa_supplicant 的结果:
# wpa_supplicant -i wlan0 -D nl80211,wext -c /etc/wpa_supplicant/wpa_supplicant.conf -d
wpa_supplicant v2.3
random: Trying to read entropy from /dev/random
Successfully initialized wpa_supplicant
Initializing interface 'wlan0' conf '/etc/wpa_supplicant/wpa_supplicant.conf' driver 'nl80211,wext' ctrl_interface 'N/A' bridge 'N/A'
Configuration file '/etc/wpa_supplicant/wpa_supplicant.conf' -> '/etc/wpa_supplicant/wpa_supplicant.conf'
Reading configuration file '/etc/wpa_supplicant/wpa_supplicant.conf'
ctrl_interface='/run/wpa_supplicant'
update_config=1
Priority group 0
id=0 ssid='myssidhere'
nl80211: Driver does not support authentication/association or connect commands
nl80211: Remove monitor interface: refcount=0
netlink: Operstate: ifindex=3 linkmode=0 (kernel-control), operstate=6 (IF_OPER_UP)
nl80211: Set mode ifindex 3 iftype 2 (STATION)
nl80211: Failed to set interface 3 to mode 2: -19 (No such device)
wlan0: Failed to initialize driver interface - try next driver wrapper
SIOCGIWRANGE: WE(compiled)=22 WE(source)=16 enc_capa=0xf
capabilities: key_mgmt 0xf enc 0x1f flags 0x0
ioctl[SIOCSIWAP]: Operation not permitted
WEXT: Failed to clear BSSID selection on disconnect
netlink: Operstate: ifindex=3 linkmode=1 (userspace-control), operstate=5 (IF_OPER_DORMANT)
Add interface wlan0 to a new radio N/A
wlan0: Own MAC address: 00:22:cf:f5:a0:3b
wpa_driver_wext_set_key: alg=0 key_idx=0 set_tx=0 seq_len=0 key_len=0
wpa_driver_wext_set_key: alg=0 key_idx=1 set_tx=0 seq_len=0 key_len=0
wpa_driver_wext_set_key: alg=0 key_idx=2 set_tx=0 seq_len=0 key_len=0
wpa_driver_wext_set_key: alg=0 key_idx=3 set_tx=0 seq_len=0 key_len=0
wpa_driver_wext_set_key: alg=0 key_idx=4 set_tx=0 seq_len=0 key_len=0
ioctl[SIOCSIWENCODEEXT]: Invalid argument
Driver did not support SIOCSIWENCODEEXT
wpa_driver_wext_set_key: alg=0 key_idx=5 set_tx=0 seq_len=0 key_len=0
ioctl[SIOCSIWENCODEEXT]: Invalid argument
Driver did not support SIOCSIWENCODEEXT
wpa_driver_wext_set_countermeasures
wlan0: RSN: flushing PMKID list in the driver
wlan0: Setting scan request: 0.100000 sec
TDLS: TDLS operation not supported by driver
TDLS: Driver uses internal link setup
wlan0: WPS: UUID based on MAC address: 220359db-ad88-5825-b0e3-00920ace4acb
EAPOL: SUPP_PAE entering state DISCONNECTED
EAPOL: Supplicant port status: Unauthorized
EAPOL: KEY_RX entering state NO_KEY_RECEIVE
EAPOL: SUPP_BE entering state INITIALIZE
EAP: EAP entering state DISABLED
Using existing control interface directory.
ctrl_iface bind(PF_UNIX) failed: Address already in use
ctrl_iface exists, but does not allow connections - assuming it was leftover from forced program termination
Successfully replaced leftover ctrl_iface socket '/run/wpa_supplicant/wlan0'
wlan0: Added interface wlan0
wlan0: State: DISCONNECTED -> DISCONNECTED
wpa_driver_wext_set_operstate: operstate 0->0 (DORMANT)
netlink: Operstate: ifindex=3 linkmode=-1 (no change), operstate=5 (IF_OPER_DORMANT)
random: Got 20/20 bytes from /dev/random
nl80211: Ignore RTM_NEWLINK event for foreign ifindex 3
nl80211: Ignore RTM_NEWLINK event for foreign ifindex 3
RTM_NEWLINK: operstate=0 ifi_flags=0x1003 ([UP])
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added
WEXT: if_removed already cleared - ignore event
Wireless event: cmd=0x8b06 len=12
RTM_NEWLINK: operstate=0 ifi_flags=0x1003 ([UP])
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added
WEXT: if_removed already cleared - ignore event
Wireless event: cmd=0x8b1a len=48
wlan0: State: DISCONNECTED -> SCANNING
wlan0: Starting AP scan for wildcard SSID
wlan0: Add radio work 'scan'@0x7f3a90b48a60
wlan0: First radio work item in the queue - schedule start immediately
wlan0: Starting radio work 'scan'@0x7f3a90b48a60 after 0.000038 second wait
Scan requested (ret=0) - scan timeout 10 seconds
nl80211: Ignore RTM_NEWLINK event for foreign ifindex 3
RTM_NEWLINK: operstate=0 ifi_flags=0x1003 ([UP])
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added
WEXT: if_removed already cleared - ignore event
Wireless event: cmd=0x8b19 len=16
wlan0: Event SCAN_RESULTS (3) received
Received 0 bytes of scan results (0 BSSes)
wlan0: BSS: Start scan result update 1
BSS: last_scan_res_used=0/0
wlan0: New scan results available (own=0 ext=0)
wlan0: Radio work 'scan'@0x7f3a90b48a60 done in 2.516549 seconds
wlan0: No suitable network found
wlan0: Setting scan request: 5.000000 sec
RTM_NEWLINK: operstate=0 ifi_flags=0x1003 ([UP])
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added
WEXT: if_removed already cleared - ignore event
Wireless event: cmd=0x8b19 len=16
wlan0: Event SCAN_RESULTS (3) received
Received 0 bytes of scan results (0 BSSes)
wlan0: BSS: Start scan result update 2
BSS: last_scan_res_used=0/0
wlan0: New scan results available (own=0 ext=0)
wlan0: No suitable network found
wlan0: Ignore new scan request for 5.000000 sec since an earlier request is scheduled to trigger sooner
EAPOL: disable timer tick
nl80211: Ignore RTM_NEWLINK event for foreign ifindex 3
^Cwlan0: Removing interface wlan0
wlan0: Request to deauthenticate - bssid=00:00:00:00:00:00 pending_bssid=00:00:00:00:00:00 reason=3 state=SCANNING
TDLS: Tear down peers
wlan0: State: SCANNING -> DISCONNECTED
wpa_driver_wext_set_operstate: operstate 0->0 (DORMANT)
netlink: Operstate: ifindex=3 linkmode=-1 (no change), operstate=5 (IF_OPER_DORMANT)
EAPOL: External notification - portEnabled=0
EAPOL: External notification - portValid=0
wpa_driver_wext_set_countermeasures
wlan0: Cancelling scan request
wlan0: Cancelling authentication timeout
Remove interface wlan0 from radio
Remove radio
ioctl[SIOCSIWAP]: Operation not permitted
WEXT: Failed to clear BSSID selection on disconnect
netlink: Operstate: ifindex=3 linkmode=0 (kernel-control), operstate=6 (IF_OPER_UP)
wlan0: CTRL-EVENT-TERMINATING
谢谢,
答案1
(稍后...)有时,wpa_supplicant.conf 中的 country 属性有些奇怪。我设法通过将我的国家添加到其中来解决这些问题:
country=AR
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="network_name"
psk="network_pass"
}
我还注意到,您在两个地方告诉系统要连接到哪个网络。也许这没有必要。使用简化版本的 /etc/network/interfaces 应该可以工作(根据您的需要进行调整):
source /etc/network/interfaces.d/*
auto lo
iface lo inet loopback
allow-hotplug eth0
iface eth0 inet dhcp
allow-hotplug wlan0
iface wlan0 inet static
address 192.168.1.2
netmask 255.255.255.0
gateway 192.168.1.1
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
旧内容: 您可以尝试使用以下命令:
sudo wpa_supplicant -B -Dwext,nl80211 -i wlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf &
它应该可以工作。