This site is now 100% read-only, and retired.

Managing Laptop Network Connections with KWLAN

Posted by mpapet on Fri 12 Jan 2007 at 14:29

KWLAN is a very handy network connections manager for the KDE desktop. The main features are auto-detection of multiple interfaces, ability to use wpa_supplicant wireless security, and scripts that run for each connection profile created.

I first built it from source on Suse 9.3 and it worked great. I was pleased to see it included in the Etch repositories. The only configuration required is a sudo entry and an optional wpa_supplicant entry.

Installation is easy:

apt-get install kwlan

But don't start kwlan yet.

Configuring sudo

In Etch, sudo editing is still called as root with visudo, the default editor is nano, which IMHO is a little easier for the vi uninitiated. Be extra careful editing the sudoers file. Do not delete the root entry, just add the following entry below it.

USERNAME HOSTNAME=NOPASSWD: /sbin/wpa-supplicant /sbin/dhclient /sbin/iwconfig

That command is loosely decoded as :

  • USERNAME which is the username allowed to run the commands
  • HOSTNAME is the hostname the commands are allowed to run under. I use all because some of my network connections require DHCP to rewrite the hostname. Note the option of NOPASSWD. This basically allows execution of the command by the user, without the users password needed. For some, this will be lax security, for others, it's a convience.
  • APPLICATION the full path of the executable. Multiple executables can be put on a single line. In this case I put wpa_supplicant, dhclient, and iwconfig

Configuring WPA Supplicant

You need to create a wpa_supplicant.conf file. I put mine in the directory /etc/wpa_supplicant. It needs to look like the following:

# ap_scan=2 was the one for me you may try 0 or 1 indstead of 2


This wpa_supplicant.conf file should be pretty self-explanatory.

Now you can start kwlan and configure multiple network connections easily.



Re: Correction
Posted by suspended user mpapet (69.3.xx.xx) on Sat 13 Jan 2007 at 06:21
I hosed the visudo section. It should look like
USERNAME ALL NOPASSWD: /sbin/iwconfig, /sbin/dhclient, /sbin/wpa_supplicant

Check your work in your user account with sudo -l. It should list the commands you are allowed to run.

[ Parent ]

Re: Correction
Posted by Anonymous (213.60.xx.xx) on Mon 4 Jun 2007 at 21:10
That sudo line does'nt work for me. It complains that there are errors. This line worked for visudo:
USERNAME ALL=(ALL) NOPASSWD:/sbin/iwconfig,/sbin/dhclient,/sbin/wpa_supplicant

but kwlan didn't worked with it. It says wpa_supplicant couldn't be started.
The only way I found kwlan worked fine was with an 'ALL' in the commands section of the sudo line.

Anyone knows something about this? Why that fails? How make kwlan work restricting the executables?

[ Parent ]

Re: Managing Laptop Network Connections with KWLAN
Posted by Anonymous (155.207.xx.xx) on Sun 4 Jan 2009 at 20:58
You should add the option to use wep instead of wpa when wpa_supplicant starts because some older hardware doesn't support wpa at all.

[ Parent ]