Welcome to the most active Linux Forum on the web.
Go Back > Blogs > neonsignal
User Name


Rate this Entry

manually setting up WPA for wireless interfaces

Posted 05-06-2011 at 05:26 AM by neonsignal
Updated 05-06-2011 at 05: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:
apt-get install wpasupplicant
The wpasupplicant entries are stored in /etc/wpa_supplicant/wpa_supplicant.conf. Entries can be added manually, or using:
wpa_passphrase ssid key >>/etc/wpa_supplicant/wpa_supplicant.conf
In the /etc/network/interfaces, a typical entry would be:
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:
   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:
ifup wlan0
A network scan can be done (though the interface needs to be up for this to work):
iwlist wlan0 scan
Posted in Uncategorized
Views 612 Comments 0
« Prev     Main     Next »
Total Comments 0




All times are GMT -5. The time now is 02:43 PM.

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