How to add an IP to a WHM/cPanel server via SSH


Sometimes it's quicker to administer a server via SSH, rather than logging into the WHM control panel and using the Graphical User Interface.

The whmapi1 command line tool is very useful for performing certain WHM administration tasks via SSH. 

The following whmapi1 commands should work on any WHM/cPanel server, no matter what distribution it's running.

For example, if you want to add the IP address with netmask to your server:

1. SSH to your server.

# ssh root@your.server.ip.address -p 22

2. Enter the whmapi1 command:

# whmapi1 addips ips= netmask=

3. Make sure the new IP is reachable by pinging it:

# ping

If you made a mistake for any reason, you can remove the IP with the following command:

# whmapi1 delip ip=

Once the new IP is added and verified as working, you can begin assigning cPanel accounts to the IP as needed:

# whmapi1 setsiteip ip= user=cpanelusername

You can check which IP an account is currently using:

# whmapi1 get_shared_ip user=cpanelusername

Or list all IP's configured on the server:

# whmapi1 listips

If you have any issues with the above process, please feel free to submit a support ticket for further assistance.


Have more questions? Submit a request