Revision 77 as of 2010-11-03 15:59:09

Clear message

Tag/tag.png

Style Cleanup Required
This article does not follow the style standards in the Wiki Guide. More info...

Troubleshooting Wireless Networks with Ubuntu

1. Introduction

This guide aims to assist in troubleshooting wireless networks on Ubuntu. Before undertaking the steps in this guide, you should try the recommendations in the Offical Ubuntu Documentation for your version of Ubuntu.

2. About This Guide

This guide can serve as a checklist for troubleshooting your wireless network connections. While it may not solve all your problems, it can hopefully steer you in the right direction.

2.1. Troubleshooting Steps

These are best approached in order. Where commands are used, they are linked to the relevant reference section for further information.

  1. A Rapid Overall Check

  2. Check for Device Recognition

  3. Check for driver

  4. Check for network connection

  5. Check for IP address assignment

  6. Connected but no internet

2.2. Reference

The reference section comprises information about the configuration files and commands used when setting up and troubleshooting wireless networking. Command listings contain an example with key points highlighted. For more information on each command check the manual page for that command. Open a terminal and type: man <command>

  • Where a word appears inside <>. you need to input a value to complete the command. Do not include the <> symbols in your command.

    • eg Where you see <ath0> you need to replace this with your device's logical name (could be ath0; wlan0; eth1; etc...)

3. Troubleshooting Steps

3.1. Rapid Overall Check

  1. With your computer turned off, insert your wireless adapter into a suitable port/slot.
  2. Turn on your computer and log-in if/when prompted.
  3. Open a terminal window and enter the following command:
    nm-tool
  4. This program will output the information Network Manager has collected about your card, much of which will assist in setting-up wireless networking .
  5. If the output contains:
    State: connected
    (and you are not on a wired connection) then your wireless adpater is working and connected to a network.
  6. Left-click on the panel applet (four vertical bars in 9.10 or older; 4 concentric arcs in 10.04). If you can see wireless networks, then your wireless works; you need to connect to a network. See below on network connection.

3.2. Check for Device Recognition

To check if device is recognized use the lshw -C network command. If a wireless device shows up then you can check off step 1. If it is not, see the Manual Device Installation section below.

3.3. Device Drivers

First you should check if a driver automatically loaded. (Your device may be supported in Ubuntu with a native driver.) Use the lshw command. As explained under lshw, if there is a line saying configuration: ...driver=... in the description of the wireless card, this indicates the driver is installed.

If you are not running the most recent kernel, update your system (System > Administration > Update Manager). Drivers, especially wireless, are constantly being added and modified.

3.3.1. Native Linux Drivers

  • Check in System > Administration > Hardware Drivers for a binary driver. For instance, many Broadcom cards will work with the Broadcom STA driver. Unfortunately, the driver is proprietary (the source code is not freely available), and so cannot be installed automatically as part of Ubuntu. If you are willing to accept this limitation, activate the driver.

  • Search your card manufacturer's website for a Linux driver.

3.3.2. ndiswrapper for non supported cards

If you find your card does not have a Linux driver you will have to look at an app called ndiswrapper.

3.3.3. Check Driver

If you ran lshw -C network and saw a driver bound to the device then let's test to make sure it's communicating with the kernel.

  1. Run the command lsmod to see if driver is loaded. (look for the driver name that was listed in the output of lshw, "configuration" line).

    • If you did not see the driver module in the list then use the modprobe command to load it.

    • If you see two modules (usually ndiswrapper and a native Linux driver) blacklist one of them (see below).
  2. run the command sudo iwconfig. If you see output like in the example in the command section then the driver is at least identifying the device as a wireless device to the kernel.

    • Opening networking in system>administration> and seeing the device in the list is how to identify through a gui if the driver is at least communicating with the kernel.

  3. run the command sudo iwlist scan to scan for a router. If an access point is identified this shows that the card is probably working properly as it can complete a wireless interface task. (note not all cards support scanning)

3.3.4. Multiple drivers loaded

For some cards (e.g., SMC2632W v1.02), an additional set of drivers is incorrectly loaded, effectively disabling wireless networking by generating two apparent wifi cards where there should only be one. Typically, you'll see entries for both eth1 and wlan0_rename after running the iwconfig command, with your communication speed divided evenly between them. One of those drivers should not be loaded, and should be blacklisted. To do so, edit /etc/modprobe.d/blacklist and add the following lines:

  blacklist <drivername>
  blacklist <drivername>_cs

where <drivername> is, for example, "hostap" (the "hostap" driver apparently causes problems for several cards). Then save, reboot, and check your connection with iwconfig.

3.3.5. Driver looks ok, device disabled

Newer laptops come with battery saving features to disable the wireless radio. Usually this is switched by a FN+Fx key combo or a specific button for the purpose. It is possible the driver and connection is ok but the wireless device is disabled and can't be used. Using the designated key(s) in linux sometimes does not work.

Options for identifying this:

  1. rfkill list will show if there is a hardware or software block.

  2. lshw command you see *-network:1 DISABLED or wireless=radio off

  3. If you run the iwconfig command you see eth1      NOT READY!.

So how do you rectify this? It varies so much the exact solution can't be put here in this document for all the different models. So...

  1. Look at the LaptopTestingTeam page on the team wiki to see if your laptop is listed with any information.

  2. Do a google search using terms such as manufacture, model, linux, wireless, enable, button, radio....etc. When searching and finding similar pages that don't help, use words that are used in those pages to help you search.
  3. Go to the ubuntu forums and ask, maybe someone else has the same laptop and knows the work around.

  4. Some laptops have a controller chip on the motherboard that is only accessible through a different OS. If you have turned off your WiFi card in a different operating system, you may have to boot back into that OS and enable the card before it is accessible to Linux.

3.4. Router Connection

This section provides information about connecting your computer to a wireless router. Before wokring through the following suggestions, you should make sure that you have a working wireless device and driver.

3.4.1. Using the NetworkManager Panel Applet

  1. With the driver loaded go to the panel applet. Select your wireless network (or "Connect to Hidden Wireless Network.." for networks that don't broadcast ESSIDs), enter your networking info, and then try to activate.
  2. You should see on the panel applet an active connection.
  3. You can check if you're associated to a router by running the command sudo iwconfig.

If the steps above don't connect you to your router, try to connect manually using the next section.

3.4.2. Manually Connecting to a Router

Sometimes GUI tools for connecting to a network cause problems. In order to work round this, you can connect from a terminal using the iwconfig command

The syntax looks like this:

sudo iwconfig <ath0> essid <essid> ap <xx:xx:xx:xx:xx:> key <XXX> mode <> commit

note: not all these may be used, check the man page for more information

If you cannot connect to the router then try these:

  1. Use network manager or remove it and try gtk wifi, or wifi radar. of course this is not an option if you can not connect to the internet without wireless

  2. Try booting with kernel option pci=noacpi or acpi=off as acpi sometimes conflicts with network devices. The second option will affect power management.
  3. Check for firmware update on the router and update it if there is newer firmware available.

3.4.3. Encryption

ImportantUnless you have specific reasons for not doing so, you should encrypt your wireless connection. Encryption stops other people from connecting to your router. This, in turn, makes it much harder for those people (and their computers) to access your sensitive information.

WEP (Wired Equivalent Privacy) and WPA/WPA2 (Wi-Fi Protected Access) are the current normal standards for wireless network encryption. WPA(2) is more secure than WEP but is not as well-supported by devices.Unfortunately, encryption can present problems with wireless networks and may need some tweaking to work properly.

3.4.3.1. Encryption Test

WarningThese steps require you to disable encryption settings on your router and computer. During this time, your network will not be secure and any sensitive network access (online bank accounts, online purchases etc.) should be avoided. Once you have finished, make sure encryption is turned on again.

  1. Make sure that your wireless adapter is compatible with the encryption type used by the router. Older adapters (such as 802.11b) are often not able to handle WPA or WPA2, at least not without a firmware upgrade.
  2. Disable wireless encryption on your router. You may need to consult the documentation for your router in order to do this.
  3. Try to connect to the router using either the NetworkManager applet in the notification area or manually as described above. Check that the connection allows you to browse the internet.

    • If the connection works without encryption, you have a problem with your previous encryption configuration. Try using WPA instead of WEP or vice-versa and following the advice given in the respective sections below.
    • If the connection still doesn't work, the issue may lie elsewhere. Check if other devices can connect wirelessly.
  4. Ensure that you restore some form of wireless security on your router.

3.4.3.2. Notes on WEP
  • More people seem to have success using an open key instead of shared and a hexadecimal method instead of ASCII. But there should be no reason any setting shouldn't work. Try the settings you want and consider adjusting if you have problems.
  • Ubuntu WEP FAQ

  • If you have a 10 digit WEP key try entering it in this format xxxx-xxxx-xx (include dashes)
  • Check driver files such as README as some drivers need a command to adjust the mode to work properly. Here are a couple of examples.
    • Madwifi driver needs to change to authmode 2 when using shared key setting.
      • manually from command line iwpriv ath0 authmode 2

      • add line pre-up iwpriv ath0 authmode 2 to interfaces file to automate during boot

    • For ipw2200 driver interface file should say wireless-key restricted <key>

3.4.3.3. Notes on WPA

(i) There have been a few posts where no association is established with router even on an open signal. At the point of writing this line, no answer has been seen to why this happens. A router reboot has been noted once to resolve but in other situations has caused heartache as network settings need to be set up again. Booting with acpi=off or noapci should be tried.

3.5. IP Address Assignment

Now that you have association to the router did you get an IP assigned to the device? This can be checked two ways.

  1. Run the command ifconfig and look for an assigned IP.

  2. You can always try to ping the router with the routers IP. A lot of home routers use something similar to 192.168.0.1 You'll have to find what that IP address is to ping.

If you do not have an IP then here are things to try

3.5.1. Using DHCP

sudo dhclient <ath0>
  • or

sudo invoke-rc.d networking restart
  • After running the invoke-rc.d command try dhclient ath0 again

You may want to try and reboot making sure your networking interfaces file is set up properly.

If you can connect to the router, but can't get an IP address, it may be because you put the wrong WEP key in.

3.5.2. Using Static IP Assignment

sudo ifconfig <ath0> down

sudo ifconfig ip addr 192.168.x.x netmask 255.255.255.0 broadcast 192.168.x.255 up

where the x = an IP address in your network range.

sudo route add default gw <router_ip> dev <ath0>

Now try to ping your router and a website. If you're connected now and have an IP assigned but can not surf website then move on to next section.

  • You will need to make sure your interfaces file is set up properly so you get internet again when you reboot

3.6. Connected but no internet

3.6.1. DNS

If you are connected to your router and have an IP address assigned to your wireless device but can't search the web, you will need to check to see if you have a DNS nameserver set

  • A simple test to see if it's a DNS server setting is to use the ping command. If you can ping an external site via IP address but can't load a web page in your browser then it is possible you have a DNS server problem.

  • Check this file to see if there is a DNS server listed.
      cat /etc/resolv.conf

      search telus.net
      nameserver 209.53.4.130
      nameserver 209.53.4.150
  • Use the Google DNS servers at 8.8.8.8 and 8.8.8.4 to check if your local ones are the problem.
  • Your DNS server settings can also be identified by calling your isp provider and asking them.
  • You can set up your dns settings so they don't change.
    • StaticDnsWithDhcp:StaticDnsWithDhcp

3.6.2. IPv6 Issues

The current public Internet Protocol is Internet Protocol Version 4 (IPv4). It's successor, Internet Protocol Version 6 (IPv6) is being phased into use. The main difference between these versions from a user's perspective is the number of Internet Protocol Addresses. IPv4 has 232 unique addresses compared to IPv6's 2128.

  • Disabling IPv6 can remedy wireless connections that seem to work right up to the point of accessing the internet. It is enabled by default in recent versions of Ubuntu.

3.6.2.1. Disabling IPv6 Support in Firefox
  1. Open a Firefox window.
  2. In the address bar type:
    about:config
    .
  3. Scroll through the list of settings and find this line:
    network.dns.disableIPv6
  4. Double-click on it to change the value to true.

3.6.2.2. Disabling IPv6 Support System-Wide
  1. Open the file /etc/modprobe.d/aliases

  2. Add the following first three lines to the file. The line with # starting is already in the file. Find it and add the # in front of it.

      alias net-pf-10 ipv6 off
      alias net-pf-10 off
      alias ipv6 off
      #alias net-pf-10 ipv6
  3. Reboot the computer..

3.6.3. Connection Established, Problems Persist

This section is reserved for solutions to problems where you can get connected but the connection is unstable. If you find a solution to your problem that's not here, please edit this page and add your solution.

3.6.3.1. Dropped Connections
  1. One common problem is channel interference. Cordless phones and other wireless devices can interrupt your wireless connection. If you are having a problem with dropped connections then try using a different channel. Use
      sudo iwlist scan
    to check what wireless channels are being used in your immediate area.
  2. Network-Manager; Wifi-radar; and gtk wifi can cause dropped signals every so often as they scan the interfaces, causing the connection to drop. You can try uninstalling these apps to see if your problem goes away, but doing so will remove any GUI tools that you may or may not have been using to configure and monitor your wireless connections. If removing these tools solves your problem, please file a bug report on the product's launchpad page to help improve the app's performance.

3.6.3.2. Connected, Issues with Certain Websites
  1. Disable IPV6.

3.6.3.3. Incorrect Driver Loads at Boot
  1. Some devices will have multiple drivers, and some will function better than others. To prevent a specific driver from loading during boot, read the modprobe command section.

4. Manual Installation of a Card

4.1. Non-recognized Card

Some devices are not recognized by the OS upon insertion.

If card doesn't show up (in lshw) try these steps:

Run the following command. Hopefully you'll get some output about the device.

sudo pccardctl ident

  Socket 0:
    product info: "Atheros Communications, Inc.", "AR5001-0000-0000", "Wireless LAN Reference Card", "00"
    manfid: 0x0271, 0x0012
    function: 6 (network)
  • If you get no output then the memory on the card cannot be read.

Now we need to open a configuration file and add this information to it:

gksudo gedit /etc/pcmcia/config.opts

the information you add should look like this, with your own data substituted.

card ""Atheros Communications, Inc.", "AR5001-0000-0000", "Wireless LAN"
  manfid 0x0271, 0x0012
  function: 6 (network)
  bind "ath_pci"

After making this change run this command:

sudo kill -HUP `cat /var/run/cardmgr.pid`

Now run lshw to see if the card is recognized and loaded properly.

(i) Most cards requiring this step will be older devices. You should not have to do this with any cards made in the past few years, but there can be exceptions.

(i) Notice the bind line which states what driver should be allocated to the device. You will need to find what driver your device uses. More on that in the next step.

4.2. Problem with bridge in PCI bus line

On several, especially new systems the Yenta bridge is not on the root PCI bridge, but behind a PCI-to-PCI bridge. On some x86 or x86_64 systems, these bridges aren't corrreclty set up by the BIOS, which may cause CardBus and even PCMCIA devices not to show up in lspci or in pccardctl ident correctly. If you suspect that this may be the cause, issue this command:

lspci -v | grep subordinate

Its result may be like this:

        Bus: primary=00, secondary=02, subordinate=04, sec-latency=64
        Bus: primary=02, secondary=03, subordinate=06, sec-latency=176
        Bus: primary=02, secondary=07, subordinate=0a, sec-latency=176

Let's decode the first line: bus 0 (primary) is bridged to busses 2 (secondary) to 4 (subordinate) by a bridge. The second and the third line state that bus 2 is bridged to busses 3-6, and 7-10. However, the CPU (which itself is connected to bus 0 through the root bridge) needs to be able to access all these busses. If you try to walk the tree to bus 7, for example, you see that the CPU can't get there, as bus 0 is only bridged to busses 2 to 4.

If this is the case, or you find a message stating "try pci=assign-busses" in the dmesg log, append the following to the kernel boot line:

     pci=assign-busses

4.3. System locks upon card insertion

When a card is first inserted, the system attempts to read the card's memory. This can sometimes cause your system to lock-up. Try this to see if it helps:

  1. Open the file /etc/pcmcia/config.opts

    gksudo gedit /etc/pcmcia/config.opts
  2. Find the following section:

      include memory 0xc0000-0xfffff
      include memory 0xa0000000-0xa0ffffff
      include memory 0x60000000-0x60ffffff
  3. Change it to look like this:
      include memory 0xd0000-0xdffff
      include memory 0xc0000-0xcffff
      include memory 0xc8000-0xcffff
      include memory 0xd8000-0xdffff

5. Reference

6. See Also


CategoryNetworking CategoryWireless