Difference between revisions of "User:Earnest/wpa supplicant"

From ArchWiki
Jump to: navigation, search
(Maintaining a custom configuration)
(Maintaining a custom configuration)
Line 41: Line 41:
  
 
Next add a {{ic|ctrl_interface}} so that we may control the {{ic|wpa_supplicant}} daemon. We can allow {{ic|wpa_cli}} to edit this configuration by setting {{ic|update_config=1}}. We will also allow {{ic|wpa_supplicant}} to initiate AP (Access Point) scanning and selection with {{ic|ap_scan=1}}.
 
Next add a {{ic|ctrl_interface}} so that we may control the {{ic|wpa_supplicant}} daemon. We can allow {{ic|wpa_cli}} to edit this configuration by setting {{ic|update_config=1}}. We will also allow {{ic|wpa_supplicant}} to initiate AP (Access Point) scanning and selection with {{ic|ap_scan=1}}.
{{hc|/etc/wpa_supplicant/foobar.conf|8=  
+
{{hc|2=/etc/wpa_supplicant/foobar.conf|2=  
 
   ctrl_interface=DIR=/run/wpa_supplicant GROUP=wheel # allow control for members in the 'wheel' group
 
   ctrl_interface=DIR=/run/wpa_supplicant GROUP=wheel # allow control for members in the 'wheel' group
 
   update_config=1
 
   update_config=1

Revision as of 19:07, 13 May 2013

wpa_supplicant is a cross-platform WPA Supplicant with support for WPA and WPA2 (IEEE 802.11i / RSN (Robust Secure Network)). It is suitable for both desktop/laptop computers and embedded systems. wpa_supplicant is the IEEE 802.1X/WPA component that is used in the client stations. It implements key negotiation with a WPA Authenticator and it controls the roaming and IEEE 802.11 authentication/association of the wlan driver.

Installation

Install wpa_supplicant from the official repositories.

Optionally wpa_supplicant_gui can be installed which provides wpa_gui; a graphical frontend for wpa_supplicant using the qt4 toolkit.

Configuration

wpa_supplicant provides a reference configuration file located at /etc/wpa_supplicant/wpa_supplicant.conf which contains detailed documentation for the all available options and their utilisation.

In it's simplest form all the configuration file requires is a network block, for example:

/etc/wpa_supplicant/foobar.conf
network={
    ssid="..."
  }

This can easily be generated using the wpa_passphrase tool. For example:

$ wpa_passphrase foobarssid foobarspassword
network={
   ssid="foobarssid"
   #psk="foobarspassword"
   psk=f5d1c49e15e679bebe385c37648d4141bc5c9297796a8a185d7bc5ac62f954e3
}

Now both wpa_supplicant and wpa_passphrase can be combined to associate with almost all WPA2 (Personal) networks:

# wpa_supplicant -B -i [interface] -c <(wpa_passphrase [essid] [passphrase])

All that remains is to simply connect using a static IP or DHCP. For example:

# dhcpcd -A [interface]

Maintaining a custom configuration

Note: Be advised that the recommended method of connection is using Netctl and is certainly a better solution in the long term.

As discussed above we can make use of wpa_passphrase to generate a basic configuration which we can augment with additional networks and options of our choosing. This may be necessary for more advanced networks employing extensive use of EAP

Firstly we will use wpa_passphrase to create our basic configuration file.

# wpa_passphrase foobarssid foobarspassword > /etc/wpa_supplicant/foobar.conf
Next add a ctrl_interface so that we may control the wpa_supplicant daemon. We can allow wpa_cli to edit this configuration by setting
Template error: are you trying to use the = sign? Visit Help:Template#Escape template-breaking characters for workarounds.
. We will also allow wpa_supplicant to initiate AP (Access Point) scanning and selection with
Template error: are you trying to use the = sign? Visit Help:Template#Escape template-breaking characters for workarounds.
.
Template error: are you trying to use the = sign? Visit Help:Template#Escape template-breaking characters for workarounds.
ctrl_interface=DIR=/run/wpa_supplicant GROUP=wheel # allow control for members in the 'wheel' group
  update_config=1
  ap_scan=1
  network={
     ssid="foobarssid"
     psk=f5d1c49e15e679bebe385c37648d4141bc5c9297796a8a185d7bc5ac62f954e3
  }

Multiple network blocks may be appended to this configuration.

Also See

TODO

  • Add more practical examples? (wpa_supplicant.conf already lists many.)