Back to website
Login
Home
Login
Register
Back to website
There was a problem loading the comments.
How to change the primary IP addres of a WHM/cPanel server?
Support Portal
»
Knowledgebase
» Viewing Article
Print
8 May 2019 7:30 AM
cPanel Tutorial
This is for
CentOS/RHEL
based servers.
Steps in WHM:
Log into WHM and go to Basic cPanel & WHM Setup
Change the Primary IP here with the option that says "
The IP address (only one address) that will be used for setting up shared IP virtual hosts
"
Note: This might not actually be necessary.
Log in to SSH, and do the following:
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 ::
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
service network restart
Note: You're probably going to be disconnected at this point, and have to log in to ssh using the new primary ip.
Restart the ipaliases script to bring up the additional IP
service ipaliases restart
Run ifconfig and make sure all IPs show up correctly.
Share via
Did you find this article useful?
Related Articles
Change service level (VPS Plans)
How to change an email account password in cPanel?
How to Change Language in cPanel?
Categories
6
.NET Applications
10
Billing
12
Emails
20
General
9
MS SQL 2005 / 2008
1
Scripting
57
WebsitePanel
33
— Video Tutorials
1
Migration
44
VPS/Dedicated Servers
4
— SSL Certificates
4
Company Policies
17
Plesk Control Panel
9
— Plesk Video Tutorials
3
Linux Server Tasks
4
Flexible Windows VPS
1
Promotions
82
Pre Sales
20
Manage SmarterMail 16
1
ScalElastic PaaS Cloud
22
SolidCP
64
cPanel Tutorial
12
— cPanel Email Tutorial
12
— cPanel Database Tutorial
7
— cPanel Files Tutorial
6
— cPanel Domains Tutorial
6
— cPanel Metrics Tutorials
4
— cPanel Security Tutorial
4
— cPanel Software Tutorial
8
— cPanel Advance Tutorial
3
— cPanel Preferences Tutorial
16
WordPress
5
MailEnable
7
DirectAdmin
8
WordPress
13
Backup & Data Protection (Acronis)
5
— Office 365 Backup
Tags
Acronis
Cpanel
cybersecurity
Outlook
security
sitelock
website security
website-scanning
whm
© Softsys Hosting
English