A wifi-connected laptop as a home server May 29, 2008Posted by claudio in Uncategorized.
Tags: GNU/Linux, Linux, Ubuntu, wifi, wpasupplicant
As probably many people nowadays, I only have laptops at home. Actually one for me and one for my girlfriend (luckily babies don’t need laptops yet ). As we made the move to laptops a long time ago, you end with older – perfectly fine – laptops. Similarly, I stopped making holes in the walls a long time ago and went wireless.
Laptop and wifi do not sound like a winning server combination, but for me they are. Happily, nowadays wifi is as easy in Linux as in Windows or MacOsX. But do you really want you laptop to use a graphical semi-interactive process to get it’s – often random – IP address? What if the machine will run without an X server?
wpasupplicant and the old manual network configuration come to the rescue. I use this configuration for my graphical over-sized living room divx/mpeg/flac/ogg/mp3-player laptop connected to my tv and stereo and non graphical print server (an old trusty amd 350mhz cpu with 160 mb ram and 4 gb disk) in the home office (far from the living room where we often work).
1. If wpasupplicant is not installed, apt-get it:
$ sudo apt-get install wpasupplicant
2. Create a wpasupplicant config file. Mine looks like this and lives in /etc/wpa_supplicant.conf. My config looks like this (a wpa2-personal wifi router, you need to put your own values where you find ):
root@melbourne:~# cat /etc/wpa_supplicant.conf
ssid="[your ssid network name]"
group=CCMP TKIP WEP104 WEP40
psk="[Your wpa2 ascii password]"
3. Configure the network. Here my wifi card is recognized as ath1 and the driver is madwifi. Change accordingly.
root@melbourne:~# cat /etc/network/interfaces
iface lo inet loopback
iface ath1 inet static
pre-up /sbin/wpa_supplicant -Bw -c /etc/wpa_supplicant.conf -i ath1 -D madwifi
post-down pkill -9 wpa_supplicant
4. Restart the network settings:
$ sudo /etc/init.d/networking restart
5. Go on and install the software you need or disable what you don’t if you are low on resources.