Yikes was it really 2 months ago that I performed my raspberry pi reinstall. Where has the time gone…..
I want to be able to run my raspberry pi as a headless server that I could connect to from other machines within the house and look to do other projects with it in the future. So the first thing I needed to do was setup the Wifi, I remember the first time I did this it didn’t appear to be as easy I would have expected. My network is setup to use WPA2-PSK and most of the guides and documentation I could find on the net used wpa_supplicant to setup the wifi. Thankfully there is a much easier way than that.
To setup the wifi change the file called interfaces at /etc/networks/interfaces it will initially look like:
auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
To change to using dhcp comment out iface wlan0 and the wpa-roam lines and add a wpa-ssid and wpa-psk eg:
auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
##iface wlan0 inet manual
##wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface wlan0 inet dhcp
wpa-ssid <networkid>
wpa-psk <password>
iface default inet dhcp
Now because I want it to be a headless server rather than using dhcp I need to switch to manually configuring the ipaddress. Change the iface wlan0 line and add a few more:allow-hotplug wlan0
iface wlan0 inet static
address <ipaddress>
netmask <network_mask>
gateway <gateway>
wpa-ssid <networkid>
wpa-psk <password>
The final change is to update the nameserver for the system to ensure that it can lookup address correctly this is help within /etc/resolv.config:
nameserver <dns_server>
The dns_server will either be the gateway server or the dns server that is supported by an isp.




