Installation Guide for Linux
Contents Ubuntu 16.04 LTS.............................................................................................................................3 1. Development Environment........................................................................................................3 2. Compile the Driver ....................................................................................................................3 3. 2.1. Compilation tool and kernel sources ......................................
4.1. Scan Wireless Networks (SSID)................................................................................................. 15 4.2. Connect to the AP ...................................................................................................................... 15 4.3. Enable DHCP client ....................................................................................................................
Ubuntu 16.04 LTS 1. Development Environment The development environment in Ubuntu is required as follows: Development Environment OS Ubuntu 16.04 LTS Kernel version 4.13.0-36-generic Gcc version 5.4.0 2. Compile the Driver 2.1. Compilation tool and kernel sources Before you compile the driver, please make sure you have the correct compile tool and kernel sources. In Ubuntu 16.
3. Load the Driver Here we show the 88x2bu.ko wireless driver loading process as an example. Run the following command to load the driver. $ sudo cp 88x2bu.ko /lib/modules/[kernel version]/kernel/drivers/net/wireless/ #[kernel version] is the directory name of the system kernel version $ sudo depmod –a $ sudo modprobe 88x2bu.ko Or directly use insmod to load the driver. $ sudo insmod 88x2bu.ko After loading the driver, run the following command to check if the driver is successfully loaded.
According to the command “cat /proc/version”, you could see your Mint system is compiled by gcc5.4.0, so we should use gcc5.4.0 to compile the driver. Generally, compatible kernel headers are already built in Mint, so you don’t need to separately download and compile the kernel sources. However, if no related kernel headers are integrated in your system, please install the kernel sources first. 2.2.
2. Compile the Driver Before you compile the driver, please make sure you have the correct compile tool and kernel sources. 2.1. Compile Kernel source Here we illustrate the instructions for local building to compile the driver for Linux. 2.1.1. Download and Install Tools Note: Before local building, make sure your raspberrypi system is connected to the internet. Install Git, bc and other related tools. $ sudo apt-get install git bc 2.1.2.
may take a few minutes. $ make –j4 zImage modules dtbs $ sudo make modules_install $ sudo cp arch /arm/boot/dts/*.dtb /boot/ $ sudo cp arch/arm/boot/dts/overlays/*.dtb* /boot/overlays/ $ sudo cp arch/arm/boot/dts/overlays/README /boot/overlays/ $ sudo cp arch/arm/boot/zImage /boot/$KERNEL.img Note: “-j4” refers to using Raspberry Pi3 and 4 to compile to accelerate the compilation process. Power off the development board of Raspberry Pi3 and then run the following command to confirm the kernel version.
$ lsmod Kali 2018.1 1. Development Environment The development environment in Kali 2018.1 is required as follows. Development Environment OS Kali 2018.1 Kernel Source Version 4.14.0-kali3-amd64 2. Compile the Driver 2.1. Install the Kernel Header File Before compiling the driver in Kali 2018, make sure you have installed and compiled the right Linux header file. Follow the instructions to install and compile the Linux header file. 2.1.1.
http://http.kali.org/kali/pool/main/l/linux Check the system version of Kali $ uname -r The system version we used here is shown as below. Download and compile linux-kbuild In the Kali download links, find the linux-kbuild file of your system. Here we choose linux-kbuild-4.14_4.14.17.-1kali_amd64.deb as an example. After downloading the file, use Terminal to go to the directory and run the following command to install the file. $ sudo dpkg -i linux-kbuild-4.14_4.14.17-1kali_amd64.
detailed linux-header information. Check the /lib/modules// directory and you will see a build link file. 2.1.3. Compile Driver Source Use Terminal to go to the driver directory. Run the following commands to compile the driver. $ make clean $ make After compiling, you can see a name of the chip.ko file is stored in the directory of the driver. 3. Load the Driver Here we show the 88x2bu.ko wireless driver loading process as an example. Run the following command to load the driver.
Use the Graphical Interface Ubuntu, Mint, Raspberry Pi and Kali all provide friendly graphical interface. After the adapter driver is successfully installed, you can use the graphical interface to manage your wireless settings. The interfaces for different system version are slightly different and here we use the interfaces for Kali 2018.1 as an example for illustration. 1. After successfully loading the driver, you will see a network connection icon in the task bar.
2. Select TP-Link_D003_5G and enter its password to connect to this network. 3. After connecting to this network, you can check its detailed wireless settings.
13
Use the Command Line You can use commands to manage your wireless setting in Linux. Here we use the interfaces for Kali 2018.1 as an example for illustration. 1. Identify the Device Inert the USB wireless adapter, and run the following command to check if the adapter is identified. $ lsusb 2. Create the Interface Run the following command to check if the wireless network interface is created. $ ifconfig 3. Change the Interface Status to Up Check if the WLAN interface is up.
4.1. Scan Wireless Networks (SSID) Run the following commands. $ wpa_cli –p /var/run/wpa_supplicant scan $ wpa_cli –p /var/run/wpa_supplicant scan_results 4.2. Connect to the AP 1) Open Run the following commands $ wpa_cli –p /var/run/wpa_supplicant remove_network 0 $ wpa_cli –p /var/run/wpa_supplicant ap_scan 1 $ wpa_cli –p /var/run/wpa_supplicant add_network $ wpa_cli –p /var/run/wpa_supplicant set_network 0 ssid '"tplink"' //tplink is the SSID of the desired AP.
$ wpa_cli –p /var/run/wpa_supplicant set_network 0 auth_alg SHARED $ wpa_cli –p /var/run/wpa_supplicant select_network 0 4) WEP 104 with open system $ wpa_cli –p /var/run/wpa_supplicant remove_network 0 $ wpa_cli -p /var/run/wpa_supplicant ap_scan 1 $ wpa_cli -p /var/run/wpa_supplicant add_network $ wpa_cli -p /var/run/wpa_supplicant set_network 0 ssid '"tplink"' $ wpa_cli –p /var/run/wpa_supplicant set_network 0 key_mgmt NONE $ wpa_cli -p /var/run/wpa_supplicant set_network 0 wep_key0 123456789012345678901
$ wpa_cli –p /var/run/wpa_supplicant add_network $ wpa_cli –p /var/run/wpa_supplicant set_network 0 ssid '"tplink"' $ wpa_cli –p /var/run/wpa_supplicant set_network 0 psk '"12345678"' $ wpa_cli –p /var/run/wpa_supplicant select_network 0 4.3. Enable DHCP client Run the following command $ dhclient wlan1 After running the command, the adapter will get an IP assigned by the AP. Then you can run the ping command to check if the wireless connection is successful. Note: 1.
gateway to the router’s LAN IP. $ route del default wlan0 $ route add default gw 192.168.1.1 //Delete the default gateway of wlan0 //Add the router’s LAN IP as the default gateway.