How To: Static IP Address In Ubuntu
In order to setup a system to use a static IP address you have to edit the /etc/network/interfaces file.
The first step is to backup the existing file, just in case you screw something up by accident, or something otherwise doesn’t work as it should.
#cd /etc/network
#cp interfaces interfaces.backup
Next, edit the file as root with your favorite text editing program. I personally like Vim.
#sudo vim interfaces
add the # symbol beside what is already there for the interface you want to configure. The # makes whatever comes after it in the line a comment, and the computer doesn’t read it.
Next copy the following text and edit to fit your needs:
auto eth0
iface eth0 inet static
address 192.168.0.3
netmask 255.255.255.0
gateway 192.168.0.1
Save the file and quit. The next time you restart your computer it should automatically setup your network interface as you programed it to.