When the device is inserted to a USB port on the machine, the rtl8192cu module should be loaded automatically.
Load wifi module driver
First, check if the driver is automatically loaded on your machine with
lsmod | grep 8192.
If the result shows that the “8192cu” driver module is loaded, you have nothing left to do to load the module. If the result is nil, continue.
If it shows some other “…8192…” driver, uninstall it with rmmod -r .
Find the latest linux driver download address from Edimax:
Go to the Edimax website
-> Communications Network ICs
-> Wireless LAN ICs
-> WLAN NIC
-> IEEE 802.11b/g/n Single Chip
-> “Software: Drivers and Utilities”
-> “Step 1. Select one or more models”: check the box by RTL8192CU) and use in the correct line below:
mkdir -p /home/USERNAME/wifidriver cd -p /home/USERNAME/wifidriver wget ftp://WebUser:wK9xBuD5@126.96.36.199/cn/wlan/RTL8192xC_USB_linux_v3.4.4_4749.20121105.zip unzip RTL8192xC_USB_linux_v3.4.4_4749.20121105.zip bash install.sh
Insert the Edimax device into a USB port and check to see if the module has been loaded correctly automatically:
lsmod | grep 8192cu
If nothing is returned, the module can be loaded manually:
Configure wifi connection
Install dependencies and kill network management utilities for configuration:
apt-get -y install wpa_supplicant psmisc sudo stop network-manager sudo killall wpa_supplicant sudo killall nm-applet
Perform the SSID & password config
wpa_passphrase "YOUR_ESSID" | sudo tee /etc/wpa_supplicant.conf
-> then type your password
wpa_supplicant –d wext -B -c /etc/wpa_supplicant.conf -i wlan0
If you get your IP address automatically assigned by your router (most users) by DHCP just use the following (Note that you may have configured your router to assign a static IP to your server but from your server’s perspective this is still an auto assignation from your router so do this):
If you want to configure a static IP then use:
ifconfig wlan0 192.168.1.12
You should now be able to ping your router by IP:
Now add the default gateway using the IP address of your router:
route add default gw 192.168.0.2
You should be able to ping the net at large now (Google’s IP = 188.8.131.52):
Add DNS. This one is Google’s free DNS service which is pretty fast and reliable so a great choice – however there are privacy implications which we’ll not get into here). You could also use your ISP DNS servers which you should have been given when you joined them or which will be the ones defined in your ISP provided modem/router.
echo "nameserver 184.108.40.206" | sudo tee /etc/resolv.conf
You should be done now, test by pinging Google:
Make persistent through a reboot
This will not last through a reboot, to make this persistent we need to make a little script:
mkdir –p /usr/bin/wifi_connect nano /usr/bin/wifi_connect/scripts/wifi_connect.sh
#!/bin/bash wpa_supplicant -d wext -B -c /etc/wpa_supplicant.conf -i wlan0 dhclient wlan0 route add default gw 192.168.0.2 echo "nameserver 220.127.116.11" | sudo tee /etc/resolv.conf chmod 755 /usr/bin/wifi_connect/wifi_connect.sh
You should now add to crontab or rc.local to run at startup. Crontab is a task scheduling tool in linux, whereas rc.local is a script which runs at boot so you can add things to it to make them run at startup.
The easiest way I found to add to crontab is through Webmin (see this post for Webmin installation guide).
To manually add to crontab you can do this:
sudo echo '@reboot /usr/bin /wifi_connect/wifi_connect.sh xbindkeys' >> /etc/crontab
Or to add to rc.local:
cp /etc/init.d/rc.local /etc/init.d/rc.local.old nano /etc/init.d/rc.local
Add this above ‘exit 0’: