Log in or sign up


USER:
PASS:

 
 
Forums
BluFudge :: Forums :: Tutorials and Guides :: Linux Tutorials and Guides
 
<< Previous thread | Next thread >>
WLAN with WPA-PSK encryption on Ubuntu & Debian Linux
Moderators: SETone, Fudge, Demented
Author Post
bubulein
Tue Mar 02 2010, 07:20pm
Registered Member #114
Joined: Tue Feb 09 2010, 03:34am
Your location: Germany
Posts: 9
WLAN with WPA-PSK encryption on Ubuntu & Debian Linux

Category:

Network, Wireless

Difficulty: medium

Tested on/for:
Ubuntu 9.10 Karmic Koala
Debian GNU/Linux 5.0.x


bubulein©mail.com



How to connect to the Internet via wlan and WPA.
In this text i assume that the system has detected the correct driver for your wireless interface.
I do not describe additional commands, only the basic steps to get a quick success.

Commands start with a leading #

Step 1

Find the access point and get information about the encryption

# sudo iwlist scanning


The output should look like this:

 
 IE: IEEE 802.11i/WPA2 Version 1

                        Group Cipher : TKIP

                        Pairwise Ciphers (2) : CCMP TKIP

                        Authentication Suites (1) : PSK


This 4 lines, the name of the Access-point ( ssid) and your password give you all the information you need for a successful connection.


Step 2

Create a wpa_supplicant configuration file.

This file include all information we get with the previous command.




# sudo nano /etc/wpa_supplicant/wpa_supplicant.conf



network={
    ssid="your_ssid_here"

    scan_ssid=1

    key_mgmt=WPA-PSK

    psk="yourpass_here"

    proto=WPA

    pairwise=TKIP

    group=TKIP
}


The "ssid" is set in the configuration of your router.


pairwise and group depend on the output of


# sudo iwlist scanning


perhaps u have to change this two lines to


pairwise=CCMP

group=TKIP


or


pairwise=CCMP

group=CCMP


Safe your file with Ctrl + X ENTER

Step 3

Testing the configuration


# sudo wpa_supplicant -i wlan0 -D wext -c /etc/wpa_supplicant/wpa_supplicant.conf -d


where
-i = interface
-D = driver
-c = configuration file
-d = simple debugging (increase debugging level with -dd )

Now run


# iwconfig 


to see if everything works:

You can cancel with ctrl+C

If u replace -d with -B the connection should be established and run in background mode.


# sudo dhclient wlan0


Connects you to your dhcp server and give you and ip.

Note:
Enter your nameserver to /etc/resolv.conf

nameserver 192.168.1.1 


( normally DHCP should do that for you)

Step 4

Activating wpa_supplicant

modify your interface configuration with


# sudo nano /etc/network/interfaces


Your file should look like that


# This file describes the network interfaces available on your system

# and how to activate them. For more information, see interfaces(5).

# The loopback network interface

auto lo

iface lo inet loopback

# The primary network interface

auto wlan0

iface wlan0 inet dhcp

        wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf


For a static IP replace dhcp with your ip. ( not tested)

In some cases u have to add the driver to this file.
insert

wpa-driver wext


after iface wlan0 inet dhcp.

Her is a short list of the drivers:


hostap        Host AP driver (Intersil Prism2/2.5/3)

madwifi        MADWIFI 802.11 support (Atheros, etc.)

atmel        ATMEL AT76C5XXx (USB, PCMCIA)

wext        Linux wireless extensions (generic), 

        standard driver if the other drivers do not work.

ndiswrapper    Linux ndiswrapper

wired        wired Ethernet driver


Step 5

Starting the connection and adding an entry for auto connect on boot.
To connect use, or add this two lines without # to /etc/rc.local .

# ifdown wlan0

# ifup wlan0 



Bye bubulein©mail.com

If u have question feel free to send me an email or ask at
irc://bludufge.net/#holodeck
irc://bubulein@chat.freenode.net





[ Edited Thu Mar 04 2010, 05:42pm ]
Back to top
Fudge
Fri Mar 05 2010, 06:06pm

Registered Member #2
Joined: Sat Feb 24 2007, 07:13pm
Your location: Launceston, Australia
Posts: 4
this will be very useful, thankyou
Back to top
 

Jump:     Back to top

Syndicate this thread: rss 0.92 Syndicate this thread: rss 2.0 Syndicate this thread: RDF
Powered by e107 Forum System