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.
iface ens160 inet dhcp
iface inet static
Adding Snel.com DNS server's:
dns-nameserver 184.108.40.206 220.127.116.11
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.