Ubunut wireless configuration commands


This short article helped me connect my 12.04 LTS server to my WPA2 PSK network: prupert @ WordPress . I run the server without desktop, so it demanded all cmd line.

I am paraphrasing a quick breakdown of the steps, but please click on the link for the full article:

(You Need to be connected to the network at this point)

Install The Software:

(You only need WPASupplicant if it is not an open network) sudo apt-get install wireless-tools wpasupplicant

Activate your wireless network:

sudo ifconfig wlan0 up

To Check The Wireless Run:



sudo iwlist scan

(The sacn command should return visible wireless networks, but if it does not it is a sign that there are none visible or something is wrong with your HW/SW outside the scope of the linked article)

Run: (To recieve you WiFi Key)


A Sample of The Resulting Text: (As Provided by the Linked Article)

psk=fe727aa8b64ac9b3f54c72432da14faed933ea511ecab1 5bbc6c52e7522f709a

Copy the “psk" somewhere accessible, this is going to allow you to connect to your network.

Edit your interfaces file:

sudo nano /etc/network/interfaces

Append your WiFi network to the end of this file using the folling options and syntax:

auto wlan0     #change this to the name of your WiFi interface
iface wlan0 inet dhcp     #this is normally fine, if you want a static IP address replace “dhcp” with “static”
netmask     #change this as appropriate for your network, this value is usually right
gateway     #change this as appropriate for your network
address     #only needed for a static IP address
dns-nameservers     #only needed for a static IP address
wpa-driver wext     #you shouldn’t need to change this
wpa-ssid YOURSSID     #just type the name of your SSID here
wpa-ap-scan 1     #if the name of your SSID is hidden usually, type 2 instead of 1
wpa-proto WPA    #if you use WPA1 type WPA, if you use WPA2 type RSN
wpa-pairwise CCMP     #if you use AES type CCMP, if you use TKIP type TKIP
wpa-group CCMP     #if you use AES type CCMP, if you use TKIP type TKIP
wpa-key-mgmt WPA-PSK     #usually WPA-PSK (if you share a key) but sometimes WPA-EAP (for enterprises)
wpa-psk YOURHEXKEYFROMABOVE     #the hex key that you generated earlier

Example from Author of the linked article:

auto wlan0
iface wlan0 inet dhcp
wpa-driver wext
wpa-ssid MYPLACE
wpa-ap-scan 1
wpa-proto WPA
wpa-pairwise CCMP
wpa-group CCMP
wpa-key-mgmt WPA-PSK
wpa-psk 71c81a844973ae7bb1243141e5caa7b6bb0e2d7eetcetcetc

You may now comment out the top of the Interfaces file, which will disable the ethernet. The author of the article reccommends this to prevent conflicts, but I decided not to as the only way that I can access my server interface is via PuTTY SSH, so I want to have a method of connection if the wireless is down, where I don’t need to break out a mouse and monitor: (Remove the “#" later if you need the ethernet connections to work again)

#auto eth0
#iface eth0 inet dhcp

Write Out the file and Save your Changes Reboot your Machine

If this doesn’t work, you may need to edit the Config file for the WPASupplicant program:

sudo nano /etc/wpa_supplicant.conf

You edit this file with much of the same information, except the wpa- piece: (A sample below from the author of the linked document)


“As far as I am aware, the options are the same. So, edit this file as necessary, make sure you add the ctrl_interface and network={ at the beginning and the } part at the end. Save it and try restarting again. If it still doesn’t work, then kick your PC, wish you had installed Windows 7 instead and go off and do some Googling. You’ll find the answer on the Ubuntu forums and you’ll be happy again.

Best of luck!" – prupert

本篇發表於 Linux。將永久鏈結加入書籤。



WordPress.com Logo

您的留言將使用 WordPress.com 帳號。 登出 / 變更 )

Twitter picture

您的留言將使用 Twitter 帳號。 登出 / 變更 )


您的留言將使用 Facebook 帳號。 登出 / 變更 )

Google+ photo

您的留言將使用 Google+ 帳號。 登出 / 變更 )

連結到 %s