How to Change the Main IP on Centos

  1. Navigate to the network scripts directory.

    [root@AT16-693 ~]# cd /etc/sysconfig/network-scripts

  2. Locate the network interface file by typing ls

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

  3. Edit that file using a text editor like nano or vi
    1. 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
    1. # 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.