Pages

Friday, April 12, 2013

How to change the primary IP address on cPanel

Edit /etc/sysconfig/network-scripts/ifcfg-eth0

    Change the IPADDR and GATEWAY lines to match the new IP and Gateway for the new ip

Edit /etc/sysconfig/network

    Change the GATEWAY line here if it does not exist in the ifcfg-* file.

Edit /etc/ips

    Remove the new primary IP from this file if it is present
    Add the old primary IP to this file with the format <IP address>:<Net Mask>:<Gateway>

Edit /var/cpanel/mainip

    Replace the old primary IP with the new primary IP

Edit /etc/hosts

    Replace the old primary IP with the new one if needed. The hostname’s dns will need to be updated too

Restart the network service to make the new IP the primary

    /etc/init.d/network restart

Restart the ipaliases script to bring up the additional IPs

    /etc/init.d/ipaliases restart

No comments:

Post a Comment