22 Jul 2011 mones   » (Journeyer)

apt-get remove --purge network-manager

Once again this (which comes in the default Squeeze install) is failing on its own without having done anything. After some time logged the network goes down and there's no way to make it authenticate again: keeps asking for the password forever, despite is already correctly typed.

Anyway I never liked to depend on an applet in the graphical desktop for gaining network access. Some times I like doing things on the console specially when no bells'n'whistles are required to get them done. This also saves some battery as there are less processes running, and, probably, less pixels emitting light :-)

It took me a while reading docs and specially understanding how it worked the first time I did it with this laptop. Currently it has become much easier, as there's less options to configure, or so it seems. First create the /etc/wpa_supplicant/home.conf file with the network definition:

ctrl_interface=/var/run/wpa_supplicant
network={
   ssid="myssid"
   scan_ssid=1
   key_mgmt=WPA-PSK
   psk=2b883bdc473647e13258488c59d2cf9e4994f04078fbeb827049416fcb518703
}


The obfuscated password is obtained with wpa_passphrase utility. Otherwise you can simply put your password between double quotes in clear text if you don't care (psk="yourpassword").

Once this is ready lets add the interface to /etc/network/interfaces with the commands to run before initializing and after shutting down:

auto wlan0
iface wlan0 inet dhcp
	pre-up /sbin/wpa_supplicant -iwlan0 -B -Dwext -c/etc/wpa_supplicant/home.conf
	post-down /usr/bin/killall -q wpa_supplicant


And you're done:

$ sudo ifup wlan0
Internet Systems Consortium DHCP Client 4.1.1-P1
Copyright 2004-2010 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/wlan0/00:11:22:33:44:ff
Sending on   LPF/wlan0/00:11:22:33:44:ff
Sending on   Socket/fallback
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 4
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 10
DHCPOFFER from 192.168.0.1
DHCPREQUEST on wlan0 to 255.255.255.255 port 67
DHCPACK from 192.168.0.1
bound to 192.168.0.222 -- renewal in 1310 seconds.


Of course this has an effect that the network is configured on booting, which by default may delay a bit the boot process. If you don't like this you can remove the auto wlan0 and provide an alternate way of ifuping the interface (maybe in /etc/rc.local, which is run later in the boot process).

Syndicated 2011-07-22 19:02:35 from Ricardo Mones

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!