If your Ubuntu 11.10 server, has a DHCP assigned IP address and you want to allocate a static IP address you will need to do the following:
edit the file /etc/network/interfaces
sudo vi /etc/network/interfaces
You will notice the following lines:
iface eth0 inet dhcp
This needs to be changed to:
iface eth0 inet static
- xxx.xxx.xxx.xxx is the static IP address you want to allocate.
- yyy.yyy.yyy.yyy is the netmask for the network the IP address is in. In a typical class C network this is 255.255.255.0
- zzz.zzz.zzz.zzz is the network that the IP address is located in. In a typical class C network this would be xxx.xxx.xxx.0 (xxx.xxx.xxx is the first three octets from above)
- aaa.aaa.aaa.aaa is the broadcast address for the network. In a typical class C network the this would be xxx.xxx.xxx.255 (xxx.xxx.xxx is the first three octets from above).
- bbb.bbb.bbb.bbb is the default gateway for the network the IP address is located in.
After the change has been made you will need to restart the network service, this is best done on the console, if the following is completed over a remote session (ssh for example) your session will terminate and if a mistake has been introduced you may not be able to get access again.
sudo service network restart
By Jay Fearn Google