LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Blogs > neonsignal
User Name
Password

Notices

Rate this Entry

manually setting up WPA for wireless interfaces

Posted 05-06-2011 at 06:26 AM by neonsignal
Updated 05-06-2011 at 06:31 AM by neonsignal

Since the default wireless interface is typically wlan0, it can be useful to edit /etc/udev/rules.d/70-persistent-net.rules to set the interface name.

The wireless supplicant daemon is also required:
Code:
apt-get install wpasupplicant
The wpasupplicant entries are stored in /etc/wpa_supplicant/wpa_supplicant.conf. Entries can be added manually, or using:
Code:
wpa_passphrase ssid key >>/etc/wpa_supplicant/wpa_supplicant.conf
In the /etc/network/interfaces, a typical entry would be:
Code:
auto wlan0
iface wlan0 inet dhcp
   wpa-driver wext
   wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
Earlier, my particular wireless card needed at least a 2.6.30 kernel, and required the non-free wireless firmware to be in /lib/firmware. More recent versions of debian have the firmware blob.

The current firmware blob still has some reliability issues. The WPA supplicant only works every second time; a hack to fix this is to add a pre-up to /etc/network/interfaces:
Code:
   pre-up /sbin/wpa_supplicant -B -iwlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf
   pre-up sleep 1
   pre-up killall wpa_supplicant
I've also noticed that on at least one network without any security, I had to turn off wpa_supplicant altogether to get it connecting (ie, a no encryption entry in the wpa_supplicant.conf file did not work).

The interface is brought up in the usual way:
Code:
ifup wlan0
A network scan can be done (though the interface needs to be up for this to work):
Code:
iwlist wlan0 scan
Posted in Uncategorized
Views 430 Comments 0
« Prev     Main     Next »
Total Comments 0

Comments

 

  



All times are GMT -5. The time now is 11:12 AM.

Main Menu
Advertisement

My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration