PUQ Mautic

Mikrotik VPN WHMCS module

The module is intended as an opportunity for IT companies to expand their offer for customers by offering paid VPN accounts. After installation, the module will fully manage the creation, edition, and suspension of VPN accounts and interact with the WHMCS billing system, exchanging data needed for settlements with customers, activations or service blocking. Initial assumptions: the company uses WHMCS and owns or is able to install Mikrotik routers. Mikrotik routers are necessary to provide VPN service (managing Mikrotik secrets users). WHMCS is necessary to manage the VPN service.

Description

 Order now | Dowload | FAQ
The module, fully installed and correctly implemented in the system, offers the following functionalities.

Module Functions:

Available options in the admin panel:

Available options in the client panel:


WHMCS minimal version: 8 +

Mikrotik minimal version:  7 +

The settings of the whmcs module when it comes to upload and download speeds register the opposite values in the mikrotik router (e.g. download speed in whmcs 1mb = upload speed in mikrotirk 1mb). This is due to the fact that from the point of view of Mikrotik, the traffic is incoming, and from the point of view of the VPN client, this is outgoing traffic.

Please be aware that to ensure proper functionality of VPN connections, it is essential for you, as an administrator, to correctly configure the Mikrotik router. This entails configuring NAT, Firewall, routing, and all the required settings for VPN to operate correctly on your router.

 

image-1659960355259.png

image-1659960384599.png

image-1659960403402.png

Changelog

 Order now | Dowload | FAQ
v1.3.5 Released 11-10-2023
  1. Support WHMCS v8.8.0
  2. Translations added/updated (Arabic, Azerbaijani, Catalan, Chinese, Croatian, Czech, Danish, Dutch, English, Estonian, Farsi, French, German, Hebrew, Hungarian, Italian, Macedonian, Norwegian, Polish,  Romanian, Russian, Spanish, Swedish, Turkish, Ukrainian)

v1.3 Released 04-02-2023
  1. Changed client side. Added intuitive icons.
  2. Better code adaptation for PHP 8.1
  3. Bug fixed (Attempt to assign property "bytes_upload" on string in...puqMikrotikVPN.php:632)

v1.2 Released 04-01-2023
  1. Support WHMCS V8.6
  2. Support IonCube PHP Loader v12 
  3. Support for PHP 8.1
  4. Changes made to templates
  5. Added the ability to select the frequency of collecting traffic statistics. Daily cron and per cron
  6. The method of collecting statistics has been changed. After each collection of statistics, the counters on Mikrotik are reset to zero.
  7. In the service settings, the choice of email template was changed to a drop-down menu.

v1.1 Released 28-10-2022
  1. Changes in design in the client area.
  2. Added translations, Ukrainian, Persian
  3. Changed the selection of the ppp secrets profile from text to a drop-down menu with a choice of spend, in the product configuration

v1.0 Released 01-08-2022

First version

Installation and configuration guide

Installation and configuration guide

WHMCS setup(install/update)

 Order now | Dowload | FAQ

To install and update a module, you must perform one and the same action.

1. Download the latest version of the module.

PHP 8.1

wget http://download.puqcloud.com/WHMCS/servers/PUQ_WHMCS-Mikrotik-VPN/PUQ_WHMCS-Mikrotik-VPN-latest.zip

PHP 7.4

wget http://download.puqcloud.com/WHMCS/servers/PUQ_WHMCS-Mikrotik-VPN/php74/PUQ_WHMCS-Mikrotik-VPN-latest.zip

 

All versions are available via link: http://download.puqcloud.com/WHMCS/servers/PUQ_WHMCS-Mikrotik-VPN/

2. Unzip the archive with the module.
unzip PUQ_WHMCS-Mikrotik-VPN-latest.zip 
3. Copy and Replace "puqMikrotikVPN" to "WHMCS_WEB_DIR/modules/servers/"
 
Installation and configuration guide

Setup guide: Mikrotik preparation and configuration

 Order now | Dowload | FAQ

Note: Enter the following commands one by one and wait for the command to complete.

I. Check RouterOS version

Make sure that the version of RouterOS is 7+

system/package/print 
 
II. Enabling HTTPS Create your own root CA on your router
/certificate
add name=LocalCA common-name=LocalCA key-usage=key-cert-sign,crl-sign
 
III. Sign the newly created CA certificate
/certificate
sign LocalCA
 
IV. Create a new certificate for Webfig (non-root certificate)

Note: as common-name=XXX.XXX.XXX.XXX You enter public IP adddress of the router.

/certificate
add name=Webfig common-name=XXX.XXX.XXX.XXX
 
V. Sign the newly created certificate for Webfig
/certificate
sign Webfig ca=LocalCA 
 
VI. Enable SSL (www-ssl) and specify to use the newly created certificate for Webfig
/ip service
set www-ssl certificate=Webfig disabled=no
 
VII. Enable api-ssl and specify to use the newly created certificate for Webfig
 /ip service 
 set api-ssl certificate=Webfig disabled=no 
 
VIII. Enable VPN server

To enable the VPN server

image-1666164439793.png

 

Installation and configuration guide

Setup guide: WHMCS preparation and configuration

 Order now | Dowload | FAQ
1. Download the latest version of the module.

PHP 8.1

wget http://download.puqcloud.com/WHMCS/servers/PUQ_WHMCS-Mikrotik-VPN/PUQ_WHMCS-Mikrotik-VPN-latest.zip

PHP 7.4

wget http://download.puqcloud.com/WHMCS/servers/PUQ_WHMCS-Mikrotik-VPN/php74/PUQ_WHMCS-Mikrotik-VPN-latest.zip

 

All versions are available via link: http://download.puqcloud.com/WHMCS/servers/PUQ_WHMCS-Mikrotik-VPN/

2. Unzip the archive with the module.
unzip PUQ_WHMCS-Mikrotik-VPN-latest.zip 
3. Copy "puqMikrotikVPN" to "WHMCS_WEB_DIR/modules/servers/"
4. Create new server Mikrotik in WHMCS (System Settings->Products/Services->Servers)
System Settings->Servers->Add New Server

image-1659960751104.png

image-1659961088379.png

5. Create a new Products/Services
System Settings->Products/Services->Create a New Product

In the Module settings section, select the "PUQ mikrotik VPN" module

image-1659962653210.png

 

 

 

Installation and configuration guide

Add server (router Mikrotik) in WHMCS

 Order now | Dowload | FAQ
Add a new server to the system WHMCS.
System Settings->Servers->Add New Server

Name is just for Your convenience and You can put there anything You like ie: Mygreat mikrotik routr

You can choose whatever hostname You want. Valid entries look similar to: vpn.mydomain.com, ourgreatvpn.mydomain.net. You can also dedicate whole domain ie: myVPNservices.com if You like. The important  thing is to resolve the choosen IP address of the Mikrotik router in DNS server for Your domain.

image-1659960751104.png

 

image-1659961088379.png

 

Installation and configuration guide

Email Template (puqMikrotikVPN notification traffic limit)

 Order now | Dowload | FAQ
Create an email template for customer notifications.
System Settings->Email Templates->Create New Email Template

image-1659961684807.png

 

Subject: 

Traffic less than {$notification_traffic_remainder} GB - {$username}

Body:

Dear {$client_name},

This letter informs you that the traffic limit of the service is coming to an end.

Product/Service: {$service_product_name}
Due Date: {$service_next_due_date}


Username: {$username}
Left traffic: {$traffic_balance_gb} GB
After renewing the service, {$traffic_billingcycle_gb} GB will be automatically added.


{$signature}

 

image-1659961895731.png

Installation and configuration guide

Email Template (puqMikrotikVPN Suspension Notification traffic limit)

 Order now | Dowload | FAQ
Create an email template for customer notifications.
System Settings->Email Templates->Create New Email Template

image-1659962061891.png

 

Subject: 

Suspension Information - {$username}

Body:

Dear {$client_name},

This letter informs you that the VPN account has been suspended due to traffic exhaustion.
The traffic limit will be restored from the next service cycle.
It is also possible to switch to a package with a large amount of traffic.

Product/Service: {$service_product_name}
Due Date: {$service_next_due_date}


Username: {$username}
Left traffic: {$traffic_balance_gb} GB
After renewing the service, {$traffic_billingcycle_gb} GB will be automatically added.


{$signature}

 

 

image-1659962121935.png

Installation and configuration guide

Product Configuration in WHMCS

 Order now | Dowload | FAQ
Add new product to WHMCS
System Settings->Products/Services->Create a New Product

In the Module settings section, select the "PUQ mikrotik VPN" module

image-1672836812135.png

 

Installation and configuration guide

Product Addons Configuration in WHMCS

 Order now | Download | FAQ
In order to provide customers with the opportunity to purchase additional traffic, use Product Addons

Create new Product Addons in the WHMCS system.

System Settings->Product Addons->Add New Addon

image-1659964339183.png

 

Client Area

Here is a brief summary of the options available in the customer panel

Client Area

Home screen

 Order now | Download | FAQ

The end customer, after logging in to his own customer panel, has access to the following information and options:

Screenshot view when the service is offline

image-1659955934216.png

Screenshot view when the service is online

image-1659956293979.png

Screenshot view when the account is blocked

image-1659957830311.png

 

Client Area

Email notification

 Order now | Download | FAQ
Below you can see an example of an email notification regarding exhausted traffic limit
image-1659958322599.png
Below you can see an example of an email notification regarding suspension Information

image-1659958342520.png

Client Area

Traffic statistics

 Order now | Download | FAQ

Traffic statistics shows the customer's traffic on a daily basis, broken down into incoming and outgoing.

Traffic usage statistics is available in the menu item "Traffic statistics"

image-1659958539654.png

Traffic Usage Charts

image-1659958453921.png

 
Traffic usage table

image-1659958484076.png

Client Area

Traffic added history

 Order now | Download | FAQ

A user who has exceeded the purchased transfer limit may purchase additional traffic. In this tab you can track purchases made for additional traffic.

Statistics of adding traffic is available in the menu item "Traffic added history"

image-1659958760497.png

 
A table that shows the dates and the amount of added traffic

image-1659958789976.png

Client Area

Buy additional traffic

 Order now | Download | FAQ

A user who has exceeded the purchased transfer limit may purchase additional traffic. In this tab you can track purchases made for additional traffic.

image-1659959431756.png

After selecting the desired item and pressing the "Order Now" button.
The customer is transferred to the cart for payment.

image-1659959527920.png

After you successfully purchase an additional transfer, the limit is updated on a regular basis.

image-1659959712093.png

 

Admin Area

Admin Area

Product Information

 Order now | Download | FAQ
Product Information Screen

 

Normal service state

image-1659959951911.png

Limited service with limited traffic

image-1659960049432.png