Ordinary technology

Wireless auto configuration with guessnet on Linux

May 17, 2015

The wireless tour eiffel
Assume we have access to the wifi at work and at home. How can I configure my laptop to automatically connect to the right network without using a graphical network manager ? Welcome guessnet !

Install the guessnet package :

sudo apt-get install guessnet

Edit your /etc/network/interface :

auto wlan0
mapping wlan0
	script /usr/sbin/guessnet-ifupdown
	map home work
	map timeout: 9
	map init-time: 9
	map verbose: true
	map debug: false	

iface home inet dhcp
	wpa-ssid "homessid"
	wpa-psk "homepassword"
	test wireless essid HOMESSID

iface work inet dhcp
	wpa-ssid "workssid"
	wpa-psk "workpassword"
	test wireless essid WORKESSID

(variables to adapt to your configuration in italic)

We define the ‘home’ and ‘work’ networks as usual with the iface command. The 2 differences are :

The mapping block uses an external script (here guessnet) with prudent parameters

That’s it !