You are on page 1of 8

9/28/13

WiFi/HowToUse - Debian Wiki

Translations: English - French - Italiano - -

How to use a WiFi interface


This page describes how to configure a WiFi interface on a Debian system, for use on a network.
Contents
1. How to use a WiFi interface 1. NetworkManager 1. GNOME 2. KDE 2. Wicd 3. Command Line 4. wpa_supplicant 1. WPA-PSK and WPA2-PSK 2. WPA-EAP 5. Switching Connections 6. Security consideration 7. See Also

Once your wireless device has an interface available (verifiable with DebianMan: iwconfig), it is required to be configured to access a network. If you do not have a wireless interface present, please refer to WiFi for information on providing a driver for your device. Wireless network interface configuration can be performed using a connection manager (such as NetworkManager) or through Debian's / e t c / n e t w o r k / i n t e r f a c e sfile with a special purpose utility (such as wpa_supplicant). Examples of NetworkManager and wpa_supplicant configuration are described below. The WikiPedia: WEP algorithm is insecure and deprecated by WPA. Use of WEP is not recommended and is not covered within this document.

NetworkManager
NetworkManager is configured through graphical interfaces, which are
https://wiki.debian.org/WiFi/HowToUse 1/8

9/28/13

WiFi/HowToUse - Debian Wiki

available for GNOME and KDE. Your wireless interface should not be referenced within Debian's / e t c / n e t w o r k / i n t e r f a c e sfile. NetworkManager is also a front-end for wpa_supplicant.

GNOME
1. Ensure your user account is a member of the n e t d e vgroup. 2. Install the DebianPkg: network-manager-gnome package:

$s u #a p t g e tu p d a t e #a p t g e ti n s t a l ln e t w o r k m a n a g e r g n o m e

3. Log out of GNOME, then log back in to your system. 4. A new applet (computer icon) will appear in the notification area / system tray. Left-click this icon to present the nm-applet pop-up menu. 5. Neighboring wireless networks with a broadcasted SSID should be listed: Click on the desired network's name. If the network uses WPA encryption with a password (aka passphrase/pre-shared key), you will be prompted to enter it. After providing, click the "Connect" button. The wireless network connection will be activated. If the desired network is not listed (e.g. SSID not broadcast/hidden): Click "Connect to Other Wireless Network...". Enter the network's SSID at "Network Name". If encryption is used, select the method from the "Wireless Security" drop-down list (usually "WPA Personal" or "WPA2 Personal"). Enter the passphrase/pre-shared key at "Password". Click the "Connect" button to activate the wireless network connection. See the NetworkManager page for frequently asked questions, documentation and support references.

KDE
1. Ensure your user account is a member of the n e t d e vgroup. 2. Install the DebianPkg: network-manager-kde package:
https://wiki.debian.org/WiFi/HowToUse 2/8

9/28/13

WiFi/HowToUse - Debian Wiki

$s u #a p t i t u d eu p d a t e #a p t i t u d ei n s t a l ln e t w o r k m a n a g e r k d e

3. From the K Menu, select "Run Command". Enter "knetworkmanager" and click "Run". 4. A new applet (wallplug/socket icon) will appear in the system tray. Rightclick this icon to present the KNetworkManager pop-up menu. 5. Neighboring wireless networks with a broadcasted SSID should be listed: Click on the desired network's name. If the network uses WPA encryption with a password (aka passphrase/pre-shared key), you will be prompted to enter it. After providing, click the "Connect" button. The wireless network connection will be activated. If the desired network is not listed (e.g. SSID not broadcast/hidden): Click "Connect to Other Wireless Network...". Enter the network's name in "Name (ESSID)". Tick "Use Encryption" if in use on the network. Select the encryption method used (usually "WPA Personal"). Enter the passphrase/pre-shared key at "Password". Select "WPA 1" or "WPA 2" for the protocol version, as used by the network. Click the "Connect" button to activate the wireless network connection. See the NetworkManager page for frequently asked questions, documentation and support references.

Wicd
WikiPedia: wicd (Wireless Interface Connection Daemon) is a lightweight alternative to NetworkManager. It is environment-independent, making it suitable for all desktop environments, including GNOME, Xfce, LXDE, and Fluxbox. Like NetworkManager, wicd is configured via a graphical interface. Your wireless interface should not be referenced within Debian's / e t c / n e t w o r k / i n t e r f a c e sfile. 1. Update the list of available packages and install the DebianPkg: wicd package:
https://wiki.debian.org/WiFi/HowToUse 3/8

9/28/13

WiFi/HowToUse - Debian Wiki

$s u #a p t i t u d eu p d a t e #a p t i t u d ei n s t a l lw i c d

2. Amend / e t c / n e t w o r k / i n t e r f a c e sto contain only the following:

#T h i sf i l ed e s c r i b e st h en e t w o r ki n t e r f a c e sa v a i l a b l eo ny o u rs y s t e m #a n dh o wt oa c t i v a t et h e m .F o rm o r ei n f o r m a t i o n ,s e e i n t e r f a c e s ( 5 ) .

#T h el o o p b a c kn e t w o r ki n t e r f a c e a u t ol o i f a c el oi n e tl o o p b a c k

Note: as of wheezy it is fine to have your wireless interface in /etc/network/interfaces (it might even be required, not sure) 3. If not already performed, add your regular user account to the n e t d e v group and reload DBus:

#a d d u s e ry o u r u s e r n a m en e t d e v #/ e t c / i n i t . d / d b u sr e l o a d

4. Start the wicd daemon:

#/ e t c / i n i t . d / w i c ds t a r t

5. Start the wicd GUI with your regular user account:

#e x i t $w i c d c l i e n tn

See also
https://wiki.debian.org/WiFi/HowToUse

wicd frequently asked questions.


4/8

9/28/13

WiFi/HowToUse - Debian Wiki

Command Line
Scan for available networks and get network details:

$s u #i w l i s ts c a n

Now edit / e t c / n e t w o r k / i n t e r f a c e s . The required configuration is much dependent on your particular setup. See the following example to get an idea of how it works:

#m yw i f id e v i c e a u t ow l a n 0 i f a c ew l a n 0i n e td h c p w i r e l e s s e s s i d[ E S S I D ] w i r e l e s s m o d e[ M O D E ]

For further information on available configuration options, see m a ni n t e r f a c e s ,m a nw i r e l e s sand / u s r / s h a r e / d o c / w i r e l e s s t o o l s / R E A D M E . D e b i a n . You can now bring your interface up and down with the usual i f u pand i f d o w ncommands. If you added a u t ow l a n 0as in the example above, the interface should be brought up automatically during boot up.

wpa_supplicant
wpa_supplicant is a WPA client and IEEE 802.1X WikiPedia: supplicant. The DebianPkg: wpasupplicant package provides w p a * DebianMan: ifupdown options for / e t c / n e t w o r k / i n t e r f a c e s . If these options are specified, wpa_supplicant is started in the background when your wireless interface is raised and stopped when brought down. GNOME and KDE users shouldn't configure wpa_supplicant manually. Use NetworkManager as explained above. Before continuing, install the DebianPkg: wpasupplicant package:
https://wiki.debian.org/WiFi/HowToUse 5/8

9/28/13

WiFi/HowToUse - Debian Wiki

$s u #a p t i t u d eu p d a t e #a p t i t u d ei n s t a l lw p a s u p p l i c a n t

WPA-PSK and WPA2-PSK


Also known as "WPA Personal" and "WPA2 Personal" respectively. 1. Restrict the permissions of / e t c / n e t w o r k / i n t e r f a c e s , to prevent pre-shared key (PSK) disclosure:

#c h m o d0 6 0 0/ e t c / n e t w o r k / i n t e r f a c e s

2. Open / e t c / n e t w o r k / i n t e r f a c e sin a text editor:

#s e n s i b l e e d i t o r/ e t c / n e t w o r k / i n t e r f a c e s

3. Define appropriate stanzas for your wireless interface, along with the SSID and PSK. For example:

a u t ow l a n 0 i f a c ew l a n 0i n e td h c p w p a s s i dm y n e t w o r k n a m e w p a p s km y s e c r e t p a s s p h r a s e

The "auto" stanza will bring your interface up at system startup. If not desired, remove or comment this line. 4. Save the file and exit the editor. 5. Bring your interface up. This will start wpa_supplicant as a background process.

#i f u pw l a n 0

https://wiki.debian.org/WiFi/HowToUse

6/8

9/28/13

WiFi/HowToUse - Debian Wiki

Additional w p a *options are described within / u s r / s h a r e / d o c / w p a s u p p l i c a n t / R E A D M E . m o d e s . g z . This should also be read if connecting to a network not broadcasting its SSID. For general / e t c / n e t w o r k / i n t e r f a c e sinformation, see the DebianMan: interfaces(5) man page.

WPA-EAP
For networks using WikiPedia: EAP-TLS, you are required to establish a wpa_supplicant configuration file and provide the client-side certificate. An example WPA2-EAP configuration file can be found at /usr/share/doc/wpasupplicant/examples/wpa2-eap-ccmp.conf. Once available, reference your configuration file in / e t c / n e t w o r k / i n t e r f a c e s . For example:

a u t ow l a n 0 i f a c ew l a n 0i n e td h c p w p a c o n f/ e t c / w p a _ s u p p l i c a n t / w p a _ s u p p l i c a n t . c o n f

More information can be found in the DebianMan: wpa_supplicant.conf(5) man page. A fully-commented wpa_supplicant configuration file example is at / u s r / s h a r e / d o c / w p a s u p p l i c a n t / R E A D M E . w p a _ s u p p l i c a n t . c o n f . g z .

Switching Connections
To switch between multiple distinct configurations: GNOME users should use "Menu System > Administration > Network". (n.b. this doesn't work in etch) Console users can use logical interfaces, as

i f a c ew l a n _ h o m ei n e td h c p w p a s s i dm y n e t w o r k n a m e w p a p s km y s e c r e t p a s s p h r a s e

https://wiki.debian.org/WiFi/HowToUse

7/8

9/28/13

WiFi/HowToUse - Debian Wiki

#i f u pw l a n 0 = w l a n _ h o m e

use DebianPkg: ifscheme, see the alwayssunny.com.

example configuration at

You can use DebianMan: guessnet(8) to switch profiles automatically by your location.

Security consideration
1. Every member of a network can listen to other members' traffic (whether it's an unencrypted public hot-spot, or a WEP/WPA/WPA2, or LAN). Use SSL/TLS protocols (HTTPS, IMAPS...) or VPN to preserve your privacy. 2. WEP is so insecure that it is basically equivalent to not using any encryption at all. 3. WPA1 is deprecated. Use WPA2 instead. 4. Make sure you use a strong pass-phrase. Network security, see: http://www.aircrack-ng.org/doku.php?id=tutorial.

See Also
WiFi/AdHoc - Establishing a WiFi network without an access point. DebianMan: iwconfig(8) NetworkConfiguration NetworkManager WiFi WPA

CategoryNetwork | CategoryWireless

https://wiki.debian.org/WiFi/HowToUse

8/8

You might also like