How to install the driver for W-Fi for cards with RTL8812AU/RTL8821AU chipsets (Alfa AWUS036ACH, Alfa AWUS036AC)

What is the chipset in Alfa AWUS036ACH and Alfa AWUS036AC

The RTL8812AU chipset has the following W-Fi adapters:

They are especially loved by those who perform wireless security testing of Wi-Fi networks, since they are modern wireless adapters that support monitor mode and can perform wireless injections.

The difference between the RTL8812AU and RTL8814AU chipsets is the ability to support a different number of antennas. The RTL8812AU supports up to 2 antennas, and the Realtek RTL8814AU supports up to 4 antennas. In some cases, depending on the design of the device manufacturer's circuitry or firmware, one antenna can be used only for transmitting, and the other only for receiving. Also, some devices work only in one band by choice, others – in two bands at the same time. This also needs to be considered when purchasing devices.

How to install the rtl8812au driver in Kali Linux

If you bought a dual-band (2.4GHz & 5.0GHz) adapter with RTL8812AU/21AU chipset, you need to install the rtl8812au driver. On Kali Linux, you can do this with the command:

sudo apt install realtek-rtl88xxau-dkms

After installation, reboot your system or disconnect/reconnect the adapter.

How to install rtl8812au driver in Arch Linux, BlackArch

Start by installing the pikaur program according to the “Automatic installation and update of AUR packages” article. The pikaur program is analogous to pacman, but for working with the AUR, it allows you to automatically install and update programs from the AUR. You will definitely love pikaur!

Then run the command:

pikaur -S rtl88xxau-aircrack-dkms-git

How to install rtl8812au driver in Debian, Linux Mint, Ubuntu

Run the following commands to install the rtl8812au driver.

Install dependencies:

sudo apt update
sudo apt install git build-essential libelf-dev linux-headers-`uname -r` debhelper dpkg-dev dkms bc

Download driver source code:

git clone https://github.com/aircrack-ng/rtl8812au
cd rtl*

Install the driver as a DKMS module – this means that when updating the kernel, you do not have to manually recompile the driver for the new kernel version. This will be done automatically by the DKMS module. Also note that the make command is unnecessary since the compilation is done by the DKMS module.

sudo make dkms_install

DKMS: install completed.
dkms status
8812au, 5.6.4.2_35491.20191025, 4.19.0-10-amd64, x86_64: installed

DKMS reports that the installation is complete and that the status for 8814au is “installed”.

How to uninstall the driver

To remove a driver from your system, open a terminal in your source directory and run the following command:

sudo make dkms_remove

How to install rtl8812au driver in For Raspberry (RPI)

Install dependencies:

sudo apt update
sudo apt install raspberrypi-kernel-headers

Download driver source code:

git clone https://github.com/aircrack-ng/rtl8812au
cd rtl*

Changes to the Makefile must be made to change the processor architecture.

For RPI 1/2/3/ and 0/Zero:

sed -i 's/CONFIG_PLATFORM_I386_PC = y/CONFIG_PLATFORM_I386_PC = n/g' Makefile
sed -i 's/CONFIG_PLATFORM_ARM_RPI = n/CONFIG_PLATFORM_ARM_RPI = y/g' Makefile

But for RPI 3B+ and 4B, you will need to run the other commands below, they build the Arch ARM64 driver:

sed -i 's/CONFIG_PLATFORM_I386_PC = y/CONFIG_PLATFORM_I386_PC = n/g' Makefile
sed -i 's/CONFIG_PLATFORM_ARM64_RPI = n/CONFIG_PLATFORM_ARM64_RPI = y/g' Makefile

Also, if you get an error about an unrecognized command line parameter “-mgeneral-regs-only” (for example Raspbian Buster), you need to run the following commands:

sed -i 's/^dkms build/ARCH=arm dkms build/' Makefile
sed -i 's/^MAKE="/MAKE="ARCH=arm\ /' dkms.conf

Install the driver as a DKMS module – this means that when updating the kernel, you do not have to manually recompile the driver for the new kernel version. This will be done automatically by the DKMS module. Also note that the make command is unnecessary since the compilation is done by the DKMS module.

sudo make dkms_install

Removing the driver

To remove a driver from your system, open a terminal in your source directory and run the following command:

sudo make dkms_remove

Setting up TX power in rtl88xxau

sudo iw wlan0 set txpower fixed 3000

Switching between USB modes in rtl88xxau

sudo rmmod 88XXau
sudo modprobe 88XXau rtw_switch_usb_mode:NUMBER

Where NUMBER can be:

  • 0: do not use switch
  • 1: switch from usb2.0 to usb 3.0
  • 2: switch from usb3.0 to usb 2.0

LED control in rtl88xxau

You can control the LED statically by specifying a module parameter in /etc/modprobe.d/8812au.conf or a similar file, like this:

options 88XXau rtw_led_ctrl=0

Values can be 0 or 1.

You can also control the LED dynamically by changing the values in /proc/net/rtl8812au/$(YOUR INTERFACE NAME)/led_ctrl, for example:

sudo sh -c "echo "0" > /proc/net/rtl8812au/$(YOUR INTERFACE NAME)/led_ctrl"

Values can be 0 or 1.

To check the current value:

cat /proc/net/rtl8812au/$(YOUR INTERFACE NAME)/led_ctrl

NetworkManager

Newer versions of NetworkManager switch to a random MAC address. Some users would prefer to use a fixed MAC address. Just add these lines below at the end of your /etc/NetworkManager/NetworkManager.conf file:

[device]
wifi.scan-rand-mac-address=no

and restart NetworkManager with the command:

sudo systemctl restart NetworkManager

How to set Alfa AWUS1900 into monitor mode

The main thing to learn by now is to use the “ip” and “iw” commands instead of “ifconfig” and “iwconfig” – this applies to all Wi-Fi adapters.

For details, see the article: Linux Wi-Fi Cheat Sheet: Tips and Troubleshooting.

Recommended for you:

2 Comments to How to install the driver for W-Fi for cards with RTL8812AU/RTL8821AU chipsets (Alfa AWUS036ACH, Alfa AWUS036AC)

  1. Joaquin Abian says:

    rtl88xxau is not currently working on raspberry pi.5.4.72-v7l+

    make produces error "gcc: error: unrecognized command line option \u2018-mgeneral-regs-only\u2019" despite dkms.conf was modified as indicated

    make dkms_install installs the driver but it is not recognized by the device.

    Few months ago this driver installed and worked with no problem.

    On the other hand, you indicate to modify dkms-install.sh with
    sed -i 's/^dkms build/ARCH=arm dkms build/' dkms-install.sh

    but dkms-install.sh is not in the repository anymore.

    • Alex says:

      Hello! You are right about dkms-install.sh and I corrected it in the manual.

      Take a close look at the error message and unrecognized command line option: “\u2018-mgeneral-regs-only\u2019”. It is weird, isn’t it? Maybe try deleting the source directory and trying to download and reinstall?

      Did you try to install this driver using DKMS?

Leave a Reply

Your email address will not be published.