I recently bought a TP-Link AC600 USB WiFi adapter to install on a Linux server. Prior to purchasing, I did research to ensure that, yes, there are drivers/libraries available for Linux and there are plenty of folks using the adapter successfully with a Linux box.
Renaming the Adapter
To make things easier to manage, the first thing I recommend doing is changing the name the OS uses to reference the adapter. In my case, the adapter’s default name was a very unwieldy wlxf0a7316xxxxx. Changing this is as easy as adding a file to the /etc/systemd/network folder.
Linux uses the current naming scheme for adapters based on the hardware type and location of the device. Whereas the previous scheme used eth0 for the first onboard network card, the new scheme would call this adapter eno1. It works like this:
- en= ethernet
- wl= wireless
- o= onboard
- s= PCI Express slot
- p= physical location
- (If there is an additional portion of the scheme for USB, I haven’t found it.)
Finally, give an adapter number. 1, 2, 3, etc…
I am naming the adapter “wl” for wireless, “s” for PCI Express slot, “1” for the first adapter. “wls1”
The new file should have a naming scheme of priority-name.link. Here the naming scheme should be “10-wls1.link”. The text in the file should be the following:
Reboot so the OS uses the new name for the adapter.
Installing the Drivers/Libraries
Now on to getting the adapter to work. I used the steps from Senthilkumar Palani’s (Sk) page, but I’ll go ahead and post my own version here. I’m using a Debian based system.
Ensure your OS detects the TP-Link adapter.
$ lsusb
Ensure your Kernal and Kernal header files are the same version.
$ sudo apt install "kernel-devel-uname-r == $(uname -r)"
Download the drivers. Here Sk downloads all the libraries at one time, but for some reason this didn’t work for me, so I pulled each one down by itself.
$ sudo apt install dkms $ sudo apt install git$ sudo apt install build-essential $ sudo apt install libelf-dev
Download the rtl8812au repository from GitHub.
$ git clone https://github.com/aircrack-ng/rtl8812au.git
Change directories into the rtl8812au directory.
$ cd rtl8812au/
Install the adapter.
$ sudo make dkms_install
Unplug the TP-Link adapter and plug it in again. You should see the green LED start to blink. Then verify the driver is installed by using the command:
$ sudo dkms status
You should see something like this:
8812au/5.6.4.2_35491.20191025, 6.1.0-18-amd64, x86_64: installed
Adding the Adapter to a Wireless Network
Verify the name of the wireless adapter. (This is the name you gave it in the beginning.)
$ nmcli d
Ensure the WiFi radio is on.
$ nmcli r wifi on
If you are connecting to a wireless network that is broadcasting the SSID, list the networks.
$ nmcli d wifi list
To connect to the wireless network, use this command:
$ nmcli d wifi connect home_wifi password <password>
To connect to a wireless network that is NOT broadcasting the SSID, use the following commands. Here the con-name is a value you set which needs to have between 8-63 characters or 64 hexadecimal characters in order to specify a full 256-bit key.
$ nmcli c add type wifi con-name <name> ifname wlp1 ssid <ssid>$ nmcli c modify <name> wifi-sec.key-mgmt wpa-psk wifi-sec.psk <password>$ nmcli c up <name>
At this point your wireless adapter should have an understandable name. The adapter should be working, and it should be connected to your wireless network.
I hope this helps someone besides me.
Robba