Setup static IP in ubuntu
Under certain circumstance you need to specify a static IP address. There are 2 different ways you can achieve this.
This command effect is temporary so the change will be swiped after ubuntu reboot or restart of network.
In Ubuntu OS, what you need to do is to modify
auto lo iface lo inet loopback auto eth0 iface eth0 inet static address [the ip you want] netmask [real net mask] network [network] gateway [gateway]
Change the interface name
eth0 if you wish to modify other interfaces.
After edition, you need to restart your network.
You can simply reboot ubuntu or use network restart. Notice by editing interface file, the change are permanent and will also be effective after reboot.