April 25, 2007

Going Ubuntu's Way - The WiFi Edition

As promised, I got the resources for setting up a WiFi card to connect to an AP. However, this is just a brief overview of what needs to be done in order to get a WiFi card working on Ubuntu Linux.

The first thing to do is to check if your WiFi card is natively supported by Linux. What I mean by "natively supported", means that the manufacturer of the card already has an existing driver for you to use. Anyway, head over to this site --> http://linux-wless.passys.nl/ to check.

If your card is listed, you're lucky and you'll just need to follow the steps outlined by the manufacturer to get started.

For the rest of us, we'll need to do a little bit of work. However, thank goodness for this little utility called "ndiswrapper". (^^)

By default, this utility is not installed, but is an optional software, which means you'll need the Ubuntu CD close by. Besides that, also keep the original CD of your WiFi card close by as well.

What ndiswrapper does is to create a Windows kernel for which the WiFi card's driver can be loaded and thus used in the Linux environment.

1. Installing ndiswrapper
- Follow the steps as listed here http://ubuntuguide.org/wiki/Ubuntu:Edgy#How_to_install_Windows_Wireless_Drivers_.28Ndiswrapper.29
- Ensure that you have your WiFi's Windows driver handy.

2. Setup the WiFi card
- There are a variety of ways to setup the WiFi card, one of which is to enable via the Networking Tools. However, in my humble opinion, I'll always go for text-based configuration... Just to be sure. (^^)

(0) Open the "/etc/network/interfaces" file using a text editor. Remember to "sudo" in order to be able to write, i.e. if you're not "root" user. (**I know.... I know... Setting up networking stuff via configuration files can be a pain in the *ss, but I'm just a die-hard console-based administrator, ok??)

(1) Add the following lines to the file:

auto wlan0
iface wlan0 inet dhcp
pre-up wpa_supplicant -Bw -Dwext -iwlan0 -c/etc/wpa_supplicant.conf
postdown -killall -q wpa_supplicant

NOTE 1: If your network is setup as DHCP, just specify as dhcp, if it is static, then, the following lines should be used instead:

auto wlan0
iface wlan0 inet static
address [your-ip-address]
netmask [netmask]
gateway [network-gateway-ip-address]
pre-up wpa_supplicant -Bw -Dwext -iwlan0 -c/etc/wpa_supplicant.conf
postdown -killall -q wpa_supplicant

NOTE 2: The command listed is using "wpa_supplicant" where if your WiFi AP uses WPA as an encryption, you will have to use this in order to get your WiFi working with WPA. For more information about other forms of encryption, please refer to the list of resources below, or Google.

(2) Save the file. (Obviously-la...)

(3) If your WiFi uses WPA as a form of security, you will need to configure the "wpa_supplicant" application prior to restarting the network services.

(3.1) Create a file called "wpa_supplicant.conf" under the "/etc" folder.

(3.2) Add the following lines to the file:


NOTE: The values for [your-wifi-ssid] and [your-pre-shared-key] should be enclosed in double-quotes (").

(3.3) Save the file. (DUH!!!)

(4) Restart the network interfaces by issuing the following command:

sudo /etc/init.d/networking restart

(5) If all goes well, issue the following command to view the list of network interfaces configured on your system:

ifconfig -a wlan0

The output should tell you about the status of the WiFi card, where the IP address should be obtained (if using DHCP) or configured (if static). However, the important line to look out for is this:


This indicates that the card is up and running. If you open up your Networking Tools, you should be able to see if the WiFi card is enabled or not.

(6 - optional) If you want to test the network interface, use the "nslookup" or "ping" commands to see that the WiFi card is setup properly. If all goes well, you may very well use the WiFi card to surf the net or setup Gaim or any messaging software of your choice... supported by Ubuntu, that is... (^^)

For more information on setting up Ubuntu or WiFi, go to:
Hope that all goes well. When in doubt, Google it!

No comments:

Post a Comment

Please feel free to add your comments. However, take note that your comments may be edited or deleted as seen fit by the author of this blog.

Take note that the author of this blog may not be held responsible for the comments which may be insensitive, vulgar or controversial.

Related Posts with Thumbnails