1. Introduction

This document is part of the Wireless Troubleshooting Guide. Command listings contain examples of their usage and key points are 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 <>, input a value to complete the command. Do not include the <> symbols in your command.

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

2. Commands

2.1. lshw

This command lists detailed hardware information.

Terminal

sudo lshw

  • (i) We can limit the the output to specific devices by adding options to the command. The following option "-businfo" lists information about any SCSI, IDE, IDE devices and their bus addresses along with the class of each device.

Terminal

sudo lshw -businfo

Example

BusInfo

Device

Class

Description

pci@00:1f.5

multimedia

82801CA/CAM AC'97 Audio Controller

pci@00:1f.6

communication

82801CA/CAM AC'97 Modem Controller

pci@03:00.0

ath0

network

AR5212 802.11abg NIC

  • (i) You can then use the "-C network" option to limit output so it only shows networking devices.

Terminal

sudo lshw -C network

Example

*-network
       description: Wireless interface
       product: AR5212 802.11abg NIC
       vendor: Atheros Communications, Inc.
       physical id: 1
       bus info: pci@03:00.0
       logical name: ath0
       version: 01
       serial: 00:11:95:50:be:62
       width: 32 bits
       clock: 33MHz
       capabilities: bus_master cap_list ethernet physical wireless
       configuration: broadcast=yes driver=ath_pci driverversion=0.9.6.0 (EXPERIMENTAL) ip=192.168.1.12 multicast=yes wireless=IEEE 802.11g
       resources: iomemory:10800000-1080ffff irq:11

2.1.1. Key Points

  1. The configuration line will tell you if there is a driver loaded for your device, except devices using orinoco drivers.

    Important

    If you do not see a driver listed here, then there is not one loaded and assigned to the device, and it will not show up in iwconfig output or the nework-admin gui.

  2. The businfo option can show if devices are recognized and memory is readable but the device is not physically on the bus. This is rare but it has been seen. It may seem cryptic but your output will vary greatly and there needs to be some characters (other then 0) here denoting its place in the pci bus.
  3. The logical name (see example above) is assigned if the driver has been recognised. If there is none, the problem is either the card or the driver. Also, wmaster0 is a generic driver used by the kernel, and if this is the logical name assigned there is usually a problem with the driver also.

TODO: What does it mean when it shows *-network UNCLAIMED, and no configuration line is present?

2.2. lspci

This command lists information about devices on the pci bus. Adding the -v option results in more detailed output:

Terminal

lspci -v

Info (!) You can limit the output by piping the output with grep

Terminal

lspci -v | grep Ethernet

IconsPage/example.png

0000:03:00.0 Ethernet controller: Atheros Communications, Inc. AR5212 802.11abg NIC (rev 01)
        '''Subsystem: D-Link System Inc D-link DWL-G650 (Rev B5)''' Wireless cardbus adapter
        Flags: bus master, medium devsel, latency 168, IRQ 11
        Memory at 10800000 (32-bit, non-prefetchable) [size=64K]
        Capabilities: [44] Power Management version 2

Adding the -n option to lspci makes the output include the numerical PCI vendor and device ID's.

Terminal

sudo lspci -n

IconsPage/example.png

0000:03:00.0 0200: '''168c:0013''' (rev 01)

2.2.1. Key Points

  1. This command shows the revision of the card (in above example the revision of the card is B5 not 01).
  2. Using the -n option you can find the PCI ID (168C:0013) of the card and find the correct driver to use with ndiswrapper. ndiswrapper list.

2.3. lsusb

This command lists information about devices on the USB bus.

Terminal

sudo lsusb -v

IconsPage/example.png

$ lsusb
Bus 005 Device 001: ID 0000:0000
Bus 001 Device 001: ID 0000:0000
Bus 004 Device 002: ID 2001:3700 D-Link Corp. [hex] DWL-122 802.11b
Bus 004 Device 001: ID 0000:0000
Bus 003 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000

2.4. lsmod

This command lists kernel modules that are loaded and running.

Terminal

sudo lsmod

Info (!) When the command lshw was run, you saw the name of the driver allocated to the device. See example above. You can pipe this command through grep to limit the output.

Terminal

lsmod | grep ath

IconsPage/example.png

ath_pci                78908  0
ath_rate_sample        16776  1 ath_pci
wlan                  141532  4 wlan_wep,ath_pci,ath_rate_sample
ath_hal               148432  3 ath_pci,ath_rate_sample

2.5. modprobe

modprobe runs or stops a module from running. Most wireless drivers in Ubuntu 5.10 (Breezy Badger) are in a module form. The following commands remove or add a module.

(i) When a recognized device loads, the kernel automatically loads the correct module for the device. This command is only needed to manually run a module

  • To start a module run this command:

    Terminal

    sudo modprobe <module>

  • To stop and remove a module run this command:

    Terminal

    sudo modprobe -r <module>

2.6. rfkill list

This command prints information detailing whether there are software or hardware blocks on your rf devices. To get a list of devices and their hardware and software status, try

Terminal

rfkill list

2.7. iwconfig

This command prints information about a wireless interface and allows you to configure the network interface from the command line.

Terminal

sudo iwconfig

IconsPage/example.png

* eth0      no wireless extensions.

* ath0      IEEE 802.11g  ESSID:"XXXXX"
          Mode- Managed  '''Frequency- 2.437 GHz'''  '''Access Point- 00:17:16:1D:FC:DE'''
          Bit Rate-36 Mb/s   Tx-Power-18 dBm   Sensitivity=0/3
          Retry- off   RTS thr:off   Fragment thr- off
          Encryption key:xxxx-xxxx-xx   Security mode:restricted
          Power Management off
          Link Quality=50/94  Signal level=-45 dBm  Noise level=-95 dBm
          Rx invalid nwid:10911  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

2.7.1. Key Points

  1. This example shows the interface of ath0. If you do not see anything like this sample then you do not have a working driver.
  2. The interface may not be named "ath0". It could say "wlan1". You may need to use the correct interface name to configure WICD or other wireless manager.
  3. Access Point: If you see all zeros here or nothing then you are not connected/associated to your router. When you are connected it will show the mac address of the router here.
  4. Frequency more commonly known as channel. If you can not connect to your router ensure frequency is correct.

(i) You can not set the channel(currently with breezy or earlier) via the network gui. Most drivers are set up as auto so it changes to the corresponding channel of the ap you're trying to connect to. But if you must make the change then this is the command to change it.

Terminal

sudo iwconfig <ath0> channel <X>

  • or

Terminal

sudo iwconfig <ath0> freq <x.xxxG>

  • Channel/Frequency Chart

    Ch 1

    2.412

    Ch 2

    2.417

    Ch 3

    2.422

    Ch 4

    2.427

    Ch 5

    2.432

    Ch 6

    2.437

    Ch 7

    2.442

    Ch 8

    2.447

    Ch 9

    2.452

    Ch 10

    2.457

    Ch 11

    2.462

    Ch 12

    2.467

    Non US Channels

    Ch 13

    2.472

    Ch 14

    2.484

2.8. ip

This command is similar to iwconfig with the following differences.

  1. It is a more general networking command. It works with any interface whether wireless or wired.
  2. Its configuration options and output show different networking references or set different settings.

Terminal

ip addr

IconsPage/example.png

2: ath0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:11:95:50:be:62 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.11/24 scope global ath0
    inet6 fe80::211:95ff:fe50:be62/64 scope link 
       valid_lft forever preferred_lft forever

2.8.1. Key Points

  1. The benefit with iproute2 on a wireless device is it shows if you have an IP address assigned to the device which is noted next to inet addr. iwconfig may show you're connected to your router but you still have no internet connection without an IP address assigned to the device.

2.9. iwlist

This command will give you more detailed information from the wireless interface such as a scan of all available routers with in range.

Terminal

sudo iwlist <ath0> scan

IconsPage/example.png

ath0      Scan completed :
          Cell 01 - Address: 00:13:46:1D:BC;0E
                    ESSID:"xxx"
                    Mode: Master
                    Frequency: 2.437 GHz (Channel 6)
                    Quality=49/94  Signal level=-46 dBm  Noise level=-95 dBm
                    Encryption key:on
                    Bit Rate:1 Mb/s
                    Bit Rate:2 Mb/s
                    Bit Rate:5 Mb/s
                    Bit Rate:6 Mb/s
                    Bit Rate:9 Mb/s
                    Bit Rate;11 Mb/s
                    Bit Rate;12 Mb/s
                    Bit Rate;18 Mb/s
                    Bit Rate;24 Mb/s
                    Bit Rate;36 Mb/s
                    Bit Rate;48 Mb/s
                    Bit Rate;54 Mb/s
                    Extra bcn_int=100

2.9.1. Key Points

  1. If you get a completed scan like the example above, your device and driver are probably working properly.
  2. Some devices, such as orinoco cards, do not support scanning so this command may not work for you.

2.10. dhclient

dhclient deals with DHCP if your router is running as a DHCP server.

Terminal

sudo dhclient <ath0>

(i) If you are associated with your router try running this command to get IP and other information to set up connection.

2.11. ping

ping is a good troubleshooting command to track down where the connection problem may be. Ping works like SONAR by sending an echo request to a server, waiting for it to respond and recording the time taken for the response to arrive.

  1. ping your local loopback device. The -c 4 option means that 4 echo requests will be sent. 127.0.0.1 is the IP address for the local loopback device; a special address that is actually your own computer. This is identical to pinging yourself.

    Terminal

    ping -c 4 127.0.0.1

    (i) If this doesn't work then there is a problem in the TCP/IP stack somewhere.

  2. If your device is assigned an IP address, ping that. (i) use iproute2 to find the IP address assigned to the device

    Terminal

    ping -c 4 <192.168.1.11>

  3. ping your router

    Terminal

    ping -c 4 <192.168.0.1>

  4. ping an external site using its IP address

    Terminal

    ping -c 4 216.239.57.99

  5. ping an external website using its common name.

    Terminal

    ping -c 4 www.google.com

(i) If you can ping an external site with its IP address but not the common name then there is a DNS nameserver problem.

3. Manual Pages


CategoryWireless CategoryNetworking

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