CentOS: Install TP-Link TL-WN821N Wireless USB Driver

I have a small server in my office which having network card problem because being stroked by lightning. So I decided to use TP-Link wireless USB adapter because this is the only available wireless adapter that we have in office.

This server has GNOME user interface. So I will let ‘Network Manager‘ to manage the wireless network. Variable as below:

OS: CentOS 6.2 64bit
Kernel version: 2.6.32-220.el6.x86_64
Wireless adapter:  TP-Link TL-WN821N v3

1. List all connected USB device:

$ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 003: ID 046d:c05b Logitech, Inc.
Bus 001 Device 004: ID 413c:2107 Dell Computer Corp.
Bus 001 Device 005: ID 0cf3:7015 Atheros Communications, Inc. TP-Link TL-WN821N v3 802.11n [Atheros AR7010+AR9287]
Bus 002 Device 003: ID 18e3:9106 Fitipower Integrated Technology Inc

2. Based on the output, we can determine the type of driver and chipset that we need to install as refer to this page: http://linuxwireless.org/en/users/Devices/USB.

3. Install applications that required in order to compile the driver:

$ yum install gcc automake autoconf kernel-headers kernel-devel -y

4. Download compat-wireless (the driver) from this page: http://linuxwireless.org/en/users/Download/stable/. I will download the latest stable version which is: compat-wireless-3.3-1.tar.bz2

Since the current server does not have internet connection, I will need to download the driver into my local PC and transfer to the server using USB hard drive. I then copy the package into /root directory in the destination server.

5. Extract and compile the source:

$ cd /root
$ tar -xjzf compat-wireless-3.3-1.tar.bz2
$ cd compat-wireless-*
$ ./scripts/driver-select ath9k_htc
$ make
$ make install

6. As you can see in step 1, the firmware version is Atheros AR7010+AR9287. So we need to download the respective firmware at this page: http://linuxwireless.org/download/htc_fw/ and move it into /lib/firmware directory:

$ cd /lib/firmware
$ wget http://linuxwireless.org/download/htc_fw/1.3/htc_7010.fw

7.  Once done, restart the server so it will load the driver accordingly:

$ init 6

Done! I can now able to detect and connect to the wireless network in the office.


There are some reference in Scientific Linux forum that when you have ELrepo installed, you could skip steps 3, 4 and 5 by running following command:

$ yum install kmod-compat-wireless

Reference: http://linuxwireless.org/en/users/Drivers/ath9k_htc

6 thoughts on “CentOS: Install TP-Link TL-WN821N Wireless USB Driver

  1. Secaguy, How come you are using version 3.3 of compat-wireless while your kernel is 2.6.32? Did you encountered any compilation error? because when I tried this on centos 6.3, I got several compilation errors.


    1. I have no compilation error. What kernel version that u used? What is the compilation error you encountered?


  2. This doesnt work in CEntos 6.3.
    kernel version 2.6.32-279.1.1


  3. I have a Centos 6.3 kernel 2.6.32-279.19.1.el6.x86_64. I had spent 40 mostly enjoyable hours trying to get another wireless usb to work – time was spent fixing a driver compilation bug, learning about modules, wpa_supplicant, etc. But when all was said and done – the driver (and a 2nd one from the internet) just didn’t work with encryption. So because of this page, I bought the TP-Link usb and the instructions here worked flawlessly! Thanks so much. I really was ready to move onto something other than getting my wireless usb to work 🙂


  4. Hi can u explain how to install tp link mini wifi usb adapter on centos 5 .


Leave a Reply

Your email address will not be published. Required fields are marked *