wpa Roaming GUI

wpa-roaming is a method with which you can browse and connect to wireless networks within and without a graphical desktop environment. This is very convenient for notebook users.

wpasupplicant is a program to not only address wireless networks with WPA keys but all wireless networks. In combination with the "classic" /etc/network/interfaces it is a very powerful method to connect to networks without even doing anything. It does it automatically if a network is open or the network is added to a configuration file. Even more convenient: if you allow hotplugging, the correct connection is set fully automated right after logging in (into a desktop environment or into a non X session).

Basics

To be able to use wpa-roaming with wpasupplicant in a GUI environment you have to have two packages installed:
* wpasupplicant
* wpagui

apt-get update && apt-get install wpasupplicant wpagui

wpasupplicant is mandatory, wpagui is a very convenient addition for GUI controlled networking in environments in which you want to change your access point.

Using wpa-gui without network configuration

As root adapt your /etc/network/interfaces so that it contains these lines. the name of the interface may vary:

allow-hotplug wlan0
iface wlan0 inet manual
  wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp

As root you also edit a raw /etc/wpa_supplicant/wpa_supplicant.conf:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
        key_mgmt=NONE
}

The next step secures wpa_supplicant.conf from unwanted access. This is necessary, because secret keys of private networks are saved in this file:

chmod 600 /etc/wpa_supplicant/wpa_supplicant.conf

Running it

Prerequisites:

* Make sure, you are member of the group netdev
* Restart the network or reboot

The user created during the installation of sidux, is already a member of the netdev group. Any new users created must be added to the netdev group by root.
Now reload wpasupplicant as root with:

wpa_action <interface> reload

In many cases after the first setup of wpa-roam an existing network connection needs to be stopped and the wireless interface has to be brought up. You can use those commands as root:

ifdown $interface  ## stops a running network connection
/etc/init.d/networking restart  ## network configuration newly loaded - not always needed
ifup wlan0  ## wlan0 is just a common name for a wireless interface. Take the name from /etc/network/interfaces

Starting wpa_gui

As user start the wpa_gui (you need the full path):

/usr/sbin/wpa_gui

The default screen:

Default Screen

The interface for managing networks:

The interface

To add a known network just click add and you will get this interface with pulldown menus (supports no encryption, WEP, WPA - just add the correct data) and hit add here as well:

Known Network

Or more easily, just hit:scan to scan the network

Scanning

and doubleclick on the network you want to add the desired network (all data is automatically added, you just need the passphrase - plain or in hex) and hit add:

Enter passphrase and add

If you are happy and everything is working, you can add the settings to /etc/wpa_supplicant/wpa_supplicant.conf by choosing File > Save Configuration.

Using wpa-gui with network configuration

With the help of IDString and Priority you can direct to which network the box is connected at boot time. Highest priority is 1000, lowest priority is 0. You have to add the IDString to /etc/network/interfaces as well.

The syntax for /etc/network/interfaces.

First is for the connection to DHCP servers, the second is if you are provided with a fixed IP address. To adjust your settings:

# id_str="home_dhcp"
iface home_dhcp inet dhcp

# id_str="home_static"
iface home_static inet static

        address 192.168.0.20
        netmask 255.255.255.0
        network 192.168.0.0

        broadcast 192.168.0.255
        gateway 192.168.0.1
Practical Examples

If you want to be automatically connected to your home WLAN when at home, give the the IDString "home" and priority "15". If you are travelling, and want the laptop to connect to any free, non passworded network which is available. give it the IDString "stalk" and priority "1" (very low). But please, always check if your connection is legal and disconnect if it is obviously not intended to be free.

Example stanzas in /etc/network/interfaces:

# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)

# The loopback interface
# automatically added when upgrading
auto lo
iface lo inet loopback

allow-hotplug eth0
iface eth0 inet dhcp

allow-hotplug wlan0
iface wlan0 inet manual
  wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf

iface home inet dhcp
iface stalk inet dhcp

Example /etc/wpa_supplicant/wpa_supplicant.conf (SSID and passwords are changed or just explained):

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
        ssid="my_ssid"
        scan_ssid=1
        psk=123ABC  ##here comes the passphrase in hexadecimal code!!
#       psk="password_in_ascii"   ##you dont need to
        key_mgmt=WPA-PSK
        pairwise=TKIP
        group=TKIP
        auth_alg=OPEN
        priority=15
        id_str="home"
}

network={
        ssid=""
        scan_ssid=1
        key_mgmt=NONE
        auth_alg=OPEN
        priority=1
        disabled=1   ## no automatic connection, one needs wpa_cli or wpa_gui
        id_str="stalk"
}

With "disabled=1" you will not be automatically connected to a defined network block (open WLANs), you have to initiate roaming through wpa_gui or wpa_cli. For automatic roaming don't use the option at all or comment the line with the "disabled" option using a #.

WEP encryption

If you want to add WEP encrypted networks to your wpa_supplicant.conf permanently, the syntax is:

network={
	ssid="example wep network"
	key_mgmt=NONE
	wep_key0="abcde"
	wep_key1=0102030405
	wep_tx_keyidx=0
}
Notes
1. Easy to reuse

Once set up, you can easily reuse your setup on other laptops or desktops with WLAN cards. Just copy /etc/network/interfaces (adjust the name of the interface if needed) and /etc/wpa_supplicant/wpa_supplicant.conf to your new box. There is no need of "installing" anything after that.

2. Backup

It is good to backup /etc/network/interfaces and /etc/wpa_supplicant/wpa_supplicant.conf, but encrypt your backup because it contains sensitive information. An easy way is a password protected archive like 7zip, zip, rar or others.

3. Easy access of wpa_gui

To create a desktop icon, rightclick on kmenu>internet>wpa_gui and choose to send it to the desktop.

4. Hidden SSIDs

Hidden SSIDs are detected when scan_ssid=1 is defined in the network block.

5. Authentification algorithms

For WPA/WPA2 encryption you need:

auth_alg=OPEN

For static WEP encryption you might need:

auth_alg=SHARED
Content last revised 04/12/2009 1600 UTC