To set a static IP address in Linux, simple edit /etc/network/interfaces
and change your interface settings using the example below:
In this example, I’m setting my IP address to 192.168.1.100.
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
If you’re using Ubuntu and you want to set static nameservers, see this article: The Correct Way to Set Nameservers in Ubuntu 12.04 and up