If you’re on Linux (or any Unix variant) and want to set a static IP address for your machine, make sure the interfaces file is as below. Comment out anything that are not shown in the lines below. This is based on a 192.168.1.0 network; if your’s is 192.168.0.0, change accordingly.
(You may need to have root privilege to perform this action)
First, bring down the interface using : ifdown eth0 [or eth1 as appropriate]
The file is located at: /etc/network/interfaces
Use an in-terminal editor like nano to edit this file. You can use command below in Terminal to open/ edit this file:
Go to the directory /etc/network/
and type in: nano interfaces
after the necessary changes are made use CTRL+O to save and exit.
Next, use ifup eth0 [or eth1 as appropriate] to bring the interface back up to reflect changes.
iface eth0 inet static
Leave questions and comments below.