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

See also: How to install Wi-Fi driver in Linux if the computer is offline

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:

14 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?

  2. Ludwig says:

    ──(kali㉿kali)-[~/rtl8812au]
    └─$ sudo make dkms_install                                                                    
    mkdir -p /usr/src/8812au-5.6.4.2_35491.20191025
    cp -r * /usr/src/8812au-5.6.4.2_35491.20191025
    dkms add -m 8812au -v 5.6.4.2_35491.20191025
    Error! DKMS tree already contains: 8812au-5.6.4.2_35491.20191025
    You cannot add the same module/version combo more than once.
    make: *** [Makefile:2303: dkms_install] Error 3
     

  3. Ludwig says:

    how fix this guys ?

    • Alex says:

      It looks like this driver is already installed. Try to remove it first (if you need it):

      sudo apt remove realtek-rtl88xxau-dkms
      
  4. Anonymous says:

    Your kernel headers for kernel 5.4.83-v7+ cannot be found at
    /lib/modules/5.4.83-v7+/build or /lib/modules/5.4.83-v7+/source.

  5. Cody says:
    make dkms_install
    mkdir -p /usr/src/8812au-5.6.4.2_35491.20191025
    cp -r * /usr/src/8812au-5.6.4.2_35491.20191025
    dkms add -m 8812au -v 5.6.4.2_35491.20191025
    
    Creating symlink /var/lib/dkms/8812au/5.6.4.2_35491.20191025/source ->
                     /usr/src/8812au-5.6.4.2_35491.20191025
    
    DKMS: add completed.
    dkms build -m 8812au -v 5.6.4.2_35491.20191025
    Error! Your kernel headers for kernel 4.4.0-19041-Microsoft cannot be found.
    Please install the linux-headers-4.4.0-19041-Microsoft package,
    or use the –kernelsourcedir option to tell DKMS where it's located
    make: *** [Makefile:2304: dkms_install] Error 1

    this is the error i keep receiving…… can you pls help with this

    • Alex says:

      Error! Your kernel headers for kernel 4.4.0-19041-Microsoft cannot be found.

      You use WSL, right? So none can help you. Think of WSL as a virtual machine with no hardware access.

      I mean, even if you can compile the driver, you still won't be able to use your Wi-Fi dongle.

  6. Kobayashi Neo says:

    This just short Tutorial for NEWBIE (like me!) for installing driver USB Wifi driver for Linux Debian and it’s derivatives (Debian, Ubuntu, Linux Mint, Pop! OS, Elementary OS, etc.)

    When you're switch to new OS distro or updating OS or accidently delete some part of software sometimes your Wifi driver are no support / no working and got blank your mind … Yup thats right !

    # First STEP to do :
    1. You only need YOUR SMARTPHONES and make sure also they have “Internet Mobile Data”.
    2. Then you need to opened “Developer Options” on your smartphone to do that first before.
    3. Open your phone “Settings” and find it “About Phone” and selected “Version Number” and then now repeated click up to (7x) seven times.
    4. Inside “Developer Options” find it or scrolling to the “Network” and selected “Select USB Configuration” and then select again to the “USB Ethernet (RNDIS)”.
    5. After this all you need is USB cable connected to your PC or Laptop and it’s done, now you ready online!

    # Second STEP to do :
    1. Installing GDebi (I’m using Geary on Pop! OS that are the same software). You can find GDebi in Ubuntu Software Center,  just search for it and install it from there.
    2. Then installing the latest “realtek-rtl88xxau-dkms” deb package from Kali’s repository.
    3. After this just type in your linux terminal “sudo reboot” to rebooting your PC or Laptop.
    4. It’s done , just try to check it out !

    I’m trying many times using this method when i switching to new OS distros or update Linux Kernel. This really saving my times and work to do! Thanks for your time to read this !

    Source :
    https://http.kali.org/kali/pool/contrib/r/realtek-rtl88xxau-dkms/
    https://developer.android.com/studio/debug/dev-options
    https://itsfoss.com/gdebi-default-ubuntu-software-center/

  7. ivanko says:

    hI! How to install AWUS036ACH driver in TAILS OS?

Leave a Reply to Alex Cancel reply

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