Table des matières

Configuration avancée de WPA sur la distribution Xandros (sans ndiswrapper)

Cette page est destinée à aider les utilisateurs de la distribution Xandros pour se connecter à des réseaux sécurisés utilisant un protocole non supporté par les drivers et wpa_supplicant qu iest inclus dans Xandrois. Cela inclus WPA-EAP (Enterprise), et d'autres. WPA-PSK fonctionne avec les drivers par défaut, mais cette implementation fonctionne aussi avec les instructions suivantes.

La plupar des instructions sont tirées de ce fil du forum : http://forum.eeeuser.com/viewtopic.php?id=1844

Toutes les commandes sont effectuées dans un terminal. Pour ouvrir xterm en mode basique, appuyez sur Ctrl-Alt-T.

Télécharger wpa_supplicant depuis un repository Debian

En premier lieu, il faut sauvegarder les binaires de wpa_supplicant inclus dans l'installation par défaut.

tar jcf /home/user/old_wpa_supplicant.tar.bz /usr/sbin/wpa_supplicant /usr/sbin/wpa_cli

Puis il faut les supprimer.

sudo rm -v /usr/sbin/wpa_supplicant /usr/sbin/wpa_cli

Maintenant téléchargez et installez le wpasupplicant de Debian. On peut le faire en utilisant apt-get (si vous avez au préalable configuré les repository comme indiqué :http://wiki.eeeuser.com/addingxandrosrepos):

sudo apt-get install wpasupplicant

Ou alors téléchargez le paquet et installez le à la main :

   sudo dpkg -i <path to downloaded deb>/wpasupplicant_0.5.5-2_i386.deb

Installez les drivers madwifi

Thanks to TundraMan, the madwifi drivers have been compiled for the default installed kernel.

   cd /lib/modules/2.6.21.4-eeepc
   sudo tar jcf /home/user/old_atheros.tar.bz2 atheros/*
   cd atheros
   sudo rm *
   sudo tar jxf /home/user/ath.tar.bz2
   sudo depmod
   sudo ln -s /sbin/wpa_supplicant /usr/sbin/wpa_supplicant
   sudo ln -s /sbin/wpa_cli /usr/sbin/wpa_cli
   sudo nano /etc/wpa_supplicant/functions.sh

Search (ctrl+w in nano) for “wext” until you come to the line (should be line 188) that looks like this: (should be the 2nd search result)

   WPA_SUP_DRIVER="wext"

Change it to:

   WPA_SUP_DRIVER="madwifi"

Now Ctrl+O to overwrite (save changes) and hit enter, Then Ctrl+X to exit

At this point, if you had a working WIFI configuration and connection, you should be able to still use it. If you modified the /etc/wpa_supplicant/functions.sh file you should be able to connect to basic WPA networks using the Network configuration tool.

Create a wpa_supplicant.conf_MINE for your secure network.

There's a plethora of sample configuration that are available. Your network administrator may be able to help with the exact details. A sample wpa_supplicant.conf is found within the wpasupplicant package that was installed in this directory:

 /usr/share/doc/wpasupplicant/examples/

Here's one that worked for me, for my work's network that uses a certificate that I downloaded from their server:

ctrl_interface=/var/tmp/wpa_supplicant
ctrl_interface_group=0
eapol_version=1
#Sets AP sellection to be handled by wpa_supplicant or the driver.  
# 0=driver 1=wpa_supplicant
ap_scan=1
#Begin Network Block
#--------------------------------
network={
      ssid="some_secure_network"
      scan_ssid=1
      proto=WPA
      key_mgmt=WPA-EAP
      pairwise=TKIP
      eap=PEAP
      ca_cert="/etc/certs/CAcert.cer"
      identity="myusername"
      password="mypasswrd"
}

Save it in your home directory (/home/user) as wpa_supplicant.conf. Then copy this file to the /etc directory:

sudo cp wpa_supplicant.conf /etc/wpa_supplicant.conf_MINE

Create a New Network Configuration

The instructions below should allow you to keep Network Configurations that you have found to work, that do not require a special setup (i.e. those that do not need EAP).

Create a new wireless connection type:

Your new connection type should now be shown in the GUI.

Now.. modify the file /etc/network/interfaces (as root, or with sudo).

sudo nano /etc/network/interfaces
iface lan6 inet manual

Your connection may have a different lan#. You should be able to identify it with the SSID from the wireless-essid line.

up ifconfig $IFACE up

Insert these lines:

up cp /etc/wpa_supplicant.conf_MINE /etc/wpa_supplicant.conf.ath0
up wpa_cli -p /var/tmp/wpa_supplicant reconfigure

The first line overwrites the wpa_supplicant.conf.ath0 that is automatically generated by the xandros scripts, with your own (wpa_supplicant.conf_MINE). The second line tells the supplicant to reload the configuration (since it used the automatically generated one, when it started).

For reference, here's a sample /etc/network/interfaces that works for WEP (lan2) and WPA-EAP (lan6) :

 auto lo
 iface lo inet loopback
 iface eth0 inet dhcp
 iface lan2 inet manual
    down dhclient3 -r -pf /var/run/dhclient.$IFACE.pid -lf /var/run/dhclient.$IFACE.leases $IFACE
    down ifconfig $IFACE down
    up ifconfig $IFACE up
    up dhclient3 -cf /etc/dhcp3/dhclient.$LOGICAL.conf -pf /var/run/dhclient.$IFACE.pid -lf /var/run/dhclient.$IFACE.leases $IFACE
    wireless-channel 6
    wireless-essid work_wep
    wireless-key s:SOMESECUREKEY
    wireless-keymode open
    wireless-mode auto
    wireless-rate auto
    xncs-wireless-encryption wep
iface lan6 inet manual
    down dhclient3 -r -pf /var/run/dhclient.$IFACE.pid -lf /var/run/dhclient.$IFACE.leases $IFACE
    down ifconfig $IFACE down
    up cp /etc/wpa_supplicant.conf_MINE /etc/wpa_supplicant.conf.ath0
    up wpa_cli -p /var/tmp/wpa_supplicant reconfigure
    up ifconfig $IFACE up
    up dhclient3 -cf /etc/dhcp3/dhclient.$LOGICAL.conf -pf /var/run/dhclient.$IFACE.pid -lf /var/run/dhclient.$IFACE.leases $IFACE
    wireless-essid work_wpa
    wireless-key s:SOMEFAKEKEY
    wireless-keymode open
    wireless-mode auto
    wireless-rate auto
    xncs-wireless-encryption wpa

Now… cross your fingers, and attempt to connect to this network configuration. Because of the complexity of the authentication process, the connection may take 20-30 seconds to establish.