Kali Linux安装TL-WN821N USB无线网卡驱动(make失败)

时间:2022-07-21 16:06:17

主要有下面几个步骤:

1.刚插上网卡,network-manager识别出来了网卡,也能搜索到WiFi,但就是连接不上。查看/var/log/syslog日志或者使用nmcli m查看网络信息,显示认证失败。信息类似这样:

Jan 19 12:31:56 debian NetworkManager[600]: <info>  [1516336316.2627] device (wlan0): supplicant interface state: authenticating -> disconnected
Jan 19 12:32:06 debian NetworkManager[600]: <info>  [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]: <info>  [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可以动态查看系统日志,排查热点出了什么问题。

如何建立热点可以参考  http://blog.csdn.net/gsls200808/article/details/39370597