Further Clarification:
There's some history that's been lost since the writing of this guide. Originally, (say, back in February 2006), Dapper had NO native support for WPA + NetworkManager and had NO plans of including it before the Dapper release. Fortunately, some time later, Dapper was delayed and WPA + NetworkManager support WAS included after all. Especially now that Dapper, Ubuntu 6.06, has been released, you should ALWAYS try installing the network-manager and network-manager-gnome or knetworkmanager packages FIRST. This can be done for Ubuntu by the following code:
Code:
sudo apt-get install network-manager-gnome
or for Kubuntu with the following:
Code:
sudo apt-get install knetworkmanager
ONLY in the event that this does not work should you try the below guide, using it as a base to either get WPA + NetworkManager working or at least get your foot in the ground. This guide was originally written for getting ipw2100 and ipw2200 chipsets working, but nowadays these already work in Dapper's NetworkManager for most people! However, the guide is slowing expanding to include other drivers, including the Atheros-based chipsets' Madwifi drivers, which have made active improvement since Dapper's version of them.
Introduction
NetworkManager is a fancy-dancy service and gnome applet that allows you to browse and connect to wireless networks. NetworkManager can also switch to a wired network, if available. Unfortunately, previous versions of NetworkManager have been unable to manage or connect to WPA networks. When you are done with this guide, you will have the latest version of NetworkManager and wpa_supplicant installed from CVS and have WPA1 and WPA2 support with both TKIP and AEP options working correctly.
This guide assumes that you already have an active Internet connection during setup. This guide also installs, at best, some beta-quality software. Although I haven't experienced any problems, some may exist, and you yourself are responsible for any problems that you get into as a result of this guide. It may hose your system. Probably not, but if we could predict when our systems get hosed, then why would we ever let that happen?
Potential bad news: This guide is only for Ubuntu Dapper. Breezy and below users don't have a new enough kernel.
Downloading required tools
First thing's first, you need the Universe repository enabled. If you haven't done this yet, see here:
https://wiki.ubuntu.com/MOTU/Package...iversePackages
This HOWTO also assumes that you've created a "wpa" directory in your home directory, i.e. that you type in at a console:
Let's get some nice compiling tools and headers if we don't already have them.
Open up a console and type:
Code:
sudo apt-get install build-essential cvs subversion automake1.9 gcc-3.4
Also, let's grab the linux-headers so that we can compile drivers:
Code:
sudo apt-get install linux-headers-`uname -r | cut -d'-' -f3`
The above command installs a linux-headers-X metapackage. Note: If you switch kernel platforms from, say a 386 to a 686 kernel, you WILL need to run the above command again to install the headers for that kernel.
Drivers
There are two things we're going to try here--updating to the latest drivers and then installing the latest NetworkManager plus its network-related dependencies. First, let's take care of the drivers.
ieee80211 Subsystem (for some drivers, see below)
Download the ieee80211 subsystem for the following drivers:
ipw2100
ipw2200/2915
You don't need to for the following:
madwifi, since madwifi doesn't use it
You really shouldn't install it with the following:
ipw3945, since ipw3945 breaks with it
Your mileage will probably vary with other unlisted drivers. If your own chipset's drivers are not on this list and you know enough about them, feel free to reply with the necessary info to enhance this list.
Download this file to your ~/wpa directory:
http://prdownloads.sourceforge.net/i...4.tgz?download
Start a console and enter:
Code:
cd ~/wpa tar -zxvf ieee80211-1.1.14.tgz
cd ieee80211-1.1.14
sudo sh remove-old
sudo rm -rf /lib/modules/$(uname -r)/kernel/net/ieee80211
sudo rm -rf /usr/src/linux-headers-$(uname -r)/include/net/ieee80211*
sudo rm -rf /usr/src/linux-headers-$(uname -r)/include/config/ieee80211*
make
sudo make install
If you have an IPW2100 chipset
This section is for those who want to have the latest and greatest IPW2100 drivers.
If you have an IPW2200 or IPW2915 chipset, keep scrolling down until you see the section for that.
Download this file to your ~/wpa directory:
http://prdownloads.sourceforge.net/i...1.tgz?download
Start a console and enter:
Code:
cd ~/wpa
tar -zxvf ipw2100-1.2.1.tgz
cd ipw2100-1.2.1
sudo sh remove-old
make
sudo make install
Great, if there are no errors, you've got the newest drivers installed.
If you have an IPW2200 or an IPW2915 chipset
This section is for those who want the latest and greatest IPW2200/IPW2915 drivers.
Download this file to your ~/wpa directory:
http://prdownloads.sourceforge.net/i...3.tgz?download
Code:
cd ~/wpa
tar -zxvf ipw2200-1.1.3.tgz
cd ipw2200-1.1.3
sudo sh remove-old
make
sudo make install
Great, if there are no errors, you've got the newest drivers installed.
If you have an Atheros-based chipset (Madwifi drivers)
Code:
cd ~/wpa
svn checkout http://svn.madwifi.org/trunk madwifi
cd madwifi
make
sudo make install
Your Driver HowTo Here
If installing a newer driver for your wireless chipset fixed WPA + NetworkManager when it otherwise didn't work, reply so it can be included here!
A note about updating the drivers
This is a good time to add that if you want up-to-date IPW drivers, you'll need to reinstall the latest ipw drivers whenever you update kernels, even for kernel security updates through apt-get! A new kernel means that there are new drivers that must again be replaced with the newest ones.
NetworkManager and Dependencies
The second strategy is to update to the latest NetworkManager, beginning with some of its important dependencies.
Installing latest libnl from svn
In the console:
Code:
cd ~/wpa
svn co https://svn.suug.ch/repos/tgr/libnl
cd libnl
./configure
make
sudo make install
sudo mkdir -p /usr/local/lib/pkgconfig
sudo cp libnl-1.pc /usr/local/lib/pkgconfig/
Installing lastest wpaupplicant from cvs
Next thing we've got to install is the latest wpa_supplicant from cvs. If you already have a version of wpa_supplicant installed via the package manager, uninstall it. Although wpa_supplicant used to require a patch to work with NetworkManager, the patch is now included in the latest cvs version:
Code:
cd ~/wpa
cvs -d :pserver:anonymous@hostap.epitest.fi:/cvs login
cvs -d :pserver:anonymous@hostap.epitest.fi:/cvs co hostap
cd hostap/wpa_supplicant
cp defconfig .config
sudo apt-get install cdbs debhelper dpatch libssl-dev libreadline5-dev
make
sudo make install
Careful: Did you receive this error?
Code:
for i in wpa_supplicant wpa_passphrase wpa_cli dynamic_eap_methods; do cp $i /usr/local/sbin/$i; done
cp: cannot stat `dynamic_eap_methods': No such file or directory
make: *** [install] Error 1
If so, if you want to use the CVS version for now, edit the Makefile line 12 from this:
Code:
ALL=wpa_supplicant wpa_passphrase wpa_cli dynamic_eap_methods
...to this:
Code:
ALL=wpa_supplicant wpa_passphrase wpa_cli# dynamic_eap_methods
Then run "sudo make install" again!
Installing latest NetworkManager from svn
First thing's first. Uninstall the network-manager package using apt-get or Synaptic if it's currently installed. (I've recently edited this to reflect network-manager's switch from cvs to svn. Let me know if anyone has any issues.)
Now let's download the latest NetworkManager from svn:
Code:
sudo apt-get install debhelper cdbs gnome-common intltool libgnome-keyring-dev libdbus-glib-1-dev libiw-dev libgnomeui-dev libpanel-applet2-dev libglade2-dev libgconf2-dev libhal-dev libnl-dev libnotify-dev docbook-to-man dhcdbd libnotify-dev
cd ~/wpa
svn co http://svn.gnome.org/svn/NetworkManager
cd NetworkManager/trunk
gedit configure.in
By default, the compiler is set to treat warnings as errors. Unfortunately, there will probably be warnings, or at least there have been in the past, so we want to disable this setting. Press ctrl+f and search for Werror to find the line that looks like this:
Code:
CFLAGS="-Wall -Werror -std=gnu89 $CFLAGS"
...and remove "-Werror " such that it looks like this:
Code:
CFLAGS="-Wall -std=gnu89 $CFLAGS"
Save and close.
We have to edit another file:
Code:
gedit initscript/Debian/NetworkManager
And find where it (for some reason) says:
Code:
DAEMON=/usr/sbin/$NAME
And change it to read:
Code:
DAEMON=/usr/local/sbin/$NAME
Now we have to make just one more config change to get the applet to work properly:
Code:
gedit gnome/applet/nm-applet.conf
Add this in there (just below the <policy user="root">...</policy> block is a nice place):
Code:
<policy user="YOURUSERNAME">
<allow own="org.freedesktop.NetworkManager"/>
<allow send_destination="org.freedesktop.NetworkManager"/>
<allow send_interface="org.freedesktop.NetworkManager"/>
</policy>
(Be sure to replace YOURUSERNAME with your actual user name.)
Save and close. Now do the exact same thing to this file:
Code:
gedit src/NetworkManager.conf
Save and close.
If you don't do the above, then you'll probably get dbus security errors when you try to run nm-applet.
Now let's
Code:
./autogen.sh
make
sudo make install
Now we have to do some system-specific stuff that the svn version doesn't install by default:
Code:
sudo cp src/NetworkManager.conf /etc/dbus-1/system.d/
sudo cp gnome/applet/nm-applet.conf /etc/dbus-1/system.d/
sudo cp initscript/Debian/NetworkManager /etc/init.d/
sudo update-rc.d -f NetworkManager remove
sudo update-rc.d NetworkManager start 30 2 3 4 5 . stop 70 0 1 6 .
Hopefully that went well. Now there's a few dozen different services and drivers we could restart to get this working without rebooting, but let's just reboot instead.
Conclusion
When Ubuntu comes up, try running nm-applet from the console. You will have an icon in the notification area, and you should be able to use it to see and connect to WPA networks! If this is working properly, add it to the startup by going to the System menu on the gnome panel, Preferences, then Sessions. Go to the Startup Programs tab, and add nm-applet. Now the NetworkManager applet will start up automatically!
If it's not working properly and you want to further debug the problem, you can try this:
Code:
sudo killall NetworkManager
sudo NetworkManager --no-daemon
... as this will give you console output, for example, as to what's going on on the network side of things, since nm-applet will just return applet errors.
Phew! It's over now! Hopefully you're now enjoying your newfound WPA support and not reinstalling Ubuntu!
Uninstall
Network Manager:
Code:
sudo rm /etc/dbus-1/system.d/NetworkManager.conf
sudo rm /etc/dbus-1/system.d/nm-applet.conf
sudo rm /etc/init.d/NetworkManager
sudo update-rc.d -f NetworkManager remove
cd ~/wpa/NetworkManager/trunk
sudo make uninstall
wpa_supplicant:
Code:
sudo rm /usr/local/sbin/wpa_*
libnl:
Code:
sudo rm /usr/local/lib/libnl*
sudo rm -r /usr/local/include/netlink
sudo rm /usr/local/lib/pkgconfig/libnl-1.pc
Drivers:
Reinstall your kernel image from the Ubuntu repositories.
Code:
sudo apt-get install --reinstall linux-image-`uname -r`
sudo apt-get install --reinstall linux-restricted-modules-`uname -r`
Bookmarks