I believe there maybe a different way of doing this in version 18.04, but I think I have version 16.
Responds: Description Ubuntu 16.04.3 LTS
sudo vim /etc/network/interfaces
Responds: Opens the interfaces file
Note: iface eth0 inet dhcp — that means that I’m currently set to DHCP vs. Static
Made some edit and adds to this file:
Edits: From dhcp to static
Add: Everything else — I confirmed my Internet router info is correct in file
iface eth0 inet static
Note: To save and quit from vim — :wq
Reboot the server: sudo reboot (Note: There may be a more elegant way)
Note: I had been logged in to my Netgear, and before connecting to UbuntuServer, noticed that the IP is now 192.168.1.10 — which is correct
Make a connection:
Ping the outside:
ping google.com — that worked.
Summary: Now I have a static ip address on UbuntuServer 16.04