A static IP address is mainly used for name resolution, so that a computer can be reached over the network by its host / domain name. Web and FTP servers in particular benefit from static addressing also known as fixed or hard coded addressing. Using static IP addresses on home networks allows us protection against network security problems. Using static IP address assignment for all devices on the home network guarantees to avoid potential address conflicts where DHCP may supply an address already assigned statically elsewhere on the network.
The following is for most Linux systems, however if you are using Debian or Ubuntu the procedure is different, please use my article titled setup and configure a static IP on Debian if you are running a Debian box.
To configure a static IP on CentOS - Redhat or Fedora, complete the following steps.
Next, we need to restart the network with the following command from a terminal service network restart Make sure you are still logged in as a superuser.
Next, change directory to /etc and edit the resolv.conf file with nameserver information as follows;
Next, we need to apply the changes, we can do this as follows;
That's it, you are done. Test your internet by launching a browser or ping your favorite host.