Wireless Configuration

Configure Wireless icon

All material presented are licensed under The GNU Free Documentation License.


  1. Ndiswrapper driver configuration for desktop computer packages.
  2. WPASupplicant for wireless network configuration (deprecated).
    1. Managed Mode
    2. Roaming Mode
  3. References

  1. Ndiswrapper

    This package is for installing wireless cards and it only exists for Desktop Systems; Laptop system have the wireless cards preconfigured and installed. If you had purchased a wireless card along with your Computer package, it would have been installed for you. If you purchase the wireless card elsewhere, the following will help you install the driver and get you going.

    Additional configuration for your network(s) needs to be done in WPASupplicant.

    The debian package for ndiswrapper are compiled along with the custom kernel. The package is preinstalled on the system. However, you will still need to download and add the driver for your particular wireless card.

    The following is an extract from the ndiswrapper - wiki (see reference) customized and reproduced for you convenience.

    Prerequisites

    1. Prior to purchasing a wireless card for your Linux machine, please check this List of cards for a compatible chipset. If you are purchasing through Linuxvillage.ca, we sell only compatible wireless card and if the card was purchase along with the computer, it would have been preconfigured for you.
    2. Installed ndiswrapper-modules, available in debian package. Check for precompiled kernel modules in Synaptic Package Manager.
    3. Installed ndiswrapper-utils, available in synaptic package manager.
    4. Installed ndiswrapper-common scripts, available in synaptic package manager.
    5. Wireless-tools is a package containing tools used to manipulate Linux Wireless Extensions. It provides settings and stats. (Recommended but not essential.)
    6. A Internet connected PC to download windows driver for the wireless card.

    Installation Instructions

    1. To identify the driver that you need, first identify the card you have with 'lspci' and note the first column such as 00:09.0. You will need to "su" as root in a terminal window to do this. e.g.
      00:09.0 Network controller: Broadcom Corporation BCM4318 ... 
              [AirForce One 54g] 802.11g Wireless LAN Controller (rev 02)
      Then find out the PCI ID of the card that with 'lspci -n' corresponding to the first column of 'lspci' output. e.g.
      00:09.0 0280: 14e4:4318 (rev 02)
      The PCI ID is third column or fourth in some distributions and of the form '14e4:4318'.
    2. Now you need to get the Windows driver for this chipset. In the list, find out an entry for the same PCI ID, and download the driver corresponding to it form the List of Cards.
    3. Unpack the Windows driver with unzip/cabextract/unshield tools, and find the INF file (.INF or .inf extension) and the SYS file (.SYS or .sys extension). If there are multiple INF/SYS files, you may look in the list if there are any hints about which of them should be used. Make sure the INF file, SYS file and any BIN files (For example, TI drivers use BIN firmware) files are all in one directory.
    4. Now use the 'ndiswrapper' tool to install the driver.
      # ndiswrapper -i filename.inf
      This copies all necessary files to /etc/ndiswrapper and creates the config files for your card.
    5. To verify installation status run
      # ndiswrapper -l 
      If your installation was successful the following respond should appear:
      Installed drivers:
      bcmwl5   driver installed, hardware present
      
      Where 'present' means that you have a card that can be used with the driver installed. In this case, broadcom driver bcmwl5 is used.
    6. Now to load the module, run
      # depmod -a
      and then run
      # modprobe ndiswrapper
      Verify result by checking the system log produced by dmesg. If the driver is loaded successfully, you should see a message in the system log
      # ndiswrapper version <version> loaded
    7. To verify driver is loaded and the system can see it, run
      # iwconfig
      You should see wlan with a interface available.
    8. Next step, configure Wpasupplicant.

    Uninstalling

    To uninstall a driver, run
    # ndiswrapper -e filename 
    To uninstall ndiswrapper, go to synaptic package manager and uninstall ndiswrapper module and ndiswrapper util. You should find it in the Status section under the heading "installed (local or obsolete)".

    Trouble Shooting

    For trouble shooting first run
    # lsmod
    to check for existence of ndiswrapper module. Then, run
    # ndiswrapper -l 
    to see if the driver is installed correctly. If the driver is shown but the iwconfig shows no hardware interface, then the driver is incorrect.

    Two common problems with ndiswrapper:

    • Driver compiled in the kernel is conflicting with ndiswrapper. e.g. Broadcom driver in kernel (bcm43xx). It can be tell by ndiswrapper -l and it should show an alternate driver.
      bcmwl5 : driver installed
             device (14E4:4320) present (alternate driver: bcm43xx)
      
      Soln: Recompile the kernel without the in-kernel driver or don't use ndiswrapper and use the in-kernel driver.
    • Ndiswrapper won't load on startup. Soln: Put ndiswrapper in /etc/modules.

    See reference section for further documentations. If you are having problems with resumption from hibernation, check the suspend2 configuration.

    References:

    Updated: 2007-09-06

    Back to top
  2. WPASupplicant

    Warning

    The material in this section is deprecated. It remains here for historical and archival purposes. Please use Network Manager instead. It is much more robust and easier to use.

    WPA Supplicant is the application responsible for communicating with the local Wireless AP. More in wiki.

    WPA_Supplicant provides key negotiation with the WPA Authenticator, and controls association with IEEE 802.11i networks. WPA and WPA2 are methods for securing wireless networks, the former using IEEE 802.1X, and the latter using IEEE 802.11i. WEP and Plain Text are also supported.

    Network handshaking such as IP allocation are handled outside of wpa_supplicant. It is specified in the network interfaces file.

    Prerequisites

    1. wpagui is a gui for accessing wpa_supplicant.
    2. wpasupplicant is a client for wireless networks.
    3. Wireless card interface driver preloaded and tested. e.g. (ndiswrapper, ipw3945, a bcmXX00 driver, etc...)
    4. ifplugd is a daemon for dynamically configuring your ethernet device when connected or disconnected from the network. (Recommended but not essential.)
    5. Wireless-tools is a package containing tools used to manipulate Linux Wireless Extensions. It provides settings and stats. (Recommended but not essential.)
    6. guessnet is a package for network detection tool. Use mainly for mobile users when moving a machine among networks which don't necessarily provide DHCP. (Optional)

    Installation Instructions

    1. Install all the programs in the prerequisites.
    2. Create a user group called wireless and add all the local users on this machine into the group.
    3. Use visudo to give access to wpa applications. From a root shell issue the following command.
      # visudo
      Enter the following under User privilege specification in sudoers:
      %wireless  ALL=NOPASSWD: /usr/sbin/wpa_supplicant
      %wireless  ALL=NOPASSWD: /usr/sbin/wpa_cli
      %wireless  ALL=NOPASSWD: /usr/sbin/wpa_gui
    4. Optional: Change the /etc/wpa_supplicant/wpa_supplicant.conf file to root readable only. From a root shell issue the following command.
      # chmod 600 /etc/network/interfaces
      # chmod 600 /etc/wpa_supplicant/wpa_supplicant.conf
      
    5. Configure wpa_supplicant with either the Managed Mode or the Roaming Mode as described below.

      Managed Mode

      Managed mode assumes the user is setting up for one wireless network. There are two ways wpa_supplicant can be specified in managed mode.

      • All wpa- parameters are specified inside /etc/network/interfaces file. These elements needed to be manually specified under iface.
        Element		Example Value		Description
        =======		=============		===========
        wpa-ssid	plaintextstring		sets the ssid of your network
        wpa-bssid	00:1a:2b:3c:4d:5e	the bssid of your AP
        wpa-psk		0123456789......	your preshared wpa key. Use
        					wpa_passphrase(8) to generate your psk
        					from a passphrase and ssid pair
        wpa-key-mgmt	NONE, WPA-PSK, WPA-EAP,	list of accepted authenticated key
        		IEEE8021X		management protocols
        wpa-group	CCMP, TKIP, WEP104,	list of accepted group ciphers for WPA
        		WEP40
        wpa-pairwise	CCMP, TKIP, NONE	list of accepted pairwise ciphers for
        					WPA
        wpa-auth-alg	OPEN, SHARED, LEAP	list of allowed IEEE 802.11
        					authentication algorithms
        wpa-proto	WPA, RSN		list of accepted protocols
        wpa-identity	myplaintextname		administrator provided username
        					(EAP authentication)
        wpa-password	myplaintextpassword	your password (EAP authentication)
        wpa-scan-ssid	0 or 1			toggles scanning of ssid with specific
        					Probe Request frames
        wpa-ap-scan	0 or 1 or 2		adjusts the scanning logic of
        					wpa_supplicant
        
        For further details read README.modes, README.Debian and README.wpa_supplicant, etc in /usr/share/doc/wpasupplicant. Here is an example interfaces file.

        note: The drawback for using the interface file is not easily modifiable by normal user. The advantage is also it is not easily modifiable by normal user. e.g. home desktop user would like to change things conveniently, institutional administrator don't want users to mess up system setup and call for help.

      • For this setup all wireless parameters are specified in /etc/wpa_supplicant/wpa_supplicant.conf file. The minimum is specified in /etc/network/interfaces file. The rest is contained in the /etc/wpa_supplicant/wpa_supplicant.conf file. Here is an example interfaces file and an example wpa_supplicant.conf file. The netwok details can be setup using wpa_gui. If you are switching network, you may have to release the dhcp lease by issuing the following command in a root shell.

        # ifdown wlan0

        For further details read README.modes, README.Debian, etc in /usr/share/doc/wpasupplicant.

      Roaming Mode

      Roaming mode is for mobile users who switches network frequently. e.g. From home to office to cafe to bar to home...

      1. The minimum specification needed in the interfaces (in /etc/network/) must have the following:
        iface eth2 inet manual
        	wpa-driver wext
        	wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
        

        where eth2 is replaced by whatever interface is in used and wext is whatever the network driver is used. Lines referencing guessnet is optional.

        An example interfaces file and wpa_supplicant.conf file is provided for your perusal. Please uncomment and edit the file to suit your local requirements.

      2. Test the wireless interface connection by issuing the following command.

        # ifup eth2
        # iwconfig
        

        You should see the following:

        The new wpa_supplicant configuration is brought up by ifup/down.

        For further details read README.modes, README.Debian and README.wpa_supplicant, etc in /usr/share/doc/wpasupplicant.

    6. Test and configure your wireless network by doing the following.
      1. Check hardware interface with iwconfig for the connection to the AP. From a root shell issue the following command.
        # ifup wlan0
        # iwconfig
        

        where wlan0 is your wireless interface file.

        Responses similar to the following should appear if you have not specified the network information.

        wlan0 IEEE 802.11g  ESSID:off/any
                  Mode:Managed  Frequency:2.462 GHz  Access Point: Not-Associated
                  Bit Rate:54 Mb/s   Tx-Power:25 dBm
                  RTS thr:2347 B   Fragment thr:2346 B
                  Encryption key:off
                  Power Management:off
                  Link Quality:0  Signal level:0  Noise level:0
                  Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
                  Tx excessive retries:0  Invalid misc:0   Missed beacon:0
        
      2. Use wpa_gui to configure the network if no static information or network information is specified in the interfaces file.

        # wpa_gui
      3. After wpa_gui information is provided, issue the following commands and the next part should appear.

        # ifdown wlan0
        # ifup wlan0
        # iwconfig
        
        wlan0     IEEE 802.11g  ESSID:kitchen
                  Mode:Managed  Frequency:2.437 GHz  Access Point: 00:19:18:4A:3A:FF
                  Bit Rate:54 Mb/s   Tx-Power:25 dBm
                  RTS thr:2347 B   Fragment thr:2346 B
                  Encryption key:23BC-BBEE-CCFE-086F-1758-E18E-15A1-020D-...   Security mode:restricted
                  Power Management:off
                  Link Quality:25/100  Signal level:-80 dBm  Noise level:-96 dBm
                  Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
                  Tx excessive retries:0  Invalid misc:0   Missed beacon:0
        
      4. Use ifconfig for checking the connection to local dhcp server. An IP address should have been allocated from the local dhcp server. (skip this step if a manually set IP address is used.)

        # ifconfig

        Responses similar to the following should appear.

        wlan0     Link encap:Ethernet  HWaddr 00:12:17:69:C2:3F
                  inet addr:192.168.1.133  Bcast:192.168.1.255  Mask:255.255.255.0
                  inet6 addr: fe80::215:17ee:fe6b:c2ef/64 Scope:Link
                  UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
                  RX packets:38454 errors:0 dropped:0 overruns:0 frame:0
                  TX packets:29103 errors:0 dropped:0 overruns:0 carrier:0
                  collisions:0 txqueuelen:1000
                  RX bytes:40459188 (38.5 MiB)  TX bytes:3456147 (3.2 MiB)
                  Interrupt:225 Memory:fbef8000-fbefa000
        
      5. ping the local gateway. e.g. 192.168.1.1 From a root shell issue the following command.

        # ping 192.168.1.1

        Responses similar to the following should appear.

        PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
        64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=5.46 ms
        64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=1.12 ms
        ...
        --- 192.168.1.1 ping statistics ---
        7 packets transmitted, 7 received, 0% packet loss, time 6020ms
        rtt min/avg/max/mdev = 1.111/4.433/13.475/4.132 ms
        

        If another machine is available on the network, ping this machine from that as well to check communication is established both ways.

    7. Specify the intefaces used in ifplugd. From a root shell issue the following command.

      # dpkg-reconfigure ifplugd

      Specify appropriate interfaces to monitor. e.g. For a desktop, specify auto for static interfaces and nothing for hotplug interfaces, default parameters and stop for suspend.

    8. To add a finishing touch, create a desktop and an icon for your gnome users. Then, put them in their appropriate places - from a root shell issue the following command.

      # cp wireless.desktop /usr/share/applications
      # cp wireless.png /usr/share/pixmaps
      

    Updated: 2006-11-17

    Back to top
  3. References

    Updated: 2006-01-03

    Back to top