How to Change the Main IP on Centos

  1. Navigate to the network scripts directory.

    [[email protected] ~]# cd /etc/sysconfig/network-scripts

  2. Locate the network interface file by typing ls

    • In this example, the network interface file is call ifcfg-eth0

  3. Edit that file using a text editor like nano or vi
    • nano ifcfg-eth0

  4. Edit the IPADDR , NETMASK, and GATEWAY IPs to the correct IP that is provided on your service profile or ticket.

  5. Save the changes.

  6. Restart the network
    • # service network restart
  7. Test by pinging a website or an IP


  8. Done!

  9. Please submit a ticket if you cannot reach your server after changing the IP.

Share This Post

Share on facebook
Share on linkedin
Share on twitter
Share on email

Related content