Introduction

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

1. Try to Connect to Your Router

1.1. Connect 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.

  4. If you cannot connect with NetworkManager, you can remove it and try an alternative GUI such as gtk wifi, or wifi radar.

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

1.2. Manually Connecting to a Router

GUI network tools can cause problems. In order to work round this, try connecting manually 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. Most PCs have some power-management features, provided by the Advanced Configuration and Power Interface (ACPI). Linux uses kernel modules to support ACPI. However, these modules can cause problems with network devices. Adding the kernel options pci=noacpi or acpi=off to your boot parameters may resolve your connection issues. The second of these option will affect power management for your whole system.

  2. Check for firmware update on the router and update it if there is newer firmware available.

2. Troubleshooting 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.

2.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.

2.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>

  • If you are unable to obtain an IP address through DHCP, check if you have wpa_supplicant processes running. The wpa_supplicant could interfere with WEP-based authentication and association. Kill the process and try again.

2.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. 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 ip addr 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.1. Using DHCP

Dynamic Host Control Protocol (DHCP) is a protocol that governs the creation and allocation of Dynamic IP addresses. This means that when you connect to a network, your computer is given an IP address within a range specified by a DHCP server. In many setups, the router will act as a DHCP server.

sudo dhclient <ath0>
  • or

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

  • Reboot making sure your networking /etc/network/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.2. Using Static IP Assignment

Using a dynamically-assigned IP address can occasionally cause problems or otherwise be undesirable. Using a static IP is generally considered more secure for the network's security, as a static IP can be mapped to the specific MAC address of the wireless adapter. However, always having the same IP can create a vulnerability as hackers can repeatedly attack the same IP address, somewhat increasing their chance of success.

  1. Put down the network using the following command typed in a terminal window
    sudo ip link set ath0 down
  2. Bring the network back up using the appropriate IP address, netmask and broadcast IP address for the connection
    sudo ip addr add 192.168.x.x/24 brd + dev ath0
    where the x = an IP address in your network range.
  3. Add a route between your router and wireless adapter.
    sudo route add default gw <router_ip> dev <ath0>
  4. 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 /etc/network/interfaces file is set up properly so you get internet again when you reboot

4. Connected but no internet

4.1. Check DNS Settings

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

  • Use the ping command to ping an external site using its IP address. If this is successful but you can't load a web page in your browser then you may have a DNS server problem.

  • DNS settings are stored in /etc/resolv.conf. Type the following command into a terminal to see if there are any DNS servers listed.

      cat /etc/resolv.conf
    The output should be something similar to the following:

    IconsPage/example.png

      search telus.net
      nameserver 209.53.4.130
      nameserver 209.53.4.150
    • The last two lines of this particular file list two nameservers, in order of preference.
  • If your file doesn't look like this one, edit it and add your own settings. Reboot your computer.
    • Your DNS server settings can also be identified by calling your Internet Service Provider (ISP) and asking them.
  • If this doesn't work, edit the file again to use the Google DNS servers at 8.8.8.8 and 8.8.8.4 to check if your ISPs are the problem.

  • If you are using DNS servers with static IP addresses, follow this guide to configure your system.

4.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.

4.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.

4.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..

5. Connection Established, Problems Persist

This section is for troubleshooting unstable connections.

5.1. Dropped Connections

  1. Channel interference from 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.

5.2. Connected, Issues with Certain Websites

  1. Disable IPv6.

5.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.

WifiDocs/WirelessTroubleShootingGuide/Connections (last edited 2013-12-14 00:22:13 by knome)