Difference between revisions of "Network configuration/Wireless"

From ArchWiki
Jump to navigation Jump to search
m (→‎b43: Added link to new "b43-firmware" PKGBUILD on AUR)
Line 273: Line 273:
 
#Run <pre>lspci</pre> to determine that you have an appropriate card. My output of looked like this: <pre>0c:00.0 Network controller: Broadcom Corporation BCM4311 802.11b/g WLAN (rev 01)</pre>
 
#Run <pre>lspci</pre> to determine that you have an appropriate card. My output of looked like this: <pre>0c:00.0 Network controller: Broadcom Corporation BCM4311 802.11b/g WLAN (rev 01)</pre>
 
For a list of supported devices, see [http://linuxwireless.org/en/users/Drivers/b43/devices here].
 
For a list of supported devices, see [http://linuxwireless.org/en/users/Drivers/b43/devices here].
#Install the firmware cutter application from core. It is named b43-fwcutter.  
+
 
 +
Either install the "b43-firmware" package from [http://aur.archlinux.org/packages.php?ID=21690 AUR], or perform the following steps manually.
 +
#Install the firmware cutter application from core. It is named "b43-fwcutter".
 
#Because now in core we have kernel >=2.6.25 we download version 4.150.10.5 of Broadcom's proprietary driver. The older version(4.80.53.0) will be drop in july. <pre>wget http://mirror2.openwrt.org/sources/broadcom-wl-4.150.10.5.tar.bz2</pre>
 
#Because now in core we have kernel >=2.6.25 we download version 4.150.10.5 of Broadcom's proprietary driver. The older version(4.80.53.0) will be drop in july. <pre>wget http://mirror2.openwrt.org/sources/broadcom-wl-4.150.10.5.tar.bz2</pre>
 
#Unpack the compressed file.<pre>tar xjf broadcom-wl-4.150.10.5.tar.bz2</pre>
 
#Unpack the compressed file.<pre>tar xjf broadcom-wl-4.150.10.5.tar.bz2</pre>
 
#Change the current directory to the newly created directory, and then further to the driver folder: <pre>cd broadcom-wl-4.150.10.5/driver</pre>
 
#Change the current directory to the newly created directory, and then further to the driver folder: <pre>cd broadcom-wl-4.150.10.5/driver</pre>
 
#Create /lib/firmware if you don't have and then Run <pre>b43-fwcutter -w "/lib/firmware/" wl_apsta_mimo.o</pre>  
 
#Create /lib/firmware if you don't have and then Run <pre>b43-fwcutter -w "/lib/firmware/" wl_apsta_mimo.o</pre>  
#Restart, and configure your device as normal. You may want to add b43 into the modules section of your rc.conf file.  
+
#Restart, and configure your device as normal.
<pre>MODULES=(...b43 !bcm43xx...)</pre>
+
You may want to add b43 into the modules section of your rc.conf file.<pre>MODULES=(...b43 !bcm43xx...)</pre>
 
Good luck!
 
Good luck!
  

Revision as of 02:01, 22 November 2008


Template:I18n links start Template:I18n entry Template:I18n entry Template:I18n entry Template:I18n entry Template:I18n entry Template:I18n entry Template:I18n links end

Introduction

Configuring wireless under Arch Linux (or any distro for that matter) is a two-part process. The first part is to identify and ensure the correct driver for your wireless device is installed, (they are available on the installation media, so make sure you install them) and configure the interface. The second is choosing a method of managing wireless connections. This article covers both parts, and provides additional links to wireless management tools.

Template:Box Note

Part I: Identify your card and appropriate Driver

First steps

  1. Check to see whether Linux supports your hardware. You can find your card with 'lspci | grep -i net'. The Ubuntu Wiki has an extensive list of wireless cards and whether or not they are supported by available linux kernel drivers.
    • zd1201-based card like ZyXEL B-220
    • wlan-ng supports quite a lot of chipsets; check here first.
    • madwifi for Atheros chipsets (AR5210, AR5211, AR5212 and AR5213)
    • rt2x00 project for a unified driver for Ralink's rt2400, rt2500, and rt2570 chipsets (beta).
    • Ralink Linux Support for drivers for Ralink chipsets direct from the manufacturer.
    • rt2x00 project for better-maintained versions of Ralink's own drivers ("legacy drivers" on the site).
    • ipw2100 for Intel Pro/Wireless 2100 Mini PCI
    • ipw2200 for Intel Pro/Wireless 2200 Mini PCI
    • iwlwifi-3945-ucode for Intel Pro/Wireless 3945 AB/G Mini PCI-E
    • iwlwifi-4965-ucode for Intel Pro/Wireless 4965 AB/G Mini PCI-E
    • orinoco for some Prism 2-based cards
    • prism54 for Prism 54-based cards
    • bcm43xx for Broadcom 43xx-based cards (old)
    • b43 for Broadcom 43xx-based cards
    • broadcom-wl for recent 43xx Broadcom cards not supported by bcm43xx or b43.
    • Check the Linux Wireless Support page for your hardware or in The Linux Questions hardware compatibility list (HCL), which also has a good list of Linux-friendly hardware
  2. If the hardware is supported only under Windows
    • ndiswrapper for hardware supported only under Windows (some Broadcom, 3com, etc)
    • You will need the .inf and .sys files from your Windows driver - check here
  3. If your hardware is not listed anywhere
    • Try a web search for the exact model name of your hardware with the word "linux" - and feel free to ask for help on the forums
    • There is a chance that your hardware will not function under Linux (however, this is rarely the case)

How it Works

The Arch kernel is modular, meaning many of the drivers for machine hardware reside on the hard drive and are available as modules. At boot, udev takes an inventory of your hardware. Udev will load appropriate modules (drivers) for your corresponding hardware, and the driver, in turn, will allow creation of a kernel interface.

The interface name for different drivers and chipsets will vary. Some examples are wlan0, eth1, and ath0.

  • Note: Udev is not perfect. If the proper module is not loaded by udev on boot, simply modprobe it and add the module name to etc/rc.conf on the MODULES= line.

Installation

If you have wired internet available

If you have wired ethernet available, and are simply adding wireless functionality to an existing system, and did not include wireless_tools during initial installation, use pacman to install:

# pacman -S wireless_tools

The drivers' corresponding package names are all highlighted in bold on this page. The packages can be installed during initial package selection on the Arch installation media and can also be installed later with pacman, e.g.:

# pacman -S madwifi

If you have only wireless internet available

The wireless_tools package is now available as part of the base system and is also on the live installation media (CD/USB stick image).

You cannot initialize wireless hardware without these userspace tools, so ensure they are installed from the installer media, (during package selection), especially if you have no other means of networking other than wirelessly. Otherwise, you will be stuck in a recursion when you reboot your newly installed Arch system; you will need wireless_tools and drivers, but in order to get them, you will need wireless_tools and drivers.

  • This line intentionally left blank.

Wireless Quickstart

The general procedure will be:

  • Identify your interface and appropriate module:
# hwdetect --show-net

or

# lshwd

or

# lspci | grep -i net 
  • Ensure the module is loaded with lsmod | grep <name_or_part_of_name_of_module> e.g.:
# lsmod | grep ath
  • Ensure the driver has created a usable interface:
# iwconfig
  • Bring the interface up with ifconfig <interface> up. e.g.:
# ifconfig ath0 up
  • (Optional) Scan for available access points:
# iwlist ath0 scan | less
  • Specify the id of the wireless network with iwconfig <interface> essid <youressid>. Or, if using WEP; iwconfig <interface> essid <youressid> key <yourwepkey>, e.g.:
# iwconfig ath0 essid linksys key 0241baf34c
  • Request an IP address with dhcpcd <interface>. e.g.:
# dhcpcd ath0
  • Ensure you can route:
$ ping -c 3 www.google.com

Done.

Refer to Part II to ensure a permanent configuration solution for your system.

Drivers and Firmware

Methods and procedures for installing drivers for various chipsets are covered below. In addition, certain chipsets require the installation of corresponding firmware. (Also covered below).

wlan-ng

Packages: wlan-ng26, wlan-ng26-utils

This driver support PRISM based cards, which are hard to find now. The PRISM card is an IEEE 802.11 compliant 2.4 GHz DSSS WLAN network interface card that uses the Intersil PRISM chipset for its radio functions and the AMD PCNet-Mobile chip (AM79C930) for its Media Access Controller (MAC) function. The supported adapters can be found from here: http://www.linux-wlan.org/docs/wlan_adapters.html.gz

For wlan-ng you do not need the wireless_tools package as mentioned above. Instead you will need to learn the tools in the wlan-ng26-utils package: wlancfg and wlanctl-ng.

See http://www.linux-wlan.org/

rt2870

See Rt2870

rtl8180

Realtek rtl8180 PCI/Cardbus 802.11b now fully supported in the kernel

modprobe rtl8180

rt2x00

Unified driver for Ralink chipsets (replaces rt2500,rt61,rt73 etc). Compatible with stable wpa_supplicant using the wext driver interface. This driver is now (as of 2.6.24) part of the mainline kernel, and can be manually loaded as follows...

modprobe rt2500pci

(replace rt2500pci with your hardware e.g. rt2400pci, rt2500usb, rt61pci, rt73usb)

Some chips require a firmware file, which can be installed like this:

pacman -S rt2x00-rt71w-fw
pacman -S rt2x00-rt61-fw

..depending on the chipset. See the rt2x00 wiki page.

RT2500

For Ralink's PCI/PCMCIA based rt2500 series chipsets (the first generation of Ralink chips to support 802.11g).

Package: rt2500

Supports standard iwconfig tools for unencrypted and WEP connections, although it can be quite sensitive to the order of commands. wpa_supplicant is not supported using the standard wext interface. The driver does support WPA (using hardware encryption), but in a non-standard way. The trunk version of wpa_supplicant (0.6.x) appears to include special support for this driver, and it is also possible to negotiate a WPA connection manually using iwpriv commands. See these instructions for details. The same applies for RT61 and RT73 below.

As of August 24, 2008, the rt2x00 driver (rt2500pci module) is preferred and will work with wpa_supplicant using the wext driver, if you are using the old rt2500 module, you may need to disable it in your rc.conf fileand make sure you are loading the rt2500pci and rt2x00lib and rt2x00pci modules.

RT61

For PCI/PCMCIA cards based on Ralink's later generation of 802.11g chipsets (including those supporting proprietary MIMO modes). "RT61" has now been made largely obsolete by the in-kernel rt2x00 driver (see above), although there may be cases where the legacy driver performs better.

See the RT61 wiki page.

RT73 (ie Ralink RT2571)

For USB devices based on Ralink's later generation of 802.11g chipsets (including those supporting proprietary MIMO modes).

Several USB WiFi dongles use this chipset, including the Linksys WUSB54GC and the Belkin Wireless G USB key (F5D7050 v3000) .

"RT73" has now been made largely obsolete by the in-kernel rt2x00 driver (see above), although there may be cases where the legacy driver performs better. See the RT73 wiki page.

madwifi

Package: madwifi

The module is called ath_pci. The newer module, ath5k, will eventually phase out ath_pci.

modprobe ath_pci

for the older driver, or:

modprobe ath5k

for the development version. Note that not all cards work with ath5k yet.

If using ath_pci, you may need to blacklist ath5k by adding it to the MODULES= array in /etc/rc.conf, and subsequently prefixing it with a bang (!):

MODULES=(!ath5k forcedeth snd_intel8x0 ... ...)

Some users may need to use the countrycode option when loading the MadWifi driver in order to use channels and transmit power settings that are legal in their country/region. In the Netherlands, for example, you would load the module like this:

modprobe ath_pci countrycode=528

You can verify the settings with the iwlist command. See man iwlist and the CountryCode page on the MadWifi wiki. To have this setting automatically applied during boot, add the following to /etc/modprobe.conf:

options ath_pci countrycode=528

ATTENTION: I had to remove the countrycode option completely or the ath0 device wasn't created (andyrtr, kernel 2.6.21)!

ipw2100 and ipw2200

Depending on which of the chips you have, use either:

ipw2100-fw

or:

ipw2200-fw

If installing after initial Arch installation, you may need to reboot for the firmware to be loaded.

If at boot up you see that your firmware is not being loaded, then you probably need to add the 'firmware' hook to your /etc/mkinitcpio.conf file and regenerate your kernel image with:

mkinitcpio -g /boot/kernel26.img

iwl3945, iwl4965 and iwl5000-series

Intel's open source WiFi drivers for Linux (See iwlwifi) will work for both the 3945 and 4965 chipsets since kernel v2.6.24. And iwl5000-series chipsets (including 5100BG, 5100ABG, 5100AGN, 5300AGN and 5350AGN) module will be supported in the coming kernel 2.6.27, by the intree driver iwlagn.

Template:Box Note

# pacman -S iwlwifi-3945-ucode

or:

# pacman -S iwlwifi-4965-ucode

or:

# yaourt -S iwlwifi-5000-ucode

Firmware for iwl5000-series is now in the AUR. So you can install it using yaourt.

If MOD_AUTOLOAD is set to yes in /etc/rc.conf (it is by default) that should be all that's required. Simply check for the presence of the drivers by running ifconfig from a terminal. There should be a listing for wlan0.

To manually load the driver at startup, edit /etc/rc.conf as root and add iwl3945 or iwl4965 respectively to the MODULES array. For example:

MODULES=( ... b44 mii iwl3945 snd-mixer-oss ...)

The drivers should now load after a reboot, and running ifconfig -a from a terminal should report wlan0 as a new network interface.

Other Notes

  • The windows NETw4x32 driver can be used with ndiswrapper as an alternative to the iwl3945 and ipw3945 drivers
  • In some cases (specifically a Dell Latitude D620 with Arch 2008.06, though it could happen elsewhere) after installation you may have both iwl3945 and ipw3945 in your MODULES=() section of rc.conf. The card will not work with both modules loaded, so you will have to ! out the ipw3945 module and then reboot or remove the module manually before you can use your wireless card.
  • If you cannot see an AP (for example on channel 12), try adding "options cfg80211 ieee80211_regdom=EU" to /etc/modprobe.conf. This will make the driver apply the european regulatory restrictions, which include that channel. You can see the currently "allowed" channels using "iwlist f". If your network's channel is not included there, another regdom setting might help you.

ipw3945 (Deprecated Method)

Template:Box Note

# pacman -S ipw3945 ipw3945-ucode ipw3945d

To initialize the driver on startup, edit /etc/rc.conf as root and add ipw3945 to the MODULES array and ipw3945d to the DAEMONS array. For example:

MODULES=(... mii ipw3945 snd-mixer-oss ...)
DAEMONS=(syslog-ng ipw3945d network ...)

Note: The ipw3945d daemon must be inserted BEFORE network and dhcdbd/networkmanager in the array.

orinoco

This should be part of the kernel package and be installed already.

ndiswrapper

Ndiswrapper is not a real driver, but you can use it when there are no native Linux drivers for your wireless chips. So it is very useful in some situations. To use it you need the *.inf file from your Windows driver (the *.sys file must also be present in the same directory). If you need to extract these files from an *.exe file, you can use either cabextract or wine. ndiswrapper is included on the installation CD.

Follow these steps to configure ndiswrapper.

ndiswrapper -i filename.inf
ndiswrapper -l
ndiswrapper -m
depmod -a

Now the ndiswrapper install is almost finished; you just have to update /etc/rc.conf to load the module at boot (below is a sample of my config; yours might look slightly different):

MODULES=(ndiswrapper snd-intel8x0 !usbserial)

The important part is making sure that ndiswrapper exists on this line, so just add it alongside the other modules. It would be best to test that ndiswrapper will load now, so:

modprobe ndiswrapper
iwconfig

and wlan0 should exist. Check this page if you're having problems: Ndiswrapper installation wiki.

prism54

Download the firmware driver for your appropriate card from this site. Rename the firmware file to 'isl3890'. If nonexistent, create the directory /lib/firmware and place the file 'isl3890' in it. This should do the trick. (forum source)

ACX100/111

packages: tiacx tiacx-firmware

The driver should tell you which firmware it needs; check /var/log/messages.log or use the dmesg command. Move the appropriate firmware to '/lib/firmware'. I did this:

ln -s /usr/share/tiacx/acx111_2.3.1.31/tiacx111c16 /lib/firmware

Hint: If you find that the driver is spamming your kernel log, for example because you're running Kismet with channel-hopping, you could put this in /etc/modprobe.conf:

options acx debug=0

BCM43XX

Broadcom users that have 43xx series chipsets have a new alternative to ndiswrapper. In kernel version 2.6.17, the bcm43xx driver was introduced.

  1. Run
    iwconfig
    or
    hwd -s
    to determine that you have an appropriate card. My output of hwd -s looked like this:
    Network    : Broadcom Corp.|BCM94306 802.11g NIC module: unknown

For a list of supported devices, see here.

  1. Run
    pacman -Sy bcm43xx-fwcutter
    to install the firmware cutter application.
  2. Download the Windows driver file for your card from which to extract the firmware.
  3. If you download the driver from Dell's website, you must run in on a Windows machine or under WINE (it is a .exe file that extracts itself to C:\Dell\[driver numbers]). Or you may try [1], [2] or [3]. I just saved this file to my desktop; you won't need it after the next step.
  4. Run
    bcm43xx-fwcutter -w /lib/firmware /home/<user>/Desktop/wl_apsta.o
    You may have to create /lib/firmware first.
  5. Restart, and configure your device as normal. You may want to add bcm43xx into the modules section of your rc.conf file. Good luck!

b43

This driver is the successor to the bcm43xx driver, and is included in kernel 2.6.24.

  1. Run
    lspci
    to determine that you have an appropriate card. My output of looked like this:
    0c:00.0 Network controller: Broadcom Corporation BCM4311 802.11b/g WLAN (rev 01)

For a list of supported devices, see here.

Either install the "b43-firmware" package from AUR, or perform the following steps manually.

  1. Install the firmware cutter application from core. It is named "b43-fwcutter".
  2. Because now in core we have kernel >=2.6.25 we download version 4.150.10.5 of Broadcom's proprietary driver. The older version(4.80.53.0) will be drop in july.
    wget http://mirror2.openwrt.org/sources/broadcom-wl-4.150.10.5.tar.bz2
  3. Unpack the compressed file.
    tar xjf broadcom-wl-4.150.10.5.tar.bz2
  4. Change the current directory to the newly created directory, and then further to the driver folder:
    cd broadcom-wl-4.150.10.5/driver
  5. Create /lib/firmware if you don't have and then Run
    b43-fwcutter -w "/lib/firmware/" wl_apsta_mimo.o
  6. Restart, and configure your device as normal.

You may want to add b43 into the modules section of your rc.conf file.

MODULES=(...b43 !bcm43xx...)

Good luck!

broadcom-wl

For recent Broadcom 43xx cards not supported by bcm43xx or b43. Not just for 4312 cards. See the Broadcom 4312 wiki page. It is available in AUR. These chipsets are used in most Dell laptops, among others.

rtl8187

See the rtl8187 wiki page.

zd1211rw

zd1211rw is a driver for the ZyDAS ZD1211 802.11b/g USB WLAN chipset and it is included in recent versions of the Linux kernel. See [4] for a list of supported devices. You only need to install the firmware for the device:

pacman -Sy zd1211-firmware

--Willey 22:32, 20 September 2008 (EDT)

Test Installation

After loading your driver run

iwconfig

and see if a wireless interface (wlanx, ethx, athx) is recognized

If iwlist scan displays Interface doesn't support scanning then you probably forgot to install the firmware.

Part II: Wireless Management

Assuming that your drivers are installed and working properly, you will need to choose a method for managing your wireless connections. The following subsections will help you decide the best way to do just that.

wireless_tools

The wireless tools are the basic set of tools to set up a wireless network. These powerful userspace console tools work extremely well and allow complete, manual control from the shell.

These examples assume your wireless device is wlan0. Replace wlan0 with the appropriate device name. Many cards require that the kernel interface be activated before you can use the wireless_tools:

# ifconfig wlan0 up

See what access points are available:

# iwlist wlan0 scan

Using the scan results, tell your wireless device which access point to use. For example:

# iwconfig wlan0 essid linksys

Then, setup the network interface as usual. Simple examples are:

# dhcpcd wlan0

for DHCP, or

# ifconfig wlan0 192.168.0.2
# route add default gw 192.168.0.1

for static IP.

The problem is that you have to retype every command each time you reboot. That's why the network configuration can be put in rc.conf:

/etc/rc.conf

  • The /etc/rc.conf file is sourced by the network script. Therefore, you may define and configure a simple wireless setup within /etc/rc.conf for a centralized approach with wlan_<interface>="<interface> essid <essid>" and INTERFACES=(<interface1> <interface2>). The name of the network goes in place of MyEssid.

For example:

# /etc/rc.conf
eth0="dhcp"
wlan0="dhcp"
wlan_wlan0="wlan0 essid MyEssid" # Unencrypted
#wlan_wlan0="wlan0 essid MyEssid key 1234567890" # hex WEP key
#wlan_wlan0="wlan0 essid MyEssid key s:asciikey" # ascii WEP key
INTERFACES=(eth0 wlan0)

(Not all wireless cards are wlan0. Determine your wireless interface with ifconfig -a.

Atheros-based cards, for example, are typically ath0, so change wlan_wlan0 to:

wlan_ath0="ath0 essid MyEssid key 12345678" 

Also define ath0 in the INTERFACES= line.)

  • Alternatively, you may define wlan_<interface> within /etc/conf.d/wireless, (which is also sourced by the network script), for a de-centralized approach:
# /etc/conf.d/wireless
wlan_wlan0="wlan0 essid MyEssid"

These solutions are good, but for a laptop which is always on the move it would be good to have multiple network profiles and be able to easily switch from one to another. That's the aim of netcfg:

netcfg

netcfg provides a versatile, robust and fast solution to networking on Arch.

It uses a profile based setup and is capable of detection and connection to a wide range of network types. This is no harder than using graphical tools. Following the directions above, you can get a list of wireless networks. Then, as with graphical tools, you will need a password.

Occasionally, you have to configure wpa_supplicant properly at first, if you want to use an encrypted wireless connection (eg: wep, wpa, wpa2, etc.) in netcfg, because netcfg package depends on wpa_supplicant.

Detailed article: Network Profiles

Detailed article for development version: Network Profiles development

Third-party wireless management

There are a number of wireless management solutions available to Arch Linux users as an alternative to the above scripts.

Autowifi

Autowifi is a daemon that configures your wireless network automatically depending on the ESSID. Once configured, no user interaction is necessary and no GUI tools are required.

For more information, see the Autowifi wiki.

Wicd

Wicd is a network manager that can handle both wireless and wired connections. It is written in Python and Gtk with fewer dependencies than NetworkManager, making it an ideal solution for lightweight desktop users. Wicd is now available in the extra repository for both i686 and x86_64.

For more information, see the Wicd wiki.

NetworkManager

NetworkManager is an advanced network management tool that is enabled by default in most popular Linux distributions. In addition to managing wired connections, NetworkManager provides worry-free wireless roaming with an easy-to-use GUI program for selecting your desired network.

For more information, see the NetworkManager wiki.

Wifi Radar

WiFi Radar is Python/PyGTK2 utility for managing wireless profiles (and only wireless). It enables you to scan for available networks and create profiles for your preferred networks.

For more information, see the Wifi Radar wiki.

Wlassistant

Wlassistant is a very intuitive and straightforward GUI app for managing your wireless connections.

Install with:

# pacman -S wlassistant

Wlassistant must be run with root privileges:

# sudo wlassistant

One method of using wlassistant is to configure your wireless card within /etc/rc.conf, specifying the access point you use most often. On startup, your card will automatically be configured for this essid, but if other wireless networks are needed/available, wlassistant can then be invoked to access them. Background the network daemon in /etc/rc.conf, by prefixing it with a @, to avoid boot delays.

Additional Resources