Showing posts with label Debian Lenny: Howto use iwl-wifi (Intel Wireless WiFi Link driver) with an iwl3945 or iwl4965. Show all posts
Showing posts with label Debian Lenny: Howto use iwl-wifi (Intel Wireless WiFi Link driver) with an iwl3945 or iwl4965. Show all posts

Saturday, March 7, 2009

How to use a WiFi interface

Once your wireless device has an interface available (verifiable with iwconfig), it is required to be configured to access a network. If you do not have a wireless interface present, please refer to WiFi for information on providing a driver for your device.

Wireless network interface configuration can be performed using a connection manager (such as NetworkManager) or through Debian's /etc/network/interfaces file with a special purpose utility (such as wpa_supplicant). Examples of NetworkManager and wpa_supplicant configuration are described below.

" src="http://wiki.debian.org/htdocs/rightsidebar/img/attention.png" title="" width="15" height="15"> The WEP algorithm is insecure and deprecated by WPA. Use of WEP is not recommended and is not covered within this document.

Network Manager

NetworkManager is configured by graphical interfaces, which are available for GNOME and KDE. Your wireless interface should not be referenced within Debian's /etc/network/interfaces file.

NetworkManager is also a front-end for wpa_supplicant.

GNOME

  1. Install the network-manager-gnome package:

    $ su
    # aptitude update
    # aptitude install network-manager-gnome
  2. Right-click on a GNOME panel and select "Add to Panel...".
  3. From the list presented, select "Network Monitor" and click "Add". A new systray applet will appear. Click "Close".
  4. Right-click on the applet and select "Properties".
  5. From the dialog presented, click "Configure". You will be asked for the administrative (root) password.
  6. A list of network interfaces will be displayed. Select your wireless interface, then click "Properties".
  7. Tick "Enable this connection" and enter details regarding your wireless network. Click "OK" when finished.

See also NetworkManager for frequently asked questions, documentation and support references.

KDE

  1. Install the network-manager-kde package:

    $ su
    # aptitude update
    # aptitude install network-manager-kde
  2. From the K Menu, select "Run Command". Enter "knetworkmanager" and click "Run".
  3. A new systray applet will appear.

ToDo: Complete knetworkmanager procedure.

See also NetworkManager for frequently asked questions, documentation and support references.

wpa_supplicant

wpa_supplicant is a WPA client and IEEE 802.1X supplicant.

The wpasupplicant package provides wpa-* ifupdown options for /etc/network/interfaces. If these options are specified, wpa_supplicant is started in the background when your wireless interface is raised and stopped when brought down.

  • {i} GNOME and KDE users shouldn't configure wpa_supplicant manually. Use NetworkManager as explained above.

Before continuing, install the wpasupplicant package:

  • $ su
    # aptitude update
    # aptitude install wpasupplicant

WPA-PSK and WPA2-PSK

{i} Also known as "WPA Personal" and "WPA2 Personal" respectively.

  1. Restrict the permissions of /etc/network/interfaces, to prevent pre-shared key (PSK) disclosure:

    # chmod 0600 /etc/network/interfaces
  2. Open /etc/network/interfaces in a text editor:

    # sensible-editor /etc/network/interfaces
  3. Define appropriate stanzas for your wireless interface, along with the SSID and PSK. For example:

    auto wlan0
    iface wlan0 inet dhcp
    wpa-ssid mynetworkname
    wpa-psk mysecretpassphrase
    The "auto" stanza will bring your interface up at system startup. If not desired, remove or comment this line.
  4. Save the file and exit the editor.
  5. Bring your interface up. This will start wpa_supplicant as a background process.

    # ifup wlan0

Additional wpa-* options are described within /usr/share/doc/wpasupplicant/README.modes.gz. This should also be read if connecting to a network not broadcasting its SSID.

For general /etc/network/interfaces information, see the interfaces(5) man page.

WPA-EAP

For networks using EAP-TLS, you are required to establish a wpa_supplicant configuration file and provide the client-side certificate. An example WPA2-EAP configuration file can be found at /usr/share/doc/wpasupplicant/examples/wpa2-eap-ccmp.conf.

Once available, reference your configuration file in /etc/network/interfaces. For example:

  • auto wlan0
    iface wlan0 inet dhcp
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

More information can be found in the wpa_supplicant.conf(5) man page. A fully-commented wpa_supplicant configuration file example is at /usr/share/doc/wpasupplicant/README.wpa_supplicant.conf.gz.

Switching Connections

To switch between multiple distinct configurations:

See Also

Monday, March 2, 2009

Debian Lenny: Howto use iwl-wifi (Intel Wireless WiFi Link driver) with an iwl3945 or iwl4965!

Wireless setup on Debian Lenny

This page describes how to use iwl-wifi (Intel Wireless WiFi Link driver) with an iwl3945 or iwl4965.

Introduction

The iwl-wifi drivers are open-source drivers supported by Intel, replacing the older Intel drivers ipw3945 which needed some userspace daemon (see ).

Supported hardware :

  • Intel 3945 and 4965 : since Etch 2.6.23 and later kernels (Etch's kernel 2.6.18 had ipw3945).

  • Intel 5100 and 5300 : see page iwlagn.

Installation

  • Install 2.6.24 (or later) kernel, available in :
  • Install Firmware. (You will need to add non-free repository to /etc/apt/source.list)
     aptitude install firmware-iwlwifi

Loading the iwl3945 / iwl4965 modules

  • The module should be loaded automatically by udev when the system starts.
  • Most laptops have a radio kill switch (or a function key combination) to physically disable the radio (when inside an airplane for example). Make sure to enable the radio.
  • If the module isn't loaded automatically, issue this command:

    iwl4965 :

    modprobe iwl4965

    iwl3945 :

    modprobe iwl3945

Using iwlWifi

Gnome Network Manager

  • Gnome- Double click on Network Connection (If you don't have an icon click on add to panel, then Select "Network Monitor" and click add)
  • Name: Wlan0
  • Click on configure
  • Select Wireless connection
  • Properties
  • Pick a network, add a password, select dhcp and click ok
  • You should be connected.
  • If the user as who you are currently logged in does not belong to group netdev add yourself to it:

adduser foo-user netdev

Alternatively,

  • Those who prefer using ifup/ifdown from the command line, I used the following stanza in /etc/network/interfaces/:

    iface wlan0 inet dhcp
    pre-up ip link set wlan0 up
    wireless_essid MakeTeaNotWar

Note the magic pre-up line, which I needed to make the card associate with the access point. As a bonus, with this stanza the interface works after an S3 resume (i.e. suspend/resume to RAM)!

Interfaces

Once the module is loaded, ip a should show two interfaces (wlan0 is the "main" one).

  • 3: wmaster0:  mtu 1500 qdisc ieee80211 qlen 1000
    link/ieee802.11 00:13:e8:70:69:fb brd ff:ff:ff:ff:ff:ff
    4: wlan0: mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:13:e8:70:69:fb brd ff:ff:ff:ff:ff:ff

Switching from ipw3945 to iwl3945

  • Install as explained above.
  • Check for the line generated by udev for ipw3945 in /etc/udev/rules.d/z25_persistent-net.rules. If it is there, remove it (more explanation in "Common problems and errors" below).
  • Optionally, change the configuration in /etc/network/interfaces by replacing eth2 (or whatever the old name for wireless interface is) with wlan0.
  • Reboot into the new kernel.
  • Verify that wireless networking is functional. If you can connect, but you cannot send/receive anything you might want to check your firewall configuration. For example, if you have configured your firewall using shorewall, you have to change all occurrences of eth2 in the files in /etc/shorewall with wlan0.
  • Remove the ipw3945-modules-* and ipw3945d packages.

Common problems and errors

Interfaces is named "wlan0_rename" (sysfs_create_symlink failed)

Another symptom is that Network-manager don't handle the wireless card.

/var/log/syslog may show :

  • kernel: iwl3945: Intel(R) PRO/Wireless 3945ABG/BG Network Connection driver for Linux, 0.1.15ks
    kernel: iwl3945: Copyright(c) 2003-2007 Intel Corporation
    kernel: ACPI: PCI Interrupt 0000:03:00.0[A] -> GSI 17 (level, low) -> IRQ 22
    kernel: PCI: Setting latency timer of device 0000:03:00.0 to 64
    kernel: iwl3945: Detected Intel PRO/Wireless 3945ABG Network Connection
    kernel: iwl3945: Tunable channels: 13 802.11bg, 23 802.11a channels
    kernel: wmaster0: Selected rate control algorithm 'iwl-3945-rs'
    kernel: net eth2: device_rename: sysfs_create_symlink failed (-17)
    kernel: udev: renamed network interface wmaster0 to eth2
    kernel: net wlan0_rename: device_rename: sysfs_create_symlink failed (-17)
  • This may occur if you had used ipw3945 module before.

Resolution

in /etc/udev/rules.d/z25_persistent-net.rules remove the line like

  • # PCI device 0x8086:0x4227 (ipw3945)
    SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="00:13:02:4c:12:12", NAME="eth2"

then remove the module and re-insert it.

  • rmmod iwl3945
    modprobe iwl3945

in /etc/udev/rules.d/z25_persistent-net.rules you should now have a line like :

  • # PCI device 0x8086:0x4227 (iwl3945)
    SUBSYSTEM=="net", DRIVERS=="?*", ATTR{address}=="00:13:02:4c:12:12", ATTR{type}=="1", NAME="wlan0"

Card does not associate to the access point

If the card accepts the essid, for example, by doing :

  • iwconfig wlan0 essid YourESSID

but does not associate to the access point even when no encryption is needed: The driver seems to need the interface to be in the up state when it gets the essid. So first do

  • ip link set wlan0 up

then set the essid as before.

If the card still does not associate to the access point even with essid and encryption keys set, try

  • iwconfig wlan0 ap any

If you configured you card in /etc/network/interfaces and you cannot associate to you access point, you might want to try different values for wpa-scan-ssid and wpa-ap-scan. The former accepts either 0 or 1, the latter 0, 1 or 2. Setting wpa-scan-ssid to 0 and wpa-ap-scan to 1 is a good first bet, but make sure to try other configurations if it doesn't work.

You may also find that setting a high retry value helps with WEP enabled access points that appear to work or that work with other cards but send repeated disassociates. Try something like this and insert an arbitrary retry value. It may take a few tries with dhclient to get an IP:

  • iwconfig wlan0 retry 

Can't see any network

If networkmanager seems to detect the card, but can't "see" any network, it might be because the firmware isn't installed. make sure you have installed the firmware, then unloaded and reloaded the module.

  • ACPI: PCI Interrupt 0000:03:00.0[A] -> GSI 17 (level, low) -> IRQ 17
    kernel: PM: Writing back config space on device 0000:03:00.0 at offset 1 (was 100102, writing 40100106)
    kernel: firmware: requesting iwlwifi-4965-1.ucode
    kernel: iwl4965: iwlwifi-4965-1.ucode firmware file req failed: Reason -2
    kernel: iwl4965: Could not read microcode: -2

You are able to associate, but you cannot send nor receive anything on the interface

If this happens, your firewall might be blocking your traffic. This will mostly happen if you switch from ipw3945/ipw4945 to iwlwifi because the name of the interface changes from eth2 to wlan0. Check your firewall configuration, e.g. if you are using shorewall check the files in /etc/shorewall/ and change the name of the interface to wlan0.

Supported devices

The page HowToIdentifyADevice/PCI explains how to identify a PCI device.

The following list is based on the alias fields of modinfo iwl3945 and modinfo iwl4965 on Lenny.

  • PCI: 8086:4222 Intel Corporation PRO/Wireless 3945ABG [Golan] Network Connection
    PCI: 8086:4227 Intel Corporation PRO/Wireless 3945ABG [Golan] Network Connection

    PCI: 8086:4229 Intel Corporation PRO/Wireless 4965 AG or AGN [Kedron] Network Connection
    PCI: 8086:4230 Intel Corporation PRO/Wireless 4965 AG or AGN [Kedron] Network Connection

See also


  • 1 ipw3945-vs-iwl3945: The Intel code in ipw3945 implements a number of non-free algorithms which are not realized in iwl3945, including automatic calibration of the radio power based on temperature variations, and dynamic tuning of the radio sensitivity based on received signal strength. These may extend the operating range of the adapter, improve throughput in various environmental conditions, and reduce power consumption, but they are kept secret by Intel.