{"id":4579,"date":"2018-09-06T04:36:19","date_gmt":"2018-09-06T04:36:19","guid":{"rendered":"https:\/\/geekdecoder.com\/?p=4579"},"modified":"2018-09-06T04:36:19","modified_gmt":"2018-09-06T04:36:19","slug":"how-to-change-the-primary-ip-address-of-a-whm-cpanel-server","status":"publish","type":"post","link":"https:\/\/www.qbytes.cloud\/index.php\/2018\/09\/06\/how-to-change-the-primary-ip-address-of-a-whm-cpanel-server\/","title":{"rendered":"How to change the Primary IP Address of a WHM\/Cpanel server"},"content":{"rendered":"<p>This is for CentOS\/RHEL based servers.<\/p>\n<p>Steps in WHM: Log into WHM and go to Basic cPanel &amp; WHM Setup.<\/p>\n<p>Change the Primary IP here with the option that says &#8220;The IP address (only one address) that will be used for setting up shared IP virtual hosts&#8221;<\/p>\n<p>Log in to SSH, and do the following:<\/p>\n<p>Edit \/etc\/sysconfig\/network-scripts\/ifcfg-eth0<br \/>\nChange the IPADDR and GATEWAY lines to match the new IP and Gateway for the new ip<\/p>\n<p>Edit \/etc\/sysconfig\/network<br \/>\nChange the GATEWAY line here if it does not exist in the ifcfg-* file.<\/p>\n<p>Edit \/etc\/ips<br \/>\nRemove the new primary IP from this file if it is present<br \/>\nAdd the old primary IP to this file with the format <\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n\n &lt;IP address&gt;:&lt;Net Mask&gt;:&lt;Gateway&gt;\n\n<\/pre>\n<p>Edit \/var\/cpanel\/mainip<br \/>\nReplace the old primary IP with the new primary IP<\/p>\n<p>Edit \/etc\/hosts<br \/>\nReplace the old primary IP with the new one if needed. The hostname&#8217;s dns will need to be updated too<\/p>\n<p>Restart the network service to make the new IP the primary<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n# service network restart\n\n<\/pre>\n<p>Note: You&#8217;re probably going to be disconnected at this point, and have to log in to ssh using the new primary ip.<\/p>\n<p>Restart the ipaliases script to bring up the additional IPs<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n# service ipaliases restart\n\n<\/pre>\n<p>Run ifconfig and make sure all IPs show up correctly<\/p>\n<p>Update the cpanel license to the new primary IP<\/p>\n<p>Verify you can still log in to WHM and there is no license warning<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is for CentOS\/RHEL based servers. Steps in WHM: Log into WHM and go to Basic cPanel &amp; WHM Setup. Change the Primary IP here with the option that says &#8220;The IP address (only one address) that will be used for setting up shared IP virtual hosts&#8221; Log in to SSH, and do the following: &#8230; <a title=\"How to change the Primary IP Address of a WHM\/Cpanel server\" class=\"read-more\" href=\"https:\/\/www.qbytes.cloud\/index.php\/2018\/09\/06\/how-to-change-the-primary-ip-address-of-a-whm-cpanel-server\/\" aria-label=\"Read more about How to change the Primary IP Address of a WHM\/Cpanel server\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[],"class_list":["post-4579","post","type-post","status-publish","format-standard","hentry","category-cpanel"],"_links":{"self":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/4579","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/comments?post=4579"}],"version-history":[{"count":0,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/4579\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/media?parent=4579"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/categories?post=4579"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/tags?post=4579"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}