PUQ Mautic

Mikrotik WireGuard VPN WHMCS module

The module is intended as an opportunity for IT companies to expand their offer for customers by offering paid WireGuard VPN accounts. After installation, the module will fully manage the creation, edition, and suspension of WireGuard 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. WHMCS is necessary to manage the WireGuard VPN service.

Changelog

Mikrotik WireGuard VPN module WHMCS 

 Order now | Download | FAQ
v2.0 Released 23-09-2024

Module is coded ionCube v13

Supported php version:


v1.3 Released 29-07-2024
  1. Add metric pricing for incoming/outgoing traffic

v1.2 Released 17-06-2024
  1. Added VPN interface reboot function (to reset a frozen connection)
  2.  Improved adaptation to the mobile version of the client area
  3. Some changes in translations

v1.1 Released 15-12-2023
  1.  Added functionality for changing packages
  2.  Minor changes to the admin/client interface

v1.0 Released 09-10-2023

First version

Description

Mikrotik WireGuard VPN module WHMCS 

 Order now | Download | 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-1718674399683.png

image-1718674446162.png

 

 

Installation and configuration guide

Installation and configuration guide

WHMCS setup(install/update)

Mikrotik WireGuard VPN module WHMCS 

 Order now | Download | FAQ

Module is coded ionCube v13

Supported php version:

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

1. Download the latest version of the module.

PHP 8.2

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

PHP 8.1

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

PHP 7.4

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

 

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

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

Setup guide: Mikrotik preparation and configuration

Mikrotik WireGuard VPN module WHMCS 

 Order now | Download | 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. Creating a WireGuard Server

To enable the WireGuard VPN server

image-1696799204553.png

 

Installation and configuration guide

Add server (router Mikrotik) in WHMCS

Mikrotik WireGuard VPN module WHMCS 

 Order now | Download | 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-1696799390979.png

 

Installation and configuration guide

Product Configuration in WHMCS

Mikrotik WireGuard VPN module WHMCS 

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

In the Module settings section, select the "PUQ Mikrotik WireGuard VPN" module

image-1722265357892.png

 
Metric Billing


It is also possible to set up tariffs for incoming and outgoing traffic.
Standard methods for setting up metrics

Bandwidth Usage In 

image-1722265426121.png

Bandwidth Usage Out

image-1722265560672.png

 

Client Area

Client Area

Home screen

Mikrotik WireGuard VPN module WHMCS 

 Order now | Download | FAQ

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

image-1718674714891.png

image-1718674744368.png

image-1718674774642.png

image-1718674628028.png

image-1718674676540.png

 

Admin Area

Admin Area

Product Information

Mikrotik WireGuard VPN module WHMCS 

 Order now | Download | FAQ
Product Information Screen

image-1722265201698.png