WHMCS IP Address Module Integrated with MikroTik

WHMCS IP Address Module Integrated with MikroTik

Cancelled

Job Description

The idea behind this module is to create a public IP address on a MikroTik router.

Information is collected from the WHMCS add-ons table and then fed to the router. In order to communicate with WHMCS you need to use either their API or directly attach to their MySQL. In order to talk to the MikroTik router you need to understand their API to send commands and receive responses. We have most of this code to talk to a MikroTik router so we will share it if needed.

The successful respondent must have access to their own MikroTik router and a working installation of WHMCS. We might be able to provide this, but our ideal candidate has the skills to set up this test environment already.

If you understand the following workflow this job is for you:

Create new IP address Module

* Read WHMCS Public IP Address Add-on value in WHMCS
** Get public IP address
** Get private IP address
*** Make sure IP address is in range 196.201.7.y. If not, abort. This 7.x must be configurable.
*** Make sure private IP is in range 172.17.x.y. If not, abort. This 17.x.y must be configurable.
* Hook into MikroTik router with API
** Read `/ip address` to see if IP address already exists, if so, abort
** Read ‘/ip firewall address list’ to see if IP address already exists, if so, abort
** Read ‘/ip firewall nat’ to see if IP address already exists, if so, abort
* Create new IP firewall nat entries using MikroTik API like so:
** /ip firewall nat add chain=dstnat action=dst-nat to-addresses=172.17.x.y dst-address=196.201.7.y
** /ip firewall nat add chain=srcnat action=src-nat to-addresses=196.201.7.y src-address=172.17.x.y out-interface=ether09_saix_public
*** out-interface must be configurable