Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

HowTo: WPA with wpa_supplicant

Here was my first HowTo about this topic. It made a success, but now it's a bit out-to-date, as it was written for Hoary. This stuff has started getting easier to configure since Breezy and now it's really very easy to have it work. This HowTo will help you get WPA to work, no matter what wireless card you have. (This HowTo has been tested with an ipw2200). So, let's start: 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/interfaces


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!

A. Mengakses WEP Wireless Network 1. Periksa wireless adapter:

$ iwconfig

Anda akan melihat wireless adapter sebagai wlan0 atau ath0 tergantung driver wireless card yang digunakan. 2. Jalankan perintah berikut untuk memasang ESSID, network key, channel, dan mode:

1 2 3 4

$ $ $ $

sudo sudo sudo sudo

iwconfig iwconfig iwconfig iwconfig

wlan0 wlan0 wlan0 wlan0

essid yantoknuk-singtel channel 6 key ngumbahkucing mode managed

3. Setelah itu aktifkan interface wireless:

$ sudo ip link set wlan0 up

4. Gunakan DHCP untuk mendapatkan alamat IP dari akses poin:

$ sudo dhclient wlan0

5. Periksa apakah WiFi interface sudah terhubung ke akses poin:

1 2 3 4 5 6 7 8 9

$ ifconfig wlan0 Link encap:Ethernet HWaddr 00:16:cf:33:54:9b inet addr:192.168.1.50 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: fe80::216:cfff:fe33:549b/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:9188 errors:0 dropped:0 overruns:0 frame:0 TX packets:2504 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:2423370 (2.4 MB) TX bytes:1265327 (1.2 MB)

6. Selesai.

B. Mengakses WPA Wireless Network 1. Install paket wpa supplicant:

$ sudo apt-get install wpasupplicant

2. Konfigurasikan network ESSID dan passphrase. Pada contoh berikut saya menggunakan ESSID yantoknuksingtel dan passphrase ngumbahkucing.

1 2

$ wpa_passphrase yantoknuk-singtel # reading passphrase from stdin

Setelah itu, ketikkan passphrase / password tepat setelah kalimat # reading passphrase from stdin dan tekan tombol Enter.

1 2 3 4 5 6 7

# reading passphrase from stdin ngumbahkucing network={ ssid="yantoknuk-singtel" #psk="ngumbahkucing" psk=1e6eb493adf24740e2d3e98759b8b985e69f0bb939931c19400ceeecb61788e1 }

3. Edit atau buat file /etc/wpa_supplicant.conf:

$ sudo nano /etc/wpa_supplicant

Ketikkan baris berikut yang dihasilkan oleh wpa_passphrase sebelumnya:

1 2 3 4 5

network={ ssid="yantoknuk-singtel" #psk="ngumbahkucing" psk=1e6eb493adf24740e2d3e98759b8b985e69f0bb939931c19400ceeecb61788e1 }

4. Save dan keluar dari nano. Untuk melakukan tes jalankan perintah berikut:

$ sudo wpa_supplicant -iwlan0 -c/etc/wpa_supplicant.conf -Dwext

Jika perintah di atas sukses, akan tampil keluaran:

1 2 3

Trying to associate with 00:ff:00:1e:a7:7d (SSID='yantoknuk-singtel' freq=0 MHz) Associated with 00:ff:00:1e:a7:7d WPA: Key negotiation completed with 00:ff:00:1e:a7:7d [PTK=TKIP GTK=TKIP]

5. Selesai. Komputer Anda sekarang sudah terhubung ke akses poin. Untuk membuat aktif pada setiap boot, edit file /etc/network/interfaces:

$ sudo nano /etc/network/interfaces

dan tambahkan baris berikut:

1 2 3 4

auto wlan0 iface wlan0 inet dhcp wpa-driver wext wpa-conf /etc/wpa_supplicant.conf

Instalasi dan testing NVIDIA Optimus di Ubuntu 12.10, ASUS A42J GeForce 310M with CUDA Untuk menginstall Driver NVidia, yang perlu kita lakukan adalah : 1. Instalasi Linux Header 2. Instalasi Bumblebee serta driver Nvidia Langkah-langkah detilnya sebagai berikut : 1. Masuk kedalam mode teks dengan menekan ctrl + alt + f1 f6 (saya menggunakan ctrl+alt+f1) 2. Setelah masuk kedalam mode teks, login secara biasa menggunakan username dan password ketika awal menginstall ubuntu. 3. Setelah login, mulai dengan menginstall linux header. (Jika telah melakukan update maka kernel linux header akan berubah dari ketika pertama kali install Ubuntu. sudo apt-get install linux-header-generic atau sudo apt-get install linux-headers-$(uname -r) 4. setelah itu kita menginstall bumblebee. bumblebee adalah aplikasi yang digunakan untuk menjalankan Nvidia GPU dikarenakan sementara ini belum ada release resmi dari NVidia untuk melakukan switching secara otomatis pada Nvidia Optimus untuk linux. sudo add-apt-repository ppa:bumblebee/stable sudo apt-get update sudo apt-get upgrade sudo apt-get install bbswitch-dkms bumblebee-nvidia ketika melakukan instalasi bumblebee, akan otomatis menginstall driver nvidia-current yaitu driver Nvidia terbaru saat ini yang merupakan dependensi dari bumblebee itu sendiri. Jika partisi home kita di enkripsi, maka kemungkinan instalasi akan mentok (hang) pada proses initramfs. Hal ini bisa disolusikan dengan mematikan / mendisable FRAMEBUFFER=y pada usr/share/initramfs-tools/conf-hooks.d/cryptsetup berikut adalah petikan dari konfigurasi cryptsetup # This will setup non-us keyboards in early userspace, # necessary for punching in passphrases. KEYMAP=y # force busybox on initramfs BUSYBOX=y

# and for systems using plymouth instead, use the new option # FRAMEBUFFER=y # DISABLED untuk menginstal nvidia drivers setelah selesai, restart Ubuntu dengan mengetik perintah sudo shutdown -r now Pada tahap ini, Ubuntu kita sudah terinstall dengan Nvidia Driver dan Bumblebee untuk proses switchingnya. Selanjutnya adalah melakukan pengecekan apakah instalasi berhasil dan Nvidia dapat digunakan untuk aplikasi yang menggunakan resource tinggi. Tahapannya adalah sebagai berikut : 1. Login seperti biasa ke sistem 2. Masuk ke terminal 3. Setelah tahapan instalasi bumblebee sebelumnya sukses, maka didalam terminal akan muncul perintah optirun. Optirun ini adalah perintah untuk menjalanakan aplikasi yang membutuhkan grafis Nvidia selain grafis default yang dipergunakan sehari-hari yaitu Intel. optirun glxspheres // menjalankan aplikasi glxspheres menggunakan GPU kedua (Nvidia)

Sudah dilakukan tes pada laptop ASUS A42J, Nvidia Optimus (Intel dan NVIDIA GeForce 310M with CUDA 1Gb) Ram 4Gb, Ubuntu 12.10 32bit Selamat mencoba..

You might also like