Problem
You want your Ubuntu computer to stay on same IP address so you and other people can access it with ease.
Solution
There are two ways you can set your computer with a static IP address:
1. Reserve the IP address in your DHCP server.
If you have access your DHCP server, you can reserve the static IP address in your DHCP server with your computer’s MAC address and keep your computer as DHCP enabled. This is the preferred way for system administrators so they have single point of maintenance and elimininates potential IP conflicts.
2. Setup the IP address in your computer.
Use this way only if you have no access to the DHCP server. Check with your system administrator on which IP address you can use. It will be terribly hard to trouble shoot problem with two computer sharing same IP address.
Setting up Static IP Address in Ubuntu
- Edit /etc/network/interfaces
- This the setting for DHCP. You should make a copy of the file for safe keeping.
- Edit the file to change Eth0 from “ifac etho inet dhcp” to “iface etho inet static” and put the IP address, netmask, network, broadcast and gateway. You should adjust your setting per your network requirement.
Restart the Network
You need to restart the network for the new setting to take effect. To restart the network interface:
/etc/init.d/networking restart