Set Static IP in Ubuntu Server

To set static IP for Ubuntu Server, we just need to modify file /etc/network/interfaces. The example below shows that we set static IP for ethernet interface eth0 to 192.168.1.31

And on/off interface: