Difference between revisions of "Wireless network configuration"

From ArchWiki
Jump to: navigation, search
('''/etc/rc.conf''')
(b43)
Line 208: Line 208:
 
#Unpack the compressed file.<pre>tar xjf broadcom-wl-4.80.53.0.tar.bz2</pre>
 
#Unpack the compressed file.<pre>tar xjf broadcom-wl-4.80.53.0.tar.bz2</pre>
 
#Change the current directory to the newly created directory, and then further to the kmod folder: <pre>cd broadcom-wl-4.80.53.0/kmod</pre>
 
#Change the current directory to the newly created directory, and then further to the kmod folder: <pre>cd broadcom-wl-4.80.53.0/kmod</pre>
#Run <pre>b43-fwcutter -w "/lib/firmware/" wl_apsta.o</pre> You may have to create /lib/firmware first.
+
#Create /lib/firmware if you don't have and then Run <pre>b43-fwcutter -w "/lib/firmware/" wl_apsta.o</pre>  
 
#Restart, and configure your device as normal. You may want to add b43 into the modules section of your rc.conf file. Good luck!
 
#Restart, and configure your device as normal. You may want to add b43 into the modules section of your rc.conf file. Good luck!
  

Revision as of 03:00, 6 June 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 Linux for that matter) is a two-part process. The first part is to identify and install the correct driver for your wireless device. The second is choosing a method of managing wireless connections. This article covers both parts, and provides additional links to wireless management tools.

Part I: Wireless Drivers

First steps

  1. Check to see whether Linux supports your hardware. You can find out what your card is with 'hwdetect --show-net' or lshwd.
    • 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
    • ipw3945 for Intel Pro/Wireless 3945 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
    • 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)

Installation

First off, make sure you grab wireless-tools from pacman

pacman -S wireless_tools

You cannot initialize wireless hardware without these tools.

Drivers

Here are the details of how to get the drivers for your card. You may find that there are several options open to you, so remember you can check the HCL for help on selecting the best driver.

wlan-ng

pacman -S wlan-ng26 wlan-ng26-utils

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.

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

pacman -S 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.

RT61

For PCI/PCMCIA cards based on Ralink's later generation of 802.11g chipsets (including those supporting proprietary MIMO modes). See the RT61 wiki page.

RT73

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

madwifi

pacman -S madwifi

The module is called ath_pci. You 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 your 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:

pacman -S ipw2100-fw

or:

pacman -S ipw2200-fw

You will probably need to reboot for the firmware to be loaded.

ipw3945 and ipw4965

ipw3945 is the old driver. It uses device name ethX. It requires a regulatory daemon name ipw3945d, and firmware named ipw3945-ucode.

iwl3945 is the new driver. It uses device name wlan0. It has no regulatory daemon, and uses firmware iwl3945-ucode. The new driver will work for both the 3945 and 4965 chipsets and is conveniently included with kernel v2.6.24 and up. Since the iwl3945 driver is newer, it is recommended to try first. Simply grab the firmware that corresponds to your chipset:

pacman -S iwlwifi-3945-ucode

or:

pacman -S iwlwifi-4965-ucode

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

If you would like to manually load the driver at boot-up, add it your MODULES array:

nano /etc/rc.conf

in the MODULES=() array, add iwl3945 or iwl4965 to the list, depending on your chipset

CTRL + X, Y to close and save.

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

Note: if the iwlwifi drivers, being "experimental", do not work, know that the windows NETw4x32 driver works with ndiswrapper just fine.

ipw3945 (Alternate Method)

Note: This ipw3945 driver will be phased out as Intel's iwlwifi project drivers reach maturity.

pacman -S ipw3945

This should install ipw3945-ucode, ipw3945, and ipw3945d (daemon).

To properly initialize the driver on startup...

nano /etc/rc.conf

in the modules=() array, add ipw3945 to the list

in the daemons=() array, add ipw3945d to the list (its order must come BEFORE network and dhcdbd/networkmanager in the array)

CTRL + X, Y to close and save.

The ipw3945 module should load during "Loading Modules.." and "Starting IPW3945d" should appear during daemon initialization, and ethX should be present.

Update: On my HP nc6320 the Bluetooth won't connect unless you unload the ipw3945 module.

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). To install ndiswrapper use the steps below:

To install the ndiswrapper use pacman:

pacman -Sy ndiswrapper ndiswrapper-utils

Note: Beyond kernel needs the packages ndiswrapper-beyond instead of the ndiswrapper package!

Note: If you do not have internet access on the machine running Arch, you can also download the packages to a disk from one of the mirrors, e.g. http://www2.cddc.vt.edu/linux/distributions/archlinux/extra/os/i686/ . (Note: this mirror seems to be outdated, better use ftp://ftp.archlinux.org/core/os/i686/ ) You need the ndiswrapper (or ndiswrapper-beyond as it says above) and ndiswrapper-utils packages. You may also have to download the latest kernel26 (or beyond), as the version provided on the CD is not always the latest one.

Once the installation has completed, follow the 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

Install the 'tiacx' and 'tiacx-firmware' packages from the core repository.

pacman -S 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] or [2]. 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
    hwd -s
    to determine that you have an appropriate card. My output of hwd -s looked like this:
    Network    : BCM4318 [AirForce One 54g] 802.11g Wireless LAN Controller module: unknown

For a list of supported devices, see here.

  1. Install the firmware cutter application from core. It is named b43-fwcutter.
  2. Download version 4.80.53.0 of Broadcom's proprietary driver.
    wget http://downloads.openwrt.org/sources/broadcom-wl-4.80.53.0.tar.bz2
  3. Unpack the compressed file.
    tar xjf broadcom-wl-4.80.53.0.tar.bz2
  4. Change the current directory to the newly created directory, and then further to the kmod folder:
    cd broadcom-wl-4.80.53.0/kmod
  5. Create /lib/firmware if you don't have and then Run
    b43-fwcutter -w "/lib/firmware/" wl_apsta.o
  6. Restart, and configure your device as normal. You may want to add b43 into the modules section of your rc.conf file. Good luck!

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 [3] for a list of supported devices. You only need to install the firmware for the device:
pacman -Sy zd1211-firmware

Test Installation

After loading your driver run

iwconfig

and see if a wireless interface (wlanX, ethX, athX) is recognized

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.

Arch-based wireless management

Arch Linux provides several solutions for managing wireless connections. Choosing the best method depends on your individual needs.

/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. For example:
# /etc/rc.conf
eth0="dhcp"
wlan0="dhcp"
wlan_wlan0="wlan0 essid MyEssid" # Unencrypted
#wlan_wlan0="wlan0 essid MyEssid key 12345678" # WEP
#wlan_wlan0="wlan0 essid MyEssid key s:wirelesspassword" # WPA
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 ....". Also define ath0 in the INTERFACES= line.)

  • Alternatively, you may define wlan_* 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"

Netcfg2

Netcfg2 provides a more versatile, robust solution which may be preferred, especially if you roam from network to network. Documentation: Network Profiles

More details on development: Network Scripts

wireless-tools

These powerful console tools work extremely well and allow complete, manual control. 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

or

ifconfig wlan0 192.168.0.2
route add default gw 192.168.0.1

Third-party wireless management

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

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.

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.

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