It would really make my life easier If I could add multiple shared IP addresses in WHM. Can you help me?
That was a recent support ticket received at our Outsourced Technical Support department where we resolve support queries for web hosts.
Server owners need multiple shared IP addresses in servers to group accounts per IP, minimize the effect of DDOS attacks, etc.
But, WHM allows you to have only one main shared IP address by default.
So, what can be the next option? Fortunately, there is a workaround for this.
Today, let’s discuss how our Dedicated Support Engineers assist server owners setup multiple shared IP addresses in WHM.
How to setup multiple shared IP addresses in WHM?
There are 2 easy methods to setup WHM multiple shared IP addresses.
1) Reserve the IPs in WHM
This is one of the easy ways to setup multiple IP addresses in WHM.
Now, let’s see how our Support Engineers set it up on a cPanel server.
a) Add the new IP address to WHM
Firstly, we add the new IP address to the server.
We add it via WHM from IP Functions > Add a New IP Address option.
b) Reserve the IP addresses
Secondly, we reserve the new IP address in the server.
Therefore, this will prevent the IPs from being used as dedicated IPs for individual cPanel accounts.
To do this, we add the IPs to the reserved list using the below steps.
- Go to WHM > IP Functions > Show/Edit Reserved IPs.
- Check the IP to be reserved and add reason for reserving.
- Click Save.
Alternatively, we add the IPs to be reserved in the file “/etc/reservedips” as shown below.
125.xx.54x.12x = shared ip 125.xx.xx.1x6 = shared ip
Here, first parameter is the IP address and the second is the reason for reserving the IP.
c) Rebuild the IP pool
Next step is to rebuild the IP pool.
This scans and determines the unused IP addresses in the server and adds it to the IP address pool.
As a result, when WHM creates new accounts, it uses the IP addresses from this pool.
Our Support Engineers rebuild the IP address pool from WHM > IP Functions > Rebuild the IP Address Pool.
Alternatively, we use the below script to rebuild the IP address pool.
d) Add the IP in mainips file
For multiple accounts to use these IPs as shared IP addresses, we add them to a pool.
For that, we follow the below steps.
- Create a folder /var/cpanel/mainips if it not exists.
- After that, create a file /var/cpanel/mainips/root.
- Further, add each IP in a single line.
- Finally, save the file.
So, when root creates an account, the first IP address in the file will be used.
Likewise, if a reseller needs multiple shared IP addresses, simply replace this filename with the reseller username.
Also, our Support Engineers create custom scripts in the server for IP rotation so that each IP in the pool gets equally used.
[Need assistance to setup multiple shared IP addresses in WHM? Our Support Engineers are here for your help!]
2) Create Reseller Accounts
Now, let’s see the second option to use multiple shared IP addresses in WHM.
The idea is to create a reseller account and share the reseller’s IP with the accounts under this reseller.
Our Support Engineers follow the below steps for this.
- Create a new account using the Create a New Account option.
- Then, modify the account and assign Reseller privileges.
- Assign a free IP to that account from Manage Reseller’s Shared IP feature in WHM.
- Go to WHM > IP Functions > Change Site’s IP address area and assign the new IP.
- Then, create new accounts under this reseller and share that IP for these accounts.
You’re done!! You have multiple shared IP addresses on your server.
In short, server owners need multiple shared IP addresses in servers to group accounts per IP, minimize the effect of DDOS attacks. Today, we’ve seen the 2 easy steps to add multiple shared IP addresses in WHM and how our Dedicated Support Engineers implement it.