Static IP Configuration on Ubuntu 16.04

Estimated reading time: < 1 min
In this article


    There are two methods to assign network configuration to a device on the net. DHCP or static assignment. DHCP is normally set as default. Static configurations usually need IP addresses as well as DNS resolvers plus routing. In this tutorial, we will cover Linux static configuration on Ubuntu 16.04.

    The first step is to edit this file /network/interfaces

    sudo nano /etc/network/interfaces

    You need to remove the “dhcp line” and add your own address, netmask, gateway and dns nameserver.

    auto ens160
    iface ens160 inet dhcp
    iface inet static

    Adding DNS server’s:


    If you want to reboot your system:


    and for restarting, in case you do not want to reboot:

    sudo /etc/init.d/networking restart

    Now you are all set to go with the static IP address details you have provided.

    Was this article helpful?
    Dislike 2
    Views: 14271

    Reader Interactions

    Leave a Reply

    Your email address will not be published. Required fields are marked *