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
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
9
Billing
10
Emails
20
General
9
MS SQL 2005 / 2008
1
Scripting
1
Migration
46
VPS Hosting
4
— SSL Certificates
1
— Linux VPS Hosting
4
Company Policies
4
Flexible Windows VPS
1
Promotions
84
Pre-Sales Queries
1
ScalElastic PaaS Cloud
13
Backup & Data Protection (Acronis)
5
— Office 365 Backup
26
Mail Server Tutorials
21
— SmarterMail
5
— MailEnable
26
Web Hosting
23
— Application Hosting
6
—— .NET Applications
16
—— WordPress
1
—— Nop Commerce Hosting
163
Control Panels
57
— WebsitePanel
33
—— Video Tutorials
17
— Plesk Control Panel
9
—— Plesk Video Tutorials
22
— SolidCP
60
— cPanel
7
— DirectAdmin
Tags
24/7 Trading Server
Account Suspension
Account Termination
Acronis
AddonPurchase
Anti-Spam Protection
asp.net
AutoBilling
Automatic Payment
Billing
Billing Policy
BillingAgreement
BillingSupport
Bulk Email Guidelines
BuyAddons
cheduled Maintenance Notifications
Client Access License (CAL)
Client Area Announcements
Cloud VPS Hosting
Compliance & Security
Cpanel
CreditCardPayment
cronjobs
Customer Support
cybersecurity
Cybersecurity Policy
Data Backup
DebitCardUpdate
Dedicated Server Solutions
Downgrade Plan
Email Deliverability
Email Deliverability Policy
Email Forwarding Policy
Email Forwarding Restrictions
Email Hosting Restrictions
Email Rate Limits
Emergency Maintenance Updates
Fast Trade Execution
Forex VPS Hosting
hosting
Hosting Cancellation
Hosting Guide
Hosting Payment
Hosting Service Updates
Hosting Terms & Conditions
HostingAddons
HostingBilling
HostingDiscounts
HostingDowngrade
HostingPayments
HostingRefunds
HostingSupport
Increase RDP Users
Invoice Processing
InvoicePayment
LateFeePolicy
Linux VPS Hosting
Low Latency Trading
mail Sending Limits
Mail Server Blacklisting
ManageBilling
ManagedHosting
Multi-User Windows VPS
Network Protection
Outlook
Overdue Invoice
OverdueInvoice
Payment
Payment Policy
PaymentDue
PaymentGateway
PayPalBilling
PayPalSetup
PayPalSubscription
PlanDowngrade
Refund Policy
Remote Desktop Access
Remote Desktop Licensing
Scalable Web Hosting
Secure Email Hosting
Secure Email Sending
Secure Forex Trading
Secure Hosting
security
Server Maintenance Policy
Server Management
Server Protection
ServerDowngrade
ServerUpgrade
Service Cancellation
Service Downtime Alerts
Service Renewal
ServiceReactivation
Shared Email Server Policy
Shared Hosting Email Policy
sharedhosting
sitelock
Smartermail
SMTP Restrictions
Softsys Hosting
SoftsysBilling
SoftsysHosting
Tech Support
TechSupport
Unlimited Domain Hosting
Unlimited Website Hosting
Upgrade Plan
UpgradeHosting
VPS
VPS Billing
VPS Email Solutions
VPS for MetaTrader
VPS for Multiple Websites
VPS for Remote Work
VPS Performance Optimization
VPS Resource Management
VPS Software Installation
VPSDowngrade
VPSHosting
Web Hosting
Web Hosting Flexibility
Web Hosting Maintenance
Web Hosting Security
webhosting
Website Hosting Solutions
Website Safety
website security
website-scanning
WebsiteManagement
whm
Windows Server RDP Limits
Windows VPS CAL License
Windows VPS for Trading
Windows VPS Hosting
Windows VPS RDP Users
© Softsys Hosting
English