Switch to Static IP Address on Ubuntu server or no gui 16.0.4.5, 17.04, 17.10
sudo nano /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto ens33 #ens33 is your interface lan in linux, to see what is name is your lan interface write this in linux terminal `ip add`
iface ens33 inet static
address 192.168.0.2
netmask 255.255.255.0
network 192.168.0.0
broadcst 192.168.0.255
gateway 192.168.0.1
dns-nameservers 192.168.0.3
Now exit nano by keyboard button pressing ctrl + x
Now check see what status is networking
service networking status
If networking status stopped " with red color " then write this:
service networking start
If networkng status is active " with green color " then write this:
service netwokring restart
https://websiteforstudents.com/switch-static-ip-address-ubuntu-17-04-17-10/