First we need to find your gateway address this is the address your box goes through to get to the Internet.
You should get something that looks like this:
My gateway address is 192.168.0.1
Kernel IP routing table Destination Gateway Genmask Flags Metric 0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0.0.0.0 192.168.0.1 0.0.0.0 UG 303 192.168.0.0 0.0.0.0 255.255.255.0 U 303
Now we need to open /etc/network/interfaces but before we do that make a backup as from previous experiences if you mess this up its hard to fix.
sudo cp /etc/network/interfaces /etc/network/interfaces.backup
Now open the file with a editor of your choice.
sudo vi /etc/network/interfaces
And edit the line that looks like
iface eth0 inet dhcp
iface eth0 inet static
Now add these three lines underneath that
address 192.168.0.100 #This is the static ip
netmask 255.255.255.0 #This is the netmask which is a 24 bit netmask.
gateway 192.168.0.1 #This is the gateway address we found earlier
Edit: Better way instead of rebooting
ifconfig eth0 down;ifconfig eth0 up
Now we need to restart for the effects to take place.
If it all works you may want to remove the backup file to save space.