IP Manager For WHMCS

From ModulesGarden Wiki
Jump to: navigation, search


About IP Manager For WHMCS

IP Manager For WHMCS allows you to conveniently add and manage IP subnet, and automatically assign IP addresses to your servers, products, addons or configurable options.

With our module you will be also able to assign an IP subnet to a specified client, integrate with 3rd party applications like cPanel, export IP subnets or view clear graphs.
You will also be able to synchronize IP addresses used by products in your WHMCS system with the module's IP subnets.
What is more, IP Manager For WHMCS will allow your customers to easily manage their IP addresses from the WHMCS client area.

  • Admin Area Features:
✔ Show And Manage Multi-Level IP Subnets In Tree-View
✔ Create Multiple Configurations For Multiple Scenarios Of IP Addresses Assignment
✔ Create Multiple Relations In One Configuration For Products, Addons, Configurable Options & Servers
✔ Define IP Addresses Reservation Rules - Reserve IP Addresses For Network, Gateway, Broadcast And More
✔ Define Default Custom Fields For:
✔ Subnets
✔ IP Addresses In Chosen Subnets
✔ Export/Import IP Subnets - Supports XML And CSV Formats
✔ Omit Dedicated IP Address Fields For Chosen Configuration
✔ Toggle Custom Field Usage Instead Of 'Assigned IP' Field
✔ Synchronize IP Addresses Used By Products In WHMCS With IP Manager
✔ Receive Automatic Email Reminder Sent When Specified Usage Percentage Of Any IP Subnets Has Been Exceeded
✔ Define Configuration Of Integration Method (cPanel & cPanel Extended)
✔ Set Up IP Addresses Cleaner - Ensures That All Assigned IP Addresses Are In Use
✔ View IP Subnets Usage Statistics And Graphs
✔ View Logs
  • IP Subnet Features:
✔ Add IP Subnet Using CIDR Notation
✔ Exclude Selected IP Addresses From IP Subnet During Its Creation
✔ View IP Addresses Of IP Subnet
✔ Split/Merge Subnet
✔ View And Create Child Subnets
✔ Delete Single IP Address From IP Subnet
✔ Assign/Unassign IP Addresses To/For Service
✔ Bulk Actions - Assign/Unassign/Delete IP Addresses
✔ Lock IP Subnet To Client Or Clients Service
✔ Create Custom Fields For IP Subnet Or IP Address
✔ Generate Free IP Addresses
✔ Sequentially
✔ Defined Manually
  • Client Area Features:
✔ View Assigned IP Addresses And Subnets
✔ Unassign IP Addresses
✔ Order Additional IP Addresses
  • 3rd Party Integration Modules:
✔ cPanel
cPanel Extended
✔ Plesk
Virtuozzo VPS
SolusVM Extended VPS
Proxmox VPS
  • General Info:
✔ Supports IPv4 and IPv6
✔ Supported All Types Of Configurable Options
✔ IP Subnets Rely On IP Addresses Range And Assigned IP Addresses (Free IP Addresses Are Not Stored In Database)
✔ Create New 3rd Party Integration Modules
✔ Multi-Language Support
✔ Supports PHP 5.3 Up To PHP 7
✔ Supports WHMCS Templates Five and Six
✔ Supports WHMCS V6 and V7


This tutorial will show you how to successfully install and configure IP Manager For WHMCS.

We will guide you step by step through the whole installation and configuration process.

1. Log in to your client area and download IP Manager For WHMCS.
2. Upload and extract the module into the main WHMCS directory.

Files in your WHMCS directory should look like these.

3. When you install IP Manager for the first time, you have to rename 'license_RENAME.php' file.

File is located in 'modules/addons/IPM2_anager2/license_RENAME.php'. Rename it from 'license_RENAME.php' to 'license.php'.

4. In order to configure your license key, you have to edit a previously renamed 'license.php' file.

Enter your license key between quotation marks as presented on the following screen. You can find your license key in your client area → 'My Products'.

5. Remove all files from 'tempates_c' folder located in your WHMCS root directory.
6. Now, you have to activate the module in your WHMCS system.

Log in to your WHMCS admin area and go to 'Setup' 'Addon Modules'.
Afterwards, find 'IP Manager' and press 'Activate' button.

IPM2 5.png
7. In the next step you need to permit the access to the module.

Click on 'Configure' button, tick desired admin roles and press 'Save Changes'.

IPM2 6.png
8. The last step is setting chmod 755 to 'storage' folder.

Folder is located in 'you_whmcs/modules/addons/IPmanager2'.

9. You have just successfully installed IP Manager!

You can access your module in 'Addons' 'IP Manager'.

IPM2 7.png

Configuration and Management

IP Manager For WHMCS allows you to manage dedicated IP addresses' subnets, automatically assign them to clients/products/servers/addons/configurable options.

The module enables clients to manage and order dedicated IP addresses, IPv4 or IPv6.
In this short guide the possibilities of the module will be briefly described.


To manage any subnet via IP Manager you have to add it first.

Remember that it is very important to configure any IP reservation rules before you create any subnets. If you add rules later on, they may not work properly!
Read about rules reservation here.

Create Subnet

To begin, add a new IP addresses subnet, press 'Create New Subnet' button.
IPM2 8.png
Use 'Classless Inter-Domain Routing (CIDR)' notation to add subnets.

First of all, select IP version: IPv4 or IPv6, type the subnet IP address and a correct bitmask.
Correct ranges:

  • IPv4 - 1 to 32
  • IPv6 - 1 to 128

Note: The first IP from the subnet should be compatible with CIDR notation.

IPM2 9.png
You can exclude any number of IP addresses from the subnet.

To do so, enter them into 'Excluded IP Addresses:' textarea, one IP address or IP range per line.

IPM2 10.png
If you want to set nameservers and gateway click on 'Toggle Advanced Settings'.

Enter nameservers and gateway address into textboxes as shown on the screen below (This step is optional).
Afterwards, confirm the creation of the subnet through pressing 'Add Subnet' button.

IPM2 11.png

Available IP Subnets And Child Subnets

Once you have added some IP subnets you can preview some details on them and manage the IP addresses.

As you can see on the following screen, you can find here a list of subnets in a tree view. Press any of added IP subnets to see its details.

IPM2 13.png


To view subnet's details press on its address as shown on the following screen.
IPM2 14.png
In 'Subnet ' field, you can find information about the address, mask, size, nameservers, gateway and many others.
IPM2 15.png


The most important functions of your IP Manager For WHMCS include some actions that can done on subnets.
  • Delete - use it to remove the subnet together with any IP address in it (if there are such already).
  • Split - select split to divide the subnet into equal subnets according to the chosen mask. Keep in mind that the subnet may already include some assigned IP addresses.
    If you split such a subnet, the assigned IPs might be transferred to another subnet.
  • Merge - use this option if you want to join previously split subnet. Note that you can merge only parallel subnets.
    Additionally, you must remember that merge action removes IP addresses from external servers.
  • Create Child Subnet - this option allows to create subnet within a 'parent' subnet.
    Such s child subnet may again be slit/merged, have its own child subnets.
IPM2 17.png

Excluded IP Addresses

List of excluded IP addresses. You can remove some addresses from the list or add new ones.

Important! If you have any IP reservation rules set up, then do not include singe IP addresses here. This option should be used as an addition if you do not use rules.

IPM2 18.png

Custom Fields

IP Manager allows you to add custom fields per subnet.

To add a new custom field, press 'Create New Custom Field'. Afterwards, fill out the form with custom field name and value.
Again, this option should be used if you do not specify default custom fields or if you want to add some additional ones. Be careful not to double custom fields here.

IPM2 19.png

Assigned Client/Service

If you wish to assign an IP subnet to a client or specific service, our module makes it available to you.

You can achieve that through using auto-complete textbox to choose the client and/or service. Again, remember to 'Save Changes'.
IP addresses will be added to all products ordered by client.
IP addresses will be added to all addons included in products.

IPM2 20.png
Keep in mind that a subnet that is assigned to a client is reserved for this client only.

While IP addresses are assigned to a client, the following aspects are taken into consideration (in this order):

  • subnets assigned to a hosting
  • subnets assigned to a client
  • subnets assigned to configuration.

IP Addresses List

The easiest possible way of creating IP addresses within the created subnet.

Simply select the number of IP addresses you want to create and press 'Add IP Address' button. New address in the subnet will be generated.

IPM2 21.png
You may also add an IP address manually. To do so, press 'Add Custom IP' button.
IPM2 21 1.png
Type in the IP address you wish to be created.
IPM2 21 2.png
Once the addresses are generated, you can proceed to their assignment.

Use action buttons to do do so.

IPM2 22.png

Assign Single IP Address

You are now redirected to a page where you can assign this specific IP address to a service by entering a domain or a username,
using 3rd party integration module or custom assignment.
IPM2 23.png
Choose the method you wish to use and save the changes.
IPM2 24.png
As you can see, IP address is assigned to the selected previously service (related to chosen domain).
You may always unassign this IP from this service and again assign it to another one, delete the IP address, create custom field for this single address.
IPM2 25.png

Tree View

To clarify, a comfortable tree view of your created subnets and child-subnets is available. Let's take a look at it to summarize the divisions.
IPM2 26.png
You can see here a list of all subnets and child subnets in your IP Manager. Subnets marked with red already have some child subnets created, press any to show the list of child subnets.
Accordingly available actions change.
IPM2 27.png
Any subnet can have child subnets created (with IP reservation rules taken into consideration) and custom fields assigned.
IPM2 28.png
Child subnets, however, can again have their child subnets created, can be split, merged or deleted.

You may also manually exclude some IP addresses from a child subnet, assign clients and services directly to it and finally manage single IP addresses in such subnet.


Show Settings

Module Settings

Below, you can find description of each option.
  • Assignment Process Settings
    1. For any configuration you provide into this field, 'Dedicated IP' field will be omitted.
    2. If checked, additional IP addresses will be stored in a custom field or 'Assigned IPs' field.
    3. If checked, in case of a server provisioning failure, relation will be saved.
    4. Automatically process the IP address when downgrading the configurable option.
    5. Module ignores error message from an external server and continues the action.
  • IP Logs Settings
    1. IP addresses without product or user will not be displayed in 'IP Logs' page.
  • IP Reservation Settings
    1. If you check this checkbox, you will allow to add IP reservation rules.
  • Email Reminder Settings
    1. If you check this checkbox, you will receive an email with notification about IP subnets running out of IP addresses.
    2. Enables you to define percentage value which, when exceeded by any subnet, results in a notification being sent.
IPM2 31.png

IP Addresses Cleaner

IP Addresses Cleaner allows you to restore/remove IP addresses form WHMCS/IP Manager/both depending on chosen settings.
  • IP Addresses Cleaner Settings
    1. IP address are added to hosting if relation exists.
    2. IP address' relation are removed if IP address is not assigned to any hosting.
    3. If IP address does not exist in any subnet, it is removed from hosting.
    4. Create IP address' relation if it does not exist.
    5. If IP address does not exist in any subnet, it is removed from relations.
    6. Set IP address as unassigned if its relation does not exist.

Important: After making any changes in those settings, press 'Update Settings'.
Otherwise, settings will not be saved and the Cleaner will run using old ones.

IPM2 32.png
IP Addresses Cleaner allows you to automatically find and fix broken IP addresses assignment.

For example, when you manually remove a product with IP addresses assigned or remove an IP subnet.
To start IP Addresses Cleaner, press 'Perform Cron Cleanup' .
Actions issued by the cleaner are listed in a popup as shown on the following screen.

IPM24 6.png

IP Reservation

You can automate the process of IP assignment by adding some rules that will be then executed while assigning IP addresses from a subnet to clients or services.

'IP Reservation' rules can be configured under 'Settings' section.

IPM2 34.png
Use the rules consciously because they will be then taken into consideration while assigning any IP from any subnet in your IP Manager.

Like it is stated in the guide visible on the screen you must stick to some standards while personalizing your assignment process.
Press 'Add New Rule'.

IPM2 35.png

New Rules

To add a new rule, type in the required value in the 'Rule' field and describe it in the text box nearby.

To illustrate:
Enter n in the 'Rule' textarea. Then the first IP address from a subnet will be always excluded. It will be reserved and it will not be assigned to any client or service.

IPM2 36.png
You can add more that one rule. If you do it thoughtfully, you will have much less work later on while creating new subnets because
customized rules will substitute the need to fill out the 'Excluded IP Addresses' area.
IPM2 37.png

Default Custom Fields - Subnets

In this section ('Settings' → 'Default Custom Fields - Subnets') you are allowed to add and configure some custom fields that will be assigned to subnets by default.
IPM2 42.png
All you need to do is enter the name of your custom field, its value and save changes.
IPM2 43.png
Surely, you can create plenty of such custom fields and edit/remove the already existing.
IPM2 44.png

Default Custom Fields - IPs

Section 'Default Custom Fields - IPs' allows adding default custom fields per IP address within selected subnet.
Press 'Add New Default Field' to begin.
IPM2 44 1.png
Select subnet, the single IP addresses in which will have the field assigned. You may point single subet or select all existing subnets.
Then, type in the custom field name and value.
IPM2 44 2.png
You can create plenty of such custom fields and then edit/remove the already existing.
Keep in mind that if a custom field is assigned to all subnets, then action conducted on a custom field in a single subnet is triggered on all the other subnets!
IPM2 44 3.png

IP Assignment Mechanism

It is crucial to understand mechanism of automatic IP addresses assignment. In this section we will clarify it to you.

'IP Quantity' field defines the quantity of IP addresses added to the ordered product by triggering a specific relation.
Two and more relations from one configuration can be triggered for the same product (therefore, multiple quantity of IP addresses can be assigned).
Additionally, if you set up two configurations with the same relation, IP addresses from both configurations will be added.
Therefore, if you set up these two configurations in IP Manager:

  • Configuration 1: Addon A (IP Quantity = 2), Product C (IP Quantity = 1)
  • Configuration 2: Addon A (IP Quantity = 2), Addon B (IP Quantity = 2), Product D (IP Quantity = 3)

Orders listed below will trigger different relations:

  • Order 1: Product C with addon A: 5 IP addresses assigned
  • Order 2: Product C with addon B: 3 IP addresses assigned
  • Order 3: Product D with addon A: 7 IP addresses assigned
  • Order 4: Product F with addon A: 4 IP addresses assigned

Automatic IP Assignment

The main reason, why this module has been created, was to automate IP addresses assignment.

Here we will show you how to set up its configuration. In order to start, go to 'Configuration' 'Create Configuration'.
Type your configuration name, press textboxes corresponding to options you wish to add and select them from dropdown menus:

  • Products
  • Addons
  • Servers
  • Config Options

Afterwards, press 'Create New Configuration' button. On the screen below you can see sample configuration with two products selected.

IPM2 45.png
Now you have to assign at least one subnet to configuration. Use 'Assigned Subnets' button.
IPM2 46.png
Choose a subnet from a dropdown menu and press 'Assign Subnet' button.

Keep in mind that you can assign multiple subnets to a single configuration.

IPM2 47.png
See the list of subnets assigned to your configuration.
  • Press Subnet address to see its details
  • Manage additional Information: nameservers, gateway
  • Check usage
  • Remove subnet from the list
IPM2 47 1.png
On pressing subnet address you will be moved to its details. There you can manage single IP addresses that are created within this subnet.
IPM2 47 2.png

Advanced Configuration

Let's say, that you want to set multiple IP assignment to specific product, it is available with our module!

Here we will show you how to set up multiple IP addresses assignment to configurable option 'Extra IP Addresses'.
Create a new configuration as while setting up a standard configuration.
Once it is done press 'Configurable Options' as shown on the screen below.

IPM2 48.png
Afterwards, mark checkboxes next to configurable options you want to assign IP addresses to.

Enter quantity of IP addresses which will be assigned to each configurable option and press 'Save Changes'.

IPM2 49.png

Usage Statistics

In each configuration you can find a graph, which shows the statistics of IP addresses assignment.
IPM2 50.png

3rd Party Integration

In this tab you can set up 3rd party integration which allows you to manage IP through our module in your WHMCS and synchronize changes on 3rd party servers.

Note 1: Some of these integration submodules require free IP subnets (cPanel) or IP addresses (Plesk) on servers to be set up.
Note 2: IP Manager can integrate multiple IP addresses with a single product.

IPM2 50 1.png

Enabling 3rd Party Integration

Activation of all integration modules looks similar, there is only a difference in cPanel and cPanel Extended integration submodules.

Start by pressing 'Activate' button next to a module you want to activate.

IPM2 51.png
Press 'Configure' button and assign configurations to it.

Confirm through clicking 'Save Changes'.

IPM2 52.png
cPanel and cPanel Extended additionally allow you to choose the method of the integration.
  • Creates a DNS zone for each IP address assigned to a product.
  • The first IP address assigned to a product is set up as a site dedicated IP address.
IPM2 53.png
As you can see on the following screen, you can easily check the quantity of configurations assigned to each 3rd party integration.
IPM2 54.png

Integration With Proxmox VPS/Cloud For WHMCS

Integration with Proxmox VPS For WHMCS & Proxmox Cloud For WHMCS are the only integrations which are set up on both IP Manager For WHMCS and integrated module sides.

Due to that, setting up the integration consists of 3 steps:
1. Create IP addresses subnet which will be used for product.
2. Create configuration and assign a previously created subnet to it. No additional action is required in this step.
Important: Assigning anything beyond the subnet to the configuration in IP Manager For WHMCS may cause unexpected effect in your WHMCS environment.

Integration With SolusVM Extended VPS For WHMCS

Integration with SolusVM Extended VPS For WHMCS is tricky.

IP Manager For WHMCS cannot inject the first IP address to VPS, due to the way SolusVM API works.
After creation of VPS, IP Manager is able to add additional IP addresses.
Therefore, if you are using this integration, we advise setting up IP Manager synchronization as a cron job.

Test Integration Module

This module logs information about IP processing for 'Autorelease' type products.

Your order should look similar to the one on the screen below.
Note: You need to set up 'Autorelease' type server, otherwise logs will not show up.


Creation of Integration Submodule

You can create your own integration, all you need is knowledge of PHP programming language.

You can do it through using 'Autorelease' submodule file.
1. To begin, make copy of 'AutorelaseIntegration.php' located in 'your_whmcs/modules/addons/IPM2_anager2/app/modules'.

2. Rename copy to your new submodule name.

Note: File name has to end with 'Integration', for example 'NewSubmoduleIntegration.php'.

3. Edit the file, start by entering basic settings.
1. Class name should be the same as the file name.
2. Submodule name visible in IP Manager.
3. Submodule description displayed in IP Manager.
4. Place here an integrating module name ( the best way is to copy a folder name of the module ).
4. Now, it is time to implement integration part, you will need integrated module documentation to do that.
1. Configuration of 3rd party integration submodule.
2. Code assigning IP address to module product goes here.
3. You can add a code to unassign IP address here.
4. In order to view a submodule you have just created, log in to your WHMCS and go to 'Addons' 'IP Manager' '3rd Party Integration'.
IPM2 56.png


You can export your subnets with IP addresses to CSV and XML files.

To export, go to 'Export' tab, choose subnet to export and output format.
Now you can 'Generate' the file. Download of the file will start shortly.
Note: Your 'storage' folder located in 'your_whmcs/modules/addons/IPM2_anager2' should have chmod set to 755.

IPM2 62.png


In 'Import' tab you can find tools to synchronize IP addresses from your WHMCS as well as import them from a file.

Synchronization will confirm relations in your system with relations in IP Manager subnets.

  • IP address is used by a product, but inside of IP Manager subnet it is marked as unassigned - record inside of a subnet will be updated.
  • IP address is used by a product, but does not exist in any IP Manager subnet - a new subnet will be created.

There are three available cron commands:
1. This cron command synchronizes all products (it will require confirmation).
2. This cron command synchronizes all products (it will not require any confirmation).
3. This cron command synchronizes only products which IDs have been provided as arguments separated by comma.
To import IP addresses from a file, select it, choose its format and press 'Import'.

IPM2 63.png

IP Logs

'Logs' page stores the history of actions ordered on each IP address.
IPM2 64.png

Integration Code

Integration described below is not obligatory.

Module allows your customers to view IP addresses assigned to their product and order additional ones.
To enable it, follow these simple steps:

Integration in WHMCS V6

IPM2 65.png
Correctly placed code is presented on the following screen.
IPM2 66.png
In the client area it should look like on the screen below.
IPM2 67.png

Integration in WHMCS V5

IPM2 68.png
Correctly placed code is presented on the following screen.
IPM2 69.png
In the client area it should look like on the screen below.
IPM2 70.png
To allow your customers to buy a new IP address you need to set up a product addon for product and assign the addon to a configuration in IP Manager.
The above described integration works for all products without exception.
However, in case you wish to restrict the integration to limited number of products, please insert the below codes instead of the one suggested in the addon.

{if $moduleclientarea}
  <div class="moduleoutput">;{$moduleclientarea|replace:'modulebutton':'btn'}
  {if $pid == 26 || $module ==  'proxmoxCloud' || $module == 'proxmoxVPS'}

Once such code is inserted in the template, IP Manager will be displayed for product with ID that equals 26 or if the product is based on 'proxmoxCloud/proxmoxVPS' modules.
Extend the IP Manager integration according to your needs. The above code is just an example which can undergo modifications.

Client Area

Your clients can view and manage their IP addresses and subnets thanks to installed IP Manager For WHMCS module.

To remove any IP address or subnet from a product, simply press 'Unassign' button.

IPM2 71.png
Your client can also order a new IP address.

Press 'Order Additional IP Addresses' as shown below.
Your client will be moved to order form containing previously configured addons.

IPM2 72.png
As soon as the addon is active, new IP address is granted.

Add IP via Addon

Setting up an addon allows your client to add an IP address to their product using integration.

Go to 'Setup' 'Products/Services' 'Product Addons' and press 'Add New Addon' .

IPM2 74.png
Afterwards, enter addon name, addon description and select applicable products.

Set pricing for addon by choosing 'Billing Cycle' and typing price.
Confirm through pressing 'Save Changes' button.

IPM2 75.png
Now, go to 'Addons' 'IP Manager' and use configuration created before or create a new one.

Remember to add a previously created addon as a configuration relation.
You can do it by pressing 'Addon' button as shown on the following screen.

IPM2 76.png
Tick checkbox next to addon and enter the quantity of IP addresses to be added.

Afterwards, click 'Save Changes' button.

IPM2 77.png
If you enabled integration for the client area, your client should be able to order new IP addresses.

Management of Custom Hooks

Our module allows you to use custom hooks. All you have to do is create some functions using PHP programming language.

Here you can see possible hooks:

before_ip_assign_hook($ip, $serviceid, $relation, $configid)
after_ip_assign_hook($ip, $serviceid, $relation, $configid)
before_ip_integrating_hook($ip, $service, $server)
after_ip_integrating_hook($ip, $service, $server)
before_ip_disintegrating_hook($ip, $service, $server)
after_ip_disintegrating_hook($ip, $service, $server)
To find details about hooks read 'custom_hooks.php' file.

You can find there all hooks, information about their time of run, returned values and parameters.
For example, if you want to throw message to activity log after IP address assignment find hook 'after_ip_assign_hook($ip, $serviceid, $relation, $configid)' and type:

Logger::factory()->log('Custom hook was triggered');

It should look like on the screen below:

IPM 59.png

How To Update

In order to upgrade your module, follow Modules Update article.


1. If your client orders a product that is combined with two configurations (e.g. by product type and configurable option), IP Manager will add IP addresses from both configurations.
2. If you have used IPv6 block before the update to IP Manager 2.2.0, all of them will be migrated to corresponding subnets. Note that migration is done automatically for you.

Common Problems

1. When you have problems with connection, check whether your SELinux or firewall does not block ports.
2. If you see something like this when moving to 'Addon' 'IP Manager', remove content of 'template_c' folder.
IPM 60.png
3. If you export file and it is empty, check your 'Storage' folder chmod, it should be set to 755. Folder is located in 'your_whmcs/modules/addons/IPM2_anager2' .

If you still have that problem, set chmod 777.

Personal tools

WHMCS Modules
cPanel Modules
Magento Extensions
Magento Themes
PrestaShop Modules
Blesta Extensions
IP Manager For WHMCS