Knowledge Base

How To Assign an IP Address to CentOS Linux Server

This tutorial shows you how to assign an IP Address to your CentOS Linux Server.

Step 1. Log in to the server console as root user.
Step 2. Open the file /etc/sysconfig/network-scripts/ifcfg-eth0 in a text editor, such as VI, if your default network interface is eth0.
Step 3. Edit the file and add this information:
  Below is a description of the fields:
IP address IPADDR='your IP Address goes here'
Address Subnet Prefix PREFIX='IP Address subnet prefix goes here'
Step 4. Save and restart the network service.
Step 5. If you check with the command ifconfig -a, you can see the assigned IP address.

Congratulations, you have assigned a hostname IP Address to your CentOS Linux Server.

Did you find this article helpful?

* Your feedback is too short