Setting a static IP address

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 network; if your’s is, 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.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s