open up the /etc/network/interfaces file
sudo nano /etc/network/interfaces
Add the following setting:
auto eth0
iface eth0 inet static
address 192.168.1.100 <-- static ip netmask 255.255.255.0 <-- Netmask network 192.168.1.0 <-- Network, should be your gateway IP with last digit = 0 broadcast 192.168.1.255 <-- Network, should be your gateway IP with last digit = 255 gateway 192.168.1.1 <-- Gateway set the DNS :
sudo nano /etc/resolv.conf
On the line ‘name server xxx.xxx.xxx.xxx’ replace the x with the IP of your name server.
restart the network configuration :
sudo /etc/init.d/networking restart