Web Hosting Forum - A Web Hosting community for Webmasters


Divi WordPress Theme

Author Topic: Best way to update cPanel main IP  (Read 2020 times)

0 Members and 1 Guest are viewing this topic.

Offline Rick

  • New Member
  • *
  • Posts: 25
  • iTrader: +0/-0
    • View Profile
Best way to update cPanel main IP
« on: February 26, 2014, 02:27:01 PM »
We have had this particular server running for quite some time without any issues until today. We were just informed that we were the target of a DDOS attack and as a result, the datacenter has null routed the IP address in question. This IP address was not only our main IP address, but also the main shared IP for the shared hosting accounts.

If we were to pick another IP address in our pool to act as both the main IP and the new shared IP (Or split them up even), what would be the best way to change this in cPanel? I know we can set the new shared IP in the basic setup area in WHM, but I'm not sure how to tell cPanel to use a different IP as its "main" IP.

Rick

VPS Hosting - AccuWebHosting

Offline Kailash

  • Administrator
  • Web Hosting Master
  • *****
  • Posts: 601
  • iTrader: +153/-0
    • View Profile
Re: Best way to update cPanel main IP
« Reply #1 on: February 28, 2014, 12:33:53 PM »
The best way to deal with such issue is,

Create few resellers accounts from WHM -> Assign different IP addresses to each reseller account -> spread your domains to different resellers.

Offline Rick

  • New Member
  • *
  • Posts: 25
  • iTrader: +0/-0
    • View Profile
Re: Best way to update cPanel main IP
« Reply #2 on: March 06, 2014, 02:54:57 PM »
Hello Kailash,

Thank you for the details. This will certainly help you reduce the impact of DDoS attacks.

Thanks!

- Rick

Offline DouglasSmith

  • New Member
  • *
  • Posts: 18
  • iTrader: +0/-0
  • Hello! I am Douglas Smith.
    • View Profile
    • http://poweruphosting.com/dedicated-servers
Re: Best way to update cPanel main IP
« Reply #3 on: October 01, 2014, 01:19:50 PM »
The best to change the cpanel main IP is firstly you have to login and then go to basic cpanel. Change the primary IP address here with the option The IP address that will be used for setting up the main IP.

« Last Edit: October 08, 2014, 07:44:23 PM by DouglasSmith »

hmb-willem

  • Guest
Re: Best way to update cPanel main IP
« Reply #4 on: January 28, 2016, 02:03:41 PM »
Hello,

There are some situations where you may need to set up multiple shared IP addresses on a server.  Some reasons may include grouping accounts per IP or lowering the effect of DDoS attacks if it becomes necessary to block traffic to a specific interface.  Whatever the reason, multiple shared IP addresses on a cPanel server is rather easy to set up.

First you’ll want to reserve the IP address via WHM -> Reserved IPs.  Alternatively, simply drop them into /etc/reservedips, separated by line, ie:

192.168.1.1

192.168.1.2

192.168.1.3

If you want to label the reserved IPs, set them up in /etc/reservedips:

192.168.1.1 =shared ip

192.168.1.2=shared ip

… and so on

Now rebuild the IP pool:

/scripts/rebuildippool

This will prevent the IPs from being used as dedicated IPs for individual cPanel accounts, but for multiple accounts to be able to use them as shared IPs you’ll need to add them to a pool.  Simply use the /var/cpanel/mainips/root file to list each IP on its own line.  When root creates an account on the server, the first IP address in that file will be used.  If you want a reseller to have multiple shared IPs as well, simply replace ‘root’ with the reseller’s username.

To take this configuration further, you may want to have the main IP rotate automatically so each IP in the pool gets equal use.  We’ve written a script to automate this task rather seamlessly via cron.

Click here to download the script

Installation steps:

wget -O /usr/bin/rotate_main_ips http://www.thecpaneladmin.com/files/rotate_main_ips.py

chmod 755 rotate_main_ips

echo ‘*/30 * * * * /usr/bin/rotate_main_ips’ > /etc/cron.d/rotate_main_ips

service crond reload

Offline imort

  • New Member
  • *
  • Posts: 14
  • iTrader: +0/-0
    • View Profile
Re: Best way to update cPanel main IP
« Reply #5 on: May 24, 2016, 03:28:23 PM »
If we were to pick another IP address in our pool to act as both the main IP and the new shared IP (Or split them up even), what would be the best way to change this in cPanel? I know we can set the new shared IP in the basic setup area in WHM, but I'm not sure how to tell cPanel to use a different IP as its "main" IP.
Rick

You can take a look at official documentation here: https://documentation.cpanel.net/display/ALD/IP+Migration+Wizard

Offline AmarInfotech

  • New Member
  • *
  • Posts: 46
  • iTrader: +0/-0
  • We Know What's Matter
    • View Profile
    • Web Design & Mobile Application Development Company
Re: Best way to update cPanel main IP
« Reply #6 on: December 09, 2016, 12:10:45 PM »
Splitting of websites on different IPs is definitely a workaround if you have 10-20 websites but not a solution. If you have hundreds of websites, moving them to different IPs and changing their A record will be time consuming but most importantly will result in downtime too. You have to find the target domain and get it off your server as soon as possible because if the attack is re-initiated on the target domain, the data center will null-route the new IP as well.

Divi WordPress Theme
Tags:
 

Related Topics

  Subject / Started by Replies Last post
0 Replies
2753 Views
Last post July 29, 2007, 12:58:40 PM
by Kailash
0 Replies
3295 Views
Last post September 28, 2008, 08:45:19 PM
by Kevin
2 Replies
1214 Views
Last post September 17, 2014, 11:03:37 AM
by WebhostingTalk
1 Replies
345 Views
Last post July 18, 2016, 06:13:07 PM
by Kosimo
0 Replies
98 Views
Last post July 26, 2017, 11:30:51 AM
by maheshseo