Wi-Fi WLAN wireless networking information
Obviously before you set up the wireless card on your computer you will need to become familiar with the basics of wireless and set up your wireless Router/Access Point. A good place to start is with the router documentation which often has a introduction to Wi-Fi. You will also probably have to look at the documentation to set up the Router. You may want to have a look at [WWW] the Wi-Fi entry on Wikipedia or [WWW] the technology overview of the Linux Wlan HOWTO however these are both a bit technical, it would be good if someone could find a simple newbie document and add it here.
First thing you'll need to do is get the [WWW] wireless-tools package (see SynapticHowto).
Some Wi-Fi Cards work out of the box, specifically the ones with the Orinoko, Prism2 or Atheros chipsets. If your card does not work out of the box, [SetupNdiswrapperHowto]. Some prism cards may not work out of the box however.
Set up your Wireless Router as an 'open' network. I.e. Turn off all security such as WAP in Mac Address restriction. However you should set your Network Name (ESSID) in your Router.
Using Graphical User Interface Tools
To see if your card is working goto Computer->System Configuration->Networking and see if your wireless network card is listed. Usually your wireless card is named wlan0 or ath0, depending on your chipset and the driver you are using. To determine what your wireless network card interface is called, you have to type iwconfig in a terminal (open up a Terminal Window by clicking Applications->System Tools->Terminal). If your card does not appear it has not been recognised either as the chipset needs additonal support from something like the [SetupNdiswrapperHowto] mentioned previously.
The next step is configuring your Card. Select the wireless network card entry (wlan0 or ath0) in the Networking window to check that wireless is working and click on Properties. This is where you set your Network Name. Normaly Configuration can be left as Automatic (DHCP). Chances are you have set up your wireless router as a DHCP Server, if not do so (refer to Router documentation). Click on OK.
Select the eth0 network and click on Deactivate button (if you have one - basicaly deactivate all Networks). Then select wlan0 and click on the Activate button. You should end up with the checkbox under Active for wlan0 checked and the others not checked. You can now fire up a web browser and see if you can browse the web. Alternativly the best way of checking if you have a working internet connection is to use ping. ping simply checks if a domain exists. Type
and you should get a line periodicaly saying 'Unknown host' if your internet conection is down or a line every second of so telling you how long it took to reach the host. To test only the network in case the DNS is down, you can use ping with the -n option, but then you have to give it a numeric IP address. A simple to remember one is
ping -n 184.108.40.206
Using the command Line
If you can browse the web your card is set up and working. If not we can try doing it another way. Start a Terminal Window and type
This will list your networks. The standard network is normaly called eth0. Stop this network by typing
sudo ifdown eth0
do this for all networks except for 'lo'. then start your wireless network by typing
sudo ifup wlan0
Check this has worked by typing ifconfig and if all is well try browsing the Web/ping. If it is not try the following
iwconfig wlan0 mode managed
iwconfig wlan0 channel 11
iwconfig wlan0 essid networkname
mode managed is what you want if you are connecting to a wireless router. The channel and esidd will have to be set the same as your router.
You have your network working but it is an open/unsecure network. Refer to your Router documentation to find out how to set up a secure network. Eatch Network card (Either wired or wireless) has a unique number called a Mac Address. Most wireless routers allow you to restrict the Mac Addresses that can connect to them. To find out your Mac Address type
This is listed as the first line after !HWaddr.
It is also good to set up encryption (we will use WEP encryption as it is well supported in Ubuntu) as Mac Address restricting can be circumnavigated. Firstly you will have to set up your router to use WEP encryption. This the rest of this paragraph is a bit vage as a different routers work slightly differently but should give you an idea. Refur to your router manual but WEP setup should be under something like wireless->security on the web interface of your router. Generaly you then enable WEP security and choose a key size. The bigger the better but the example here is using 64 bit (sometimes refured to as 40 bit) keys. Generely you can then type a Passphrase (a password but you should use a few words next to eatch other). Generaly you then click on something like Generate and several keys (normally 4) are created. One of them will be marked as the default key, this is the one we will use.
There is a field under Network Name (ESSID) in Computer->System Configuration->Networking->(wlan0) Properties. The idea is that you put your key here but I cant get it working. What I have manages to get working is typing
iwconfig wlan0 key FEFEFEFEFE
Where FEFEFEFEFE is the WEP key in Hexadecimal. Hexadecimel uses 0-F rather than 0-9 (This is base 16 with A representing 10 all the way up to F = 15 and then 10 representing 16.). This is the way all keys are specified. You should then be able to browse the web/ping. Not entirly sure but it seems sometimes you have to wait a minute or so for it to start working.
Adding it to /etc/network/interfaces
/etc/network/interfaces is the file where your network interfaces are defined, eth0 being the standard wired interface. To make the wireless network come up when you start your computer put # in front of 'auto eth0' (to stop it automaticaly starting) and add something like the following lines.
iface wlan0 inet dhcp
name Wireless LAN card
I have written a small script to have my laptop automatically pick a WLAN network of several configured. It uses the wireless utils to scan for known/open networks on "ifup interface". The script wlan-scan.sh looks like this:
ip link set $IFACE up
iwlist $IFACE scan 2>&1 | grep -v "^$IFACE" | grep -v "^$" | \
sed -e "s/^\ *//" \
-e "s/^Cell [0-9]\+ - /#/" \
-e "s/^#Address: /#AP=/" \
-e "s/^Quality:\([0-9]\+\)\/.*$/QUALITY=\1/" \
-e "s/^.*Channel \([0-9]\+\).*$/CHANNEL=\1/" \
-e "s/^ESSID:/ESSID=/" \
-e "s/^Mode:/MODE=/" \
-e "s/^Encryption key:/ENC=/" \
-e "s/^[^#].*:.*//" | \
tr "\n#" "|\n" \
ip link set $IFACE down
while read glob scheme; do
AP=""; QUALITY=""; CHANNEL=""; ESSID=""; MODE=""; ENC=""
for i in $SCAN ; do
for j in $(echo $i | sed -e "s/|/ /g" ) ; do
case $j in
case "$AP,$ESSID,$ENC,$MODE,$CHANNEL" in
and is used with the mapping primitive of the interfaces file.
Mine looks like this:
map 00:FE:FE:FE:00:00,"MY_NET",*,*,* wlan0-home
map *,"COMPANY",on,Master,* wlan0-office
map *,*,off,Master,* wlan0-open
iface wlan0-home inet dhcp
iface wlan0-office inet dhcp
# This is a fallback, selected for all unencrypted WLANs
iface wlan0-open inet dhcp
Please report if this does not work for you (or if it does;-).
Wi-Fi is most useful on a laptop. Taking your laptop everywhere also involves changing networks quite often. It is quite bothersome having to change this everytime you want to hook up to a different network.
To solve this a number of programs have been developped that automagically bring up your wireless network interface when a network has been detected. The older encryption method WEP has been superceded by WPA. For setting up WPA, see the the description of setting up wpa_supplicant in the WPAHowto. However wpa_supplicant still has issues with some drivers. Especially roaming between old WEP networks isn't well supported with wpa_supplicant, therefor has a look at the older [WWW] waproamd.
Some people might prefer a script to do network switching, have a look at:
Other people might prefer a GUI tool to do network switching though, have a look at:
[WWW] !WiFi Radar
[WWW] Gnome Net Applet
[WWW] Red Hat's Network Manager