Ubuntu: wireless network with wpa encryption

Ubuntu: wireless network with wpa encryption

Ubuntu: wireless network with wpa encryption 150 150 Roderick Derks

Before I got the great tip described above I used the following method. This one is less handy if you're roaming around with your laptop from access point to access point:

1) Open a terminal window and type:
Code:

# wpa_passphrase your_ssid your_psk

Note: your_ssid is the name of your wireless network (a.k.a. SSID) and your_psk is the password you want to use to protect your network. (Look below for an example).

2) Now copy the psk string you got as output.

3) Type:
Code:

# sudo gedit /etc/wpa_supplicant.conf

Then paste this as follow:
Code:

ctrl_interface=/var/run/wpa_supplicant
#ap_scan=2

network={
       ssid="your_ssid"
       scan_ssid=1
       proto=WPA RSN
       key_mgmt=WPA-PSK
       pairwise=CCMP TKIP
       group=CCMP TKIP
       psk=your_psk
}

Note: your_psk is the psk string you got from step 1.

Here is an example:
Code:

luca@laptop1:~$ wpa_passphrase mywlan thisisthepassword
network={
        ssid="mywlan"
        #psk="thisisthepassword"
        psk=b22ec921c254c73f99b31b76ff876692ecde36839a1f2d92150829e6afcb5515
}

The red string is what you have to paste into /etc/wpa_supplicant.conf as your_psk (without quotes obviously). So you'll have something like this:
Code:

ctrl_interface=/var/run/wpa_supplicant
#ap_scan=2

network={
       ssid="mywlan"
       scan_ssid=1
       proto=WPA RSN
       key_mgmt=WPA-PSK
       pairwise=CCMP TKIP
       group=CCMP TKIP
       psk=b22ec921c254c73f99b31b76ff876692ecde36839a1f2d92150829e6afcb5515
}

4) Save the file and close Gedit.

5) Now we have to make wpa_supplicant load when system boots, so go back to the terminal window and type:
Code:

# sudo gedit /etc/network/interface

6) Add the following lines in the part regarding your wireless card, as in the example below:
Code:

pre-up wpa_supplicant -Bw -Dwext -ieth0 -c/etc/wpa_supplicant.conf
post-down killall -q wpa_supplicant

Note: "eth0" is your wireless device and "wext" is the driver; this is a kind of generic driver, so it should work with most wireless cards. If it doesn't, please try another driver, such as hostap, ndiswrapper, etc.
Here is an example:
Code:

iface eth0 inet static
address 192.168.1.15
netmask 255.255.255.0
wireless-essid my_essid
gateway 192.168.1.1
pre-up wpa_supplicant -Bw -Dwext -ieth0 -c/etc/wpa_supplicant.conf
post-down killall -q wpa_supplicant

7) Now run wpa_supplicant:
Code:

sudo wpa_supplicant -Bw -Dwext -i eth0 -c/etc/wpa_supplicant.conf

You should be online!

Many thanks to the Ubuntuforum

Fedora7 stuff:
http://forums.fedoraforum.org/showthread.php?t=156435&page=2&pp=15
http://forums.fedoraforum.org/showthread.php?t=161881

Roderick Derks

Liefhebber van fietsen, van het oplossen van IT puzzels, en van het delen van informatie om anderen te helpen.

All stories by:Roderick Derks

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

    Your Name (required)

    Your Email (required)

    Subject

    Your Message

      Your Name (required)

      Your Email (required)

      Subject

      Your Message