How to configure multipile shared IP’s on a cPanel server

Sometimes we need to set up several shared IP addresses on a server. This may include grouping accounts per IP or decreasing the consequence of DDoS attacks if it becomes necessary to block traffic to a specific interface .

You can’t add multiple shared IPs in WHM GUI, but it’s possible to do so via SSH and its very easy to set up. Follow the simple steps given below.

Login to your server as a root user

First, you need to create a /var/cpanel/mainips/ directory, if it doesn’t exist:

# mkdir /var/cpanel/mainips/

Then, create a /var/cpanel/mainips/root file, with all the Ip’s as follows:


Each separated line is an additional shared IP in WHM. That’s it!

Now rebuild the IP pool:


You can verify from WHM>>Home>>IP Functions>>Show/Edit Reserved IPs
This will prevent the IPs from being used as dedicated IPs for individual cPanel accounts, 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.

That’s all to do, Now you know how its easy to configure multipile shared IP’s on a cPanel server. You also like to know how to create a mini speedtest server on your VPS , Please check that and also Give your opinion below if you experience any issues or to discuss your ideas and experiences.