Set manual ip in Ubuntu Server (console only)

sudo vi /etc/network/interfaces

Colors after often hiding the text (dark-blue on black), so i turn off syntax higlighting

Before:
putty-before-syntax-off

 

 

 

 

 

 

 

 

Use Escape to go to command mode

:syntax off

<ENTER>

After:
putty-after-syntax-off

 

 

 

 

 

 

 

 

The lines for the dhcp enabled eth0 interface will look like this:

auto eth0
iface eth0 inet dhcp

Start editing for eth0

auto eth0
iface eth0 inet static
address 10.0.0.30
network 10.0.0.0
netmask 255.255.255.0
broadcast 10.0.0.255
gateway 10.0.0.1

dns-nameservers 10.0.0.50 10.0.0.51

Remember to put dns-nameservers separated by space here instead of in /etc/resolv.conf like some pages recommend because changes will be overwritten by resolvconf (default installed on Ubuntu)