Linux: How to Get Wireless to Work

By Xah Lee. Date:

This page is my notes on getting your laptop's builtin wi-fi device to work on Linux. I assume you are using Ubuntu Linux, but others are similar.

Basic steps:

  1. Get your machine updated fully first. For example, Run sudo apt-get update, sudo apt-get upgrade, sudo apt-get dist-upgrade, in this order.
  2. Reboot the machine and check if your wireless is working. For example, ping example.com.
  3. If not, then find out what the company name and model is your network device.
  4. Install the drivers. (open source or proprietary) And install firmware, if necessary

How to do find out the wireless device maker/model?

To list PCI* devices, do lspci. PCI is Peripheral Component Interconnect (Peripheral Controller Interface), a computer bus for attaching hardware devices in a computer. (For example, graphics cards, audio card, networking card)

Here's sample output of my wireless device:

xah@xahcp:~$ lspci
00:00.0 Host bridge: Advanced Micro Devices [AMD] nee ATI RS480 Host Bridge (rev 01)
00:01.0 PCI bridge: Advanced Micro Devices [AMD] nee ATI RS480 PCI Bridge
00:05.0 PCI bridge: Advanced Micro Devices [AMD] nee ATI RS480 PCI Bridge
00:13.0 USB controller: Advanced Micro Devices [AMD] nee ATI IXP SB400 USB Host Controller
00:13.1 USB controller: Advanced Micro Devices [AMD] nee ATI IXP SB400 USB Host Controller
00:13.2 USB controller: Advanced Micro Devices [AMD] nee ATI IXP SB400 USB2 Host Controller
00:14.0 SMBus: Advanced Micro Devices [AMD] nee ATI IXP SB400 SMBus Controller (rev 11)
00:14.1 IDE interface: Advanced Micro Devices [AMD] nee ATI IXP SB400 IDE Controller
00:14.3 ISA bridge: Advanced Micro Devices [AMD] nee ATI IXP SB400 PCI-ISA Bridge
00:14.4 PCI bridge: Advanced Micro Devices [AMD] nee ATI IXP SB400 PCI-PCI Bridge
00:14.5 Multimedia audio controller: Advanced Micro Devices [AMD] nee ATI IXP SB400 AC'97 Audio Controller (rev 02)
00:14.6 Modem: Advanced Micro Devices [AMD] nee ATI IXP SB400 AC'97 Modem Controller (rev 02)
00:18.0 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] HyperTransport Technology Configuration
00:18.1 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Address Map
00:18.2 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] DRAM Controller
00:18.3 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Miscellaneous Control
01:05.0 VGA compatible controller: Advanced Micro Devices [AMD] nee ATI Radeon XPRESS 200M 5955 (PCIE)
06:02.0 Network controller: Broadcom Corporation BCM4318 [AirForce One 54g] 802.11g Wireless LAN Controller (rev 02)
06:06.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)

lspci -vvv for full info on the devices.

Following is a part of the output of lspci -vvv, showing my wireless device.

06:02.0 Network controller: Broadcom Corporation BCM4318 [AirForce One 54g] 802.11g Wireless LAN Controller (rev 02)
        Subsystem: Hewlett-Packard Company Broadcom 802.11b/g WLAN
        Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
        Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Latency: 64
        Interrupt: pin A routed to IRQ 21
        Region 0: Memory at c0200000 (32-bit, non-prefetchable) [size=8K]
        Kernel driver in use: b43-pci-bridge
        Kernel modules: ssb

Following is a part of the output of lspci -vvv, showing my ethernet (wired) device.

06:06.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)
        Subsystem: Hewlett-Packard Company Device 30a4
        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
        Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Latency: 128 (8000ns min, 16000ns max)
        Interrupt: pin A routed to IRQ 22
        Region 0: I/O ports at a000 [size=256]
        Region 1: Memory at c0202000 (32-bit, non-prefetchable) [size=256]
        Capabilities: <access denied>
        Kernel driver in use: 8139too
        Kernel modules: 8139too, 8139cp

How to list all USB devices?

To list USB devices: lsusb.

Sample output.

xah@xahcp:~$ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 046d:c018 Logitech, Inc. Optical Wheel Mouse

If the menu bar shows “device not ready firmware missing”, then you need to install the firmware.

How to search the available drivers/firmware for a network device?

Once you got the name of your network device, you might web search to find lots useful info. (see bottom of this page for references) Then, you can also search the packages for the drivers.

So, once i know my device is “Broadcom … BCM4318 … 802.11g …”, from the web i found related names “b43*” chipset. I can do search like this: apt-cache search broadcom and apt-cache search firmware and apt-cache search b43. These commands lets me search for a package for the firmware or driver.

xah@xahcp:~$ apt-cache search broadcom
b43-fwcutter - Utility for extracting Broadcom 43xx firmware
broadcom-sta-common - Common files for the Broadcom STA Wireless driver
broadcom-sta-source - Source for the Broadcom STA Wireless driver
firmware-crystalhd - Crystal HD Video Decoder (firmware)
bcmwl-kernel-source - Broadcom 802.11 Linux STA wireless driver source
crystalhd-dkms - Crystal HD Video Decoder (Linux kernel driver)
gstreamer0.10-crystalhd - Crystal HD Video Decoder (GStreamer plugin)
libcrystalhd-dev - Crystal HD Video Decoder (development files)
libcrystalhd3 - Crystal HD Video Decoder (shared library)
xah@xahcp:~$ apt-cache search b43
b43-fwcutter - Utility for extracting Broadcom 43xx firmware
firmware-b43-installer - Installer package for firmware for the b43 driver
firmware-b43-lpphy-installer - Installer package for firmware for the
b43 driver (LP-PHY version)
firmware-b43legacy-installer - Installer package for firmware for the
b43legacy driver
libghc-configfile-dev - Parser and writer for sectioned config files in Haskell
libghc-configfile-prof - Parser and writer for sectioned config files
in Haskell; profiling libraries

Once you have the package name, to describe what it does, do apt-cache show ‹package_name› and apt-cache showpkg ‹package_name›.

xah@xahcp:~$  apt-cache show firmware-b43-installer
Package: firmware-b43-installer
Priority: optional
Section: multiverse/kernel
Installed-Size: 35
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Fabrizio Regalli <fabreg@fabreg.it>
Architecture: all
Source: b43-fwcutter
Version: 1:015-9
Depends: b43-fwcutter (>= 1:015-9), bzip2, wget
Recommends: linux-image
Conflicts: firmware-b43-lpphy-installer
Filename: pool/multiverse/b/b43-fwcutter/firmware-b43-installer_015-9_all.deb
Size: 3524
MD5sum: 69db16b6be9a28028c04b248edfc206c
SHA1: ea12e46859d383ba4d9a77d2ef72bdaf83da7849
SHA256: 4d4f57e194f217da4f1455863b255fec1c3b0a13ec3297c0799c90e7404a6987
Description-en: Installer package for firmware for the b43 driver
 This package installs the firmware needed for usage of the b43 kernel
 driver.
 .
 Supported chipsets:
  - BCM4306/3
  - BCM4311
  - BCM4318
  - BCM4321
  - BCM4322 (only 14e4:432b)
Homepage: http://wireless.kernel.org/en/users/Drivers/b43
Description-md5: 97312c6d9c7624888f4e31a1f191c9ed
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu

Then, sudo apt-get install firmware-b43-installer.

Output: apt-get_install_firmware-b43-installer_2012-10-08.txt

How to list your network devices?

Type ifconfig.

If your wireless device is working, it should be listed there.

Following is a sample output of a machine when the wireless device is NOT working. (the wired ethernet is working)

xah@xahcp:~$ ifconfig
eth0      Link encap:Ethernet  HWaddr 00:16:d4:36:19:43
          inet addr:192.168.1.4  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::216:d4ff:fe36:1943/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:274 errors:0 dropped:0 overruns:0 frame:0
          TX packets:132 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:37321 (37.3 KB)  TX bytes:22428 (22.4 KB)
          Interrupt:22 Base address:0xa000

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:105 errors:0 dropped:0 overruns:0 frame:0
          TX packets:105 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:7166 (7.1 KB)  TX bytes:7166 (7.1 KB)

Following is a sample output of a machine with both wired and wireless devices are working.

xah@xahcp:~$ ifconfig
eth0      Link encap:Ethernet  HWaddr 00:16:d4:36:19:43
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:10566 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7643 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:11367418 (11.3 MB)  TX bytes:1103737 (1.1 MB)
          Interrupt:22 Base address:0xa000

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:707 errors:0 dropped:0 overruns:0 frame:0
          TX packets:707 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:64560 (64.5 KB)  TX bytes:64560 (64.5 KB)

wlan0     Link encap:Ethernet  HWaddr 00:14:a5:b6:cd:d1
          inet addr:192.168.1.7  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::214:a5ff:feb6:cdd1/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:11104 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7360 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:10044313 (10.0 MB)  TX bytes:1153426 (1.1 MB)

How to configure a wireless device?

Call iwconfig. Here's a sample output of a machine with working wifi.

xah@xahcp:~$ iwconfig
lo        no wireless extensions.

wlan0     IEEE 802.11bg  ESSID:"oooo3"
          Mode:Managed  Frequency:2.462 GHz  Access Point: 00:90:4C:7E:00:64
          Bit Rate=48 Mb/s   Tx-Power=20 dBm
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality=70/70  Signal level=-40 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:22  Invalid misc:112   Missed beacon:0

eth0      no wireless extensions.

References

Here's some sites i found useful.

If you have a question, put $5 at patreon and message me.