Configure static IP on Ubuntu

This procedure will work many version of Ubuntu. I personally tested this on all Ubuntu versions from 12 and up, and should also work fine, or be a very good indicator of what to do, on any Debian based Linux distribution.

Like many OS out there, right after installation, everything is configured to use DHCP. Unless you have configured a static IP during the install process. This post will not cover this.

So first thing to do, once logged in you brand new OS, edit the network configuration file;

The file should look something like this:

Now, comment the “iface eth0 inet dhcp” line, and add all parameters to configure your interface manually. It should look like this:

Change any parameter in there to suit your desired configuration.

You are done ! You can “reboot” for you settings to take effect, but that is a “Windows Admin” habit.

If you are in luck and using a common OS like Ubuntu 14+ You can do this for the IP to kick in without rebooting:

JohnyLuky has written 54 articles

One thought on “Configure static IP on Ubuntu

  1. OnlyMe says:

    For setting DNS, you can also do this:
    Edit /etc/resolvconf/resolv.conf.d/base

    Update resolvconf:
    sudo resolvconf -u

Comments are closed.