Linux.com

Home News Enterprise Computing Networking Making wireless work in Ubuntu

Making wireless work in Ubuntu

By Benjamin Mako Hill, Jono Bacon, Ivan Krstic. David J. Murphy, Jonathan Jesse, Peter Savage, Corey Burger

This article is excerpted from the newly published book The Official Ubuntu Book . © Copyright Pearson Education. All rights reserved.

Simply click on the Network-Manager icon to see all available wireless networks, and click on the network to connect to it. If wireless authentication is needed, be it WEP, WPA, or 802.1x, a network-manager dialog will pop up asking for your authentication details.

If network manager does not solve the problem, the first step should be to see which driver your wireless card needs. Do a search for your card on Google and in the Ubuntu Forums to find out which driver you need. Many of the drivers are already included in Ubuntu, but some newer drivers may not be present.

Next, you need to find out if the driver is loaded. As an example, if you have an Intel Centrino and it uses the ipw2200 driver, run this command:

sudo lsmod | grep ipw2200

Replace ipw2200 with the relevant driver for your card. If you get some lines returned, the driver is loaded and working. If nothing is returned, your card is either not supported or the driver is not included in Ubuntu. You should refer to the Ubuntu Forums for further support.

With the card identified, you now need to get connected. The easiest way to do this is to select System -> Administration -> Networking. Inside this tool you should see an icon for your wireless card. Select it and click the Properties button. Add the name of the wireless network and a password if applicable. If you are using a normal password such as s3cr3tpass, select Plain (ASCII) from the Key type box. If you are entering the long numeric password, use the Hexedecimal option. If you don't have a password on your wireless network, leave the Key type and WEP key boxes empty.

If you are automatically assigned an IP address, use the Configuration box to select DHCP. Otherwise, select Static IP Address, and enter the details of your network in the boxes.

For more information, see the Ubuntu wiki.

Using WPA

To use WPA, you need a supported card. Such cards are listed on the WPA Supplicant Web site. Common drivers that support WPA include ipw2200, ipw2100, and madwifi.

To use WPA (Wi-Fi Protected Access) with wireless cards in Ubuntu, the wpasupplicant package must be installed. After installing it, edit /etc/wpa_supplicant.conf. Networks are configured by adding network blocks to the configuration file. Each network block can also be assigned a priority so if both networks are seen, the higher priority network is chosen. Examples for common network configurations can be found in /usr/share/doc/wpasupplicant/examples/wpa_supplicant.conf.gz.

Some configurations require certificates that should be available from the network administrator. WPA Supplicant can also configure your wireless card to use unencrypted networks, as noted in the example file. After writing the file, edit /etc/default/wpasupplicant and change the ENABLED, DRIVER, and INTERFACE options. The DRIVER option should match the type of wireless device being used. Available drivers can be viewed by typing:

wpa_supplicant -help

To start the Supplicant run:

/etc/init.d/wpasupplicant start

Lastly, wpasupplicant should be added to STOP_SERVICES in /etc/default/ acpi-support to ensure it functions properly after a system suspend or hibernation.

To check if the connection is working, run:

sudo wpa_cli

This command gives information on the current connection along with scrolling logs to indicate the current status. By default wpa_cli must be run as root. Status will show what network the wireless card is currently connected to and parameters about the link. Scan causes the supplicant to look for a new access point while scan_results will display what access points are locally accessible to the machine. As soon as the supplicant authenticates, ifplugd should start the interface with ifup, and networking will be available shortly. If it seems that the supplicant is not working it may be that a different driver must be selected in the /etc/defaults/wpasupplicant configuration file. Also, some cards cannot operate in a mixed TKIP/CCMP (types of encryption) mode. If it appears the PTK listed in the log from wpa_cli is CCMP but that the GTK is TKIP, setting the pairwise and group entries of a network configuration block to TKIP may fix the issue.

 

Comments

Subscribe to Comments Feed
  • EH Yeo Said:

    My new PC is booted up with Ubuntu Linux. I am connected to my WIFI via WPA security. WIFI icon shows that I am connected to my Wireless Router. But my Firefox browser can't connect to anywhere. I am also unable to ping my Wireless Router. Any tip on how to resolve this issue?

  • Jeff Schwager Said:

    Your DNS may not be set up. You can have a connection to a router, but without the proper DNS settings, it won't know how to translate web addresses to the IP address of the associated web servers. Thus, you can't surf the web.

  • Jeff Schwager Said:

    As to why your Wireless Router isn't responding to your pings, is it set up to respond to pings?

  • @rafffek Said:

    Wifi works well with torrents coming with over 1mbs but web browsing is very very slow on my laptop toshiba satellite L500

  • rich Said:

    im used to Microsoft and i got a laptop Gavin to me and it has Linux and i dont know how to do wifi on it can anybody help me and by the way i dont know to much about Linux i know alot about Microsoft but not this can somebody help me

  • anca Said:

    wifi stops working every 2min, really annoying (doesnt stop with my other computer) any tips? thnx

  • Jim Shephard Said:

    I too am having trouble with WIFI on my older Toshiba L25-S121 laptop. I don't really want to open it up to look at the internal WIFI card to get the driver if it is avaliable. Does someone know off hand what driver applies to this machine. I experience extremely slow WIFI performance. The hardwired networking works just fine so I know that my hardware in the laptop for the hardwired networking is OK as well as my repeater and my DSL. I am and old unix person but not too familiar with linux at this point having just installed Ubuntu 14.04 on my laptop. Thanks for any help!

  • faisal kasuti Said:

    my WiFi connection doesn't work and when i click on the connection icon all it shows in the drop down menu is VPN settings...piz hep as soon as possible

  • Alan Said:

    I am trying to bring up a CNC (computer numeric controlled) control for a mill that is running LinuxCNC, essentially an Ubuntu installation. I have an existing WPA wireless network I want to connect to that is using an Apple Time Capsule (but the DNS is an Apple Airport Extreme). The odd thing is that when I look at my wireless networks on the Ubuntu box, I can see lots of SIDs near me, but can't see my own (which is in the same room and would definitely be the strongest signal). The network card came with a driver but I cannot get a clean compile when I do a 'make'. What causes some networks (even those protected with WPA) to be listed on Ubuntu and not others? And, more importantly, how do I fix this. Thanks!

Upcoming Linux Foundation Courses

  1. LFD312 Developing Applications For Linux
    05 Jan » 09 Jan - Virtual
    Details
  2. LFS220 Linux System Administration
    05 Jan » 08 Jan - Virtual
    Details
  3. LFD331 Developing Linux Device Drivers
    12 Jan » 16 Jan - Virtual
    Details

View All Upcoming Courses

Become an Individual Member
Check out the Friday Funnies

Sign Up For the Linux.com Newsletter


Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board