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 address 192.168.100.50 netmask 255.255.255.0 gateway 192.168.100.1
Adding Snel.com DNS server’s:
dns-nameserver 126.96.36.199 188.8.131.52
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.