主要有下面幾個步驟:
1.剛插上網卡,network-manager識別出來了網卡,也能搜索到WiFi,但就是連接不上。查看/var/log/syslog日志或者使用nmcli m查看網絡信息,顯示認證失敗。信息類似這樣:
Jan 19 12:31:56 debian NetworkManager[600]: [1516336316.2627] device (wlan0): supplicant interface state: authenticating -> disconnected
Jan 19 12:32:06 debian NetworkManager[600]: [1516336326.2699] device (wlan0): supplicant interface state: disconnected -> scanning
Jan 19 12:32:07 debian wpa_supplicant[681]: wlan0: CTRL-EVENT-SSID-REENABLED id=1 ssid="zlp"
Jan 19 12:32:07 debian wpa_supplicant[681]: wlan0: SME: Trying to authenticate with b0:d5:9d:45:ff:02 (SSID='zlp' freq=2462 MHz)
Jan 19 12:32:07 debian kernel: [ 444.030318] wlan0: authenticate with b0:d5:9d:::
Jan 19 12:32:07 debian kernel: [ 444.037183] wlan0: send auth to b0:d5:9d::: (try 1/3)
Jan 19 12:32:07 debian NetworkManager[600]: [1516336327.2734] device (wlan0): supplicant interface state: scanning -> authenticating
Jan 19 12:32:07 debian kernel: [ 444.237411] wlan0: send auth to b0:d5:9d::: (try 2/3)
Jan 19 12:32:07 debian kernel: [ 444.441458] wlan0: send auth to b0:d5:9d::: (try 3/3)
Jan 19 12:32:07 debian kernel: [ 444.645450] wlan0: authentication with b0:d5:9d::: timed out
Jan 19 12:32:07 debian wpa_supplicant[681]: wlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=1 ssid="wifiname" auth_failures=2 duration=20 reason=CONN_FAILED
但這其實並不是密碼錯誤,而是cfg80211默認使用的驅動不正確!!! 它默認使用了rtl8xxxu (通過lsmod可以查看),並不適配這個TL-WN821N v5 USB 無線網卡,需要安裝驅動。
2.按照教程 https://unix.stackexchange.com/questions/348777/cant-install-tl-wn821n-v5-drivers-on-kali 自己下載編譯驅動,會報編譯錯誤,可能是gcc版本過高,采用
這個帖子的方法可以成功安裝 https://askubuntu.com/questions/981946/trying-to-install-tp-link-card-make-wont-work,即:
git clone https://github.com/Mange/rtl8192eu-linux-driver.git
cd rtl8192eu-linux-driver
sudo dkms add .
sudo dkms install rtl8192eu/1.0
sudo modprobe 8192eu
3. 使用網卡時,先rmmod rtl8xxxu,再modprobe 8192eu,然后再插網卡即可使用。
補充資料:
使用 tail -f /var/log/syslog可以動態查看系統日志,排查熱點出了什么問題。