TUD Logo

Deutsch |   Search 
TUD Home » ... » Dienste » WLAN » WLAN unter Linux

Faculty of Computer Science

DFNRoaming WLAN unter Linux

Die hier folgende Beschreibung für Linux wurde unter Debian/Sarge und Kernel Version 2.6.18.2 erstellt und bei der wireless Hardware handelt es sich um einen Intel PRO/Wireless 2915ABG Adapter. Die Kernelversion enthält bereits Driver für den o.g. WLAN-Adapter und den erforderlichen IEEE 802.11 Networking Stack. Es sind beim Bilden des Kernels auch die Module IEEE80211_CRYPT_CCMP und IEEE80211_CRYPT_TKIP (für IEEE802.11i support also WPA, WPA2...) zu erstellen.

Die Module IEEE80211 (IEEE 802.11 Networking Stack), IEEE80211_CRYPT_TKIP, IEEE80211_CRYPT_CCMP und das Modul für den WLAN-Driver (hier IPW2200) müssen vor dem Start von wpa_supplicant geladen werden.

Die Firmware für den Intel PRO/WLAN-Adapter muss nach /lib/firmware installiert werden. Im hier beschriebenen Fall ist das die Version 3.0. Die Firmware kann man sich hier herunterladen.

  1. Installieren Sie als nächstes den wpasupplicant (in diesem Falle Version 0.5.5-2 aus der "etch"-Distribution)
  2. Erstellen Sie ein Konfigurationsfile /etc/wpa_supplicant/wpa_supplicant.conf, die Einträge für "identity" und "password" müssen Sie durch Ihre eigenen ZIH-Login-Daten ersetzen.
    • ein Beispiel für WPA:
      ctrl_interface=/var/run/wpa_supplicant
      ctrl_interface_group=0
      eapol_version=1
      ap_scan=1
      fast_reauth=1
      
      network={
              ssid="eduroam"
              key_mgmt=WPA-EAP
              proto=WPA
              pairwise=TKIP
              group=TKIP
              eap=TTLS
              anonymous_identity="anonymous@tu-dresden.de"
              identity="sXXXXXXX@tu-dresden.de"
              password="**your ZIH-Password**"
              ca_cert="/etc/wpa_supplicant/TUD-CACert.pem"
              phase2="auth=PAP"
              priority=2
              }
      
    • ein Beispiel für RSN (WPA2) :
      ctrl_interface=/var/run/wpa_supplicant
      ctrl_interface_group=0
      eapol_version=2
      ap_scan=1
      fast_reauth=1
      
      network={
              ssid="eduroam"
              key_mgmt=WPA-EAP
              proto=RSN
              pairwise=CCMP
              group=TKIP
              eap=TTLS
              anonymous_identity="anonymous@tu-dresden.de"
              identity="sXXXXXXX@tu-dresden.de"
              password="**your ZIH-Password**"
              ca_cert="/etc/wpa_supplicant/TUD-CACert.pem"
              phase2="auth=PAP"
      #   priority=2
              }
      
  3. Kopieren Sie das Zertifikatfile TUD-CACert.pem in das Verzeichnis /etc/wpa_supplicant/
  4. Starten Sie den wpa_supplicant:
    > wpa_supplicant -c /etc/wpa_supplicant/wpa_supplicant.conf -i mywlan -D wext
    ....
    CTRL-EVENT-EAP-SUCCESS EAP authentication completed successfully
    WPA: Key negotiation completed with 00:xx:xx:xx:xx:xx [PTK=CCMP GTK=TKIP]
    CTRL-EVENT-CONNECTED - Connection to 00:xx:xx:xx:xx:xx completed (auth)
    [id=0 id_str=]
    
  5. Wenn die Verbindung wie oben "CONNECTED" ist, dann kann per DHCP die IP-Adresse für das WLAN-Interface bezogen werden:
    > dhclient mywlan
    
  6. Einfacher geht das Ganze, wenn man folgendes Script nach /sbin/wlan_tu kopiert und mit
    > chmod +x /sbin/wlan_tu
    
    ausführbar macht. Und es müsste das Netzwerkdevice für das WLAN mit wlan0 benannt oder der DEVICE-Eintrag im Script entsprechend angepasst werden:
    #!/bin/sh
    #
    # description:  This small start/stop-script will let you control 
    #               your wpa_supplicant application to handle its correct
    #               usage.
    # @name:        wpa_supplicant.sh
    # @author:      Thomas Pischulski 
    # @expanded:    Alexander Hagenah 
    # @created:     04/02/2008
    
    
    # VARIABLES
    # Edit them to match your system settings
    DEVICE="wlan0"
    CONFIG="/etc/wpa_supplicant/wpa_supplicant.conf"
    USERID=`id -u`
    ANSWER=""
    
    
    if [ $USERID != 0 ]; then
            echo "You're not root"
            exit 0
    
    else
            case "$1" in
                    "start")
                            WPAPID=`pidof wpa_supplicant`
                            if [ $? -eq 0 ]; then
                                    echo "wpa_supplicant process still running."
                                    echo "Kill it? [y/n] "
                                    read ANSWER
    
                                    case "$ANSWER" in
    
                                            "y"|"Y") 
                                                    kill -9 $WPAPID
                                            ;;
    
                                            "n"|"N")
                                                    echo "Could not start wpa_supplicant because another"
                                                    echo "process is still running. Exiting.."
                                                    exit 0
                                            ;;
    
                                            *)
                                                    echo "Answer not allowed. Exiting.."
                                                    exit 0
                                    esac
                            fi
    
                            ifconfig $DEVICE up
                            wpa_supplicant -dd -B -c $CONFIG -i $DEVICE -D wext
                            dhclient $DEVICE
                    ;;
    
                    "stop")
                            ifconfig $DEVICE down
                            killall wpa_supplicant
                    ;;
    
                    *) echo "No argument given. Usage: wlan_tu (start|stop)";
            esac
    fi
    
    mit
    > /sbin/wlan_tu start
    
    wird die WLAN-Verbindung zum eduroam gestartet. Dieses Script ist campusweit nutzbar, sofern die SSID eduroam verfügbar ist.
Last modified: 10th Oct 2008, 8.12 AM
Author: Dipl.-Ing. Christine Kuhlmey

Contact
Benutzerberatung

Phone: +49 (0) 351 463-31666
Fax: +49 (0) 351 463-42328
e-mail contact form

Office:
Room Willers-Bau A 218