Setup a static IP in Ubuntu

openĀ /etc/network/interfaces with editor

auto eth0
#iface eth0 inet dhcp
iface eth0 inet static
address 192.168.56.101
netmask 255.255.255.0
gateway 192.168.56.1

and then

service networking restart