If you don't know how to use vim or other command line text editors and just want to edit the file, try installing nano this needs an Internet connection though),with:
sudo apt-get install nano
Nano is fairly obvious as it follows normal GUI based methodologies.
Now you can use nano (or any other text editor, just substitute it for 'nano' in the below command) to edit the interfaces file:
sudo nano /etc/network/interfaces
To determine what entries should go into this file review the options at this page:
My interfaces file looks like the following (I am using WPA2 security):
auto lo iface lo inet loopback auto wlan0 iface wlan0 inet dhcp wpa-driver wext wpa-ssid <--NAME OF AP--> wpa-ap-scan 1 wpa-proto RSN wpa-pairwise CCMP wpa-group CCMP wpa-key-mgmt WPA-PSK wpa-psk <--INSERT KEY XXXXXXXXXXXXXXXXX-->
The items in green above are placeholders for your security settings. You need to replace them with
Once you have completed the amendments to the interfaces file and want to test the setup enter the following command to restart the networking services:
sudo service networking restart
If that all goes well, check the interface is working (up) with this command:
Hopefully some traffic is reported to have taken place and that an IPv4 address has been allocated.
If not, check the dmesg log for error messages:
Finally to test everything is working, try pinging a site, for example: