How to connect to WPA / WPA2 in Ubuntu

A simple google search My personal experience confirms: connecting to WPA / WPA2 in Ubuntu can be a real headache. The solution? Well, so far I had no choice but to configure my home Wi-Fi with encryption WEP, instead of WPA or WPA2. The problem is that while not many geeks or "hackers" know how to do it, WEP networks have been shown to be very vulnerable. Hey! There is even even videos on Youtube that explain how to 'hack' them. That solution, while not the best, worked for me… until now. The other day, I had to go to an office and there they had wifi but WPA2. Huge was my disappointment to find out and even greater was my anger to think that Ubuntu still cannot easily connect to a network with that encryption.

Finally, after several months of research, I was able to connect. Here is the explanation of how I did it.


First of all, I must clarify that I do not use the free drivers for the wifi (based on Atheros) of my laptop (Compaq Presario CQ60-211DX). Unfortunately, the free driver, for reasons I still don't understand, made the media files I played sound cut off and the videos look even worse. Not to mention the flash videos. They looked real. Once I changed the wifi driver, everything was solved (WTF !!).

Anyway, as I said, these were the steps I followed. The first three I had already done a long time ago, even when I was using WEP on my Wi-Fi, because of the little problem that I just described.

Windows wifi driver installation.
1) install ndiswrapper-common y ndisgtk

sudo apt-get install ndiswrapper-common ndisgtk

2) Go to System> Administration> Windows Wireless Drivers. Install the driver of my Windows xp, in my case of 64 bits.

3) in /etc/modprobe.d/

3.a) In the blacklist.conf file: add blacklist ath5k & blacklist ath9k (in separate lines)

sudo gedit /etc/modprobe.d/blacklist.conf

3.b) In the blacklist-ath_pci file: add ath_pci

sudo gedit /etc/modprobe.d/blacklist-ath_pci

In 1 and 2 what we did was to register the Windows driver to be used by our Ubuntu when booting. In 3, we did the other way around, we disabled the free wifi driver so that it does not start when Ubuntu boots.

Connection to WPA / WPA2

1) install wpa_supplicant

sudo apt-get install wpasupplicant

2) Next, what we have to do is due to a bug in ndiswrapper. Apparently wpa_supplicant doesn't run with the necessary priority. Therefore, every time we want to connect, we have to open a terminal and write

sudo renice +19 $ (pidof wpa_supplicant)

Immediately afterwards, try connecting to the network with WPA / WPA2 encryption.

3) You may have to try a couple of times (I repeated step 2) until it works. If after 6 or 7 times it doesn't work, configure the wpa_supplicant configuration file to match the characteristics of the network you are trying to connect to.

sudo gedit /etc/wpa_supplicant.conf

I know, it is not the ideal solution but it works. I think the difficulty with wpa_supplicant arises from the bug in ndiswrapper. Otherwise, I get the impression that everything would be easier. On the other hand, the connection to WPA / WPA2 networks should be "cleaner" or "transparent" for the user.


Leave a Comment

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

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   jhona said

    I'm going to try, it connects me well with Ubuntu, when it insists, but I'm trying with back track and nothing at all, let's see, there should be a patch for that bug.