Skip to main content

Network configuration – Static IP on Linux

Most probably, one of the first setting you want to do will be to assign a static IP of our server among your local network and start configuring your router and domain name.

Networks explanation

Indeed, if you start to install services (Like a website, a torrent client, a jukebox, etc…), you have to make sure all the ports are open and redirected to the correct machine and your domain name is well configured.

But to do so, you need first to make sure the IP of your server will not change. Hence you need to set a static IP into the /etc/network/interfaces file.


and mine is the following:

The part that interest us is iface eth0 inet static and then set the address IP you want (Usually or depending on your router configuration) while the netmask is always the same.

After modification, just save (CTRL+X then Y) and restart your network


Don’t know your IP?

If you don’t know your local IP address on your server or the gateway, you could check the current automatic (DHCP) configuration.

Just type:

and you should have something similar to that:

My local IP address is then

And for the gateway, it is most of the case if your IP is and will be is your IP is