I run my Raspberry Pi as a headless server using ArchLinux. This post runs through how-to setup a wireless network interface using the Edimax EW-7811UN (£9.20 from Amazon) and have it connect automatically on boot, all without leaving the command line.
This post is just as much for my benefit as it is for others. It probably won’t be long before I break something and have to install the OS!
Lets get started,
Ensure you have a recent release of Archlinux – I installed archlinux-hf-2012-09-18 which includes Linux 3.2 and the Edimax driver.
Install the wireless management tools
sudo pacman -S wireless_tools iwconfig
Create /etc/wpa_supplicant.conf and add your wifi settings,
Then run /sbin/ipconfig wlan0 to check whether it’s connected, if is says ‘not associated’ it failed to connect. Once your connected, you and request an IP address from your router with,
sudo dhcpd wlan0
Run ipconfig again and you should see your IP address.
Now we can move onto configuring your RPi to automatically connect on bootup. To do this, we’ll create a network profile using netcfg and configure systemd to start it during bootup.
sudo pacman -S netcfg
Define a network profile, create /etc/network.d/wlan and enter the following details
WPA_CONF='/etc/wpa_supplicant.conf' ; this is the file we created earlier
Now register your network profile with netcfg by adding the above filename to the NETWORKS list /etc/conf.d/netcfg,
Finally configure systemd to start netcfg during bootup,