Home > Linux, Tech > HOWTO: WPA2 under Ubuntu 5.10 with a WPC54G v3 (Broadcom)

HOWTO: WPA2 under Ubuntu 5.10 with a WPC54G v3 (Broadcom)

December 28th, 2005

Over the holiday weekend I took my old Sony VAIO notebook and loaded Ubuntu Linux on it. As a desktop / end-user distro I’m very impressed with Ubuntu - it is easy to use and configure. Unfortunately, I had some trouble getting my wireless card to work with WPA2 authentication to my wireless network at home. From looking at the Ubuntu forums it seems like this is a common problem. There are some helpful guides; however, none I found covered how to use WPA2 Pre-Shared Key authentication specifically. Fortunately by reading the man pages and some trial and error I was able to get it working.

Here are the steps:

  • download the appropriate driver for your card -> Linksys WPC54G v3
  • from the download extract the driver file (bcmwl5.sys) and inf file (LSBCMNDS.inf)
  • fire up the Synaptic Package Manager and install wpasupplicant & ndis-wrapper
  • open a shell and change directory to the location the driver and inf file were extracted to
  • install the driver: sudo ndis-wrapper -i ./LSBCMNDS.inf
  • check that the driver was installed correctly: ndiswrapper -l if it was installed correctly it should output “driver present, hardware present”
  • write the module configuration file: sudo ndiswrapper -m
  • load the module: sudo modprobe ndiswrapper
  • add ndiswrapper to /etc/modules so the kernel module is loaded at boot time

Now on to the fun of configuring wpa_supplicant to handle the WPA2 authentication for the interface.

  • open the /etc/wpa_supplicant.conf file in an editor
  • edit the network stanza as shown below substituting myssid and mypsk with the appropriate values for your network

network={
ssid=”myssid
proto=WPA2
key_mgmt=WPA-PSK
psk=”mypsk
}

  • open /etc/default/wpasupplicant in an editor
  • change ENABLED to 1
  • change the OPTIONS argument to have values appropriate for your adapter. For my WPC54G v3 I used the following:

OPTIONS=”-i wlan0 -D ndiswrapper -c /etc/wpa_supplicant.conf”

  • open the /etc/network/interfaces file in an editor
  • add entries for the wlan0 interface - on my notebook I desire the wireless card (wlan0) to be the primary interface. My configuration follows below:

# The primary network interface
auto wlan0
iface wlan0 inet dhcp
pre-up /etc/init.d/wpasupplicant start
pre-up sleep 5

  • and we are done

This leaves you with a wlan0 interface that will start automatically, is configured via DHCP, and prior to bringing the interface up the system will start wpa_supplicant to handle the WPA2 authentication so the card can associate with your WLAN.

I found the following to be helpful resources in getting it working:

Hopefully this is helpful to anyone else who is struggling to get it working.

Linux, Tech

  1. February 10th, 2006 at 04:20 | #1

    Thank you - my laptop is now on the wireless LAN thanks to your advice!

  2. François-Xavier Eon
    February 11th, 2006 at 05:41 | #2

    Same here,THX! I hope you don’t mind I translated it in french and adapted it in the french ubuntu forum (With a link to this page saying that I found this page very useful).

  3. François-Xavier Eon
    February 11th, 2006 at 06:25 | #3
  4. February 11th, 2006 at 06:28 | #4

    I’m glad you both found it useful :)

  5. Derk
    March 6th, 2006 at 13:16 | #5

    Hi I am new to linux and want to get rid of windows….soo i installed ubuntu breezy! Everything works except my wpc54g v3. i did what you said above with ndiswrapper! and when i type iwlist wlan0 scan I get my router in the list, but it doesn’t connect with it! I did this: sudo iwconfig wlan0 essid my network channel 11 mode Managed key mywebkey

    then did: sudo ifup wlan0
    he is trying to connect to the dhcp but doesn’t do that….I am sure i filled in the correct key etc! I had it worked on a wrt54g router but at home I use a dlink 624+ and for some reason under linux he finds it but can’t connect to it! in windows everything works great….

    can somebody help me, if you know my problem please mail me to derkDOTdukkerATgmailDOTcom

  6. Ruggero
    August 23rd, 2006 at 21:04 | #6

    I have tried your instructions (Ubuntu 6.06) but I got stuck at the configuration of the wpasupplicant sw.

    There is no file like /etc/default/wpasupplicant, where can I find a complete example to copy?

    My wpa example conf file has an initial entry: ctrl_interface=/var/run/wpa_supplicant
    Shall I remove this or leave it? There is no such file as /var/run/wpa_supplicant

    Also in my case, the wireless is listed as eth0, shall I kill those lines and use wlan0 or use eth0 instead?
    Thank you if you can help me, I am not a Linux expert.

  7. August 25th, 2006 at 17:39 | #7

    Hey Ruggero,

    The instructions were for Breezy (5.10) not Dapper (6.06) so they probably won’t work without modification. Did you install the wpa_supplicant package? Since none of the files seem to exist this would seem to be the case.

    You might want to check the Ubuntu forms and/or Wiki as there should be a guide specific to Dapper.

    Good luck!

  8. Metaljaz
    January 15th, 2007 at 09:34 | #8

    hope you don’t mind. i grabbed your instructions and posted it in the ubuntu site to help someone else out.

  9. giwrgos
    February 17th, 2007 at 06:15 | #9

    I have a problem loading the module. It appears the below message when I write “sudo modprobe ndiswrapper”

    FATAL: Error inserting ndiswrapper (/lib/modules/2.6.17-11-generic/kernel/drivers/net/ndiswrapper/ndiswrapper.ko): Invalid argument

  10. djawk
    March 5th, 2007 at 22:32 | #10

    giwrgos: Try the following:

    sudo apt-get install ndiswrapper-utils-1.8
    sudo rm /usr/sbin/ndiswrapper
    (OR back it up instead)
    sudo ln -s /usr/sbin/ndiswrapper-1.8 /usr/sbin/ndiswrapper

    and then try again.

  11. Prakhar Mishra
    April 17th, 2007 at 13:25 | #11

    I am happy with linux &want to go deep into it.
    please help me out how to install the driver.

  1. No trackbacks yet.