# Mikrotik VPN WHMCS module

# Description

### Mikrotik VPN module **[WHMCS](https://puqcloud.com/link.php?id=77)**

##### [Order now](https://panel.puqcloud.com/index.php?rp=/store/whmcs-module-mikrotik-vpn) | [Download](https://download.puqcloud.com/WHMCS/servers/PUQ_WHMCS-Mikrotik-VPN/) | [FAQ](https://faq.puqcloud.com/)

## Mikrotik VPN WHMCS module

The Mikrotik VPN WHMCS module is a provisioning module that integrates WHMCS with Mikrotik routers, enabling Internet and VPN service providers to offer VPN accounts to their customers. The module automates the full lifecycle of VPN account management using the Mikrotik API only.

- - - - - -

## Main features

- **Automatic account provisioning** — auto create and deploy client VPN accounts on the Mikrotik router upon order activation
- **Account lifecycle management** — create, suspend, unsuspend, terminate, change package, change password and reset connection for VPN accounts
- **Bandwidth control** — configurable download / upload speed limits (M/s) enforced by the Mikrotik PPP profile
- **Traffic limits &amp; post-paid billing** — configurable traffic quotas per billing cycle (One Time, Monthly, Quarterly, Semi-Annual, Annual, Biennial, Triennial) with post-paid traffic billing via standard WHMCS metrics
- **Traffic usage statistics** — daily incoming / outgoing traffic history with configurable retention period
- **Auto-suspension on traffic exhaustion** — the VPN account is automatically disabled on the Mikrotik router when the traffic balance reaches zero
- **Email notifications** — automatic notifications when remaining traffic falls below a configurable threshold and when the account is suspended due to traffic exhaustion
- **Multi-language support** — 25+ languages including 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
- **Client area integration** — customers can view the VPN server address, available protocols, credentials with copy-to-clipboard, connection status, bandwidth limit and traffic statistics
- **Admin area tools** — administrators can view license status, Mikrotik API connection status, product information and manage VPN accounts via standard WHMCS module buttons
- **IP address pool** — the module distributes IP addresses from the list specified in the WHMCS server settings; both private and public IPs are supported
- **Configurable protocol support** — independent toggles for PPtP and L2TP protocols, L2TP IPSec PSK key displayed in the client area
- **Instruction link** — optional URL to the VPN setup manual displayed as a button in the client area
- **License verification** — built-in license system with online / offline verification and admin alerts

- - - - - -

## System requirements

<table id="bkmrk-requirement-minimum-"><thead><tr><th>Requirement</th><th>Minimum</th></tr></thead><tbody><tr><td>WHMCS</td><td>9.x or higher</td></tr><tr><td>PHP</td><td>8.2 or higher</td></tr><tr><td>Mikrotik RouterOS</td><td>7.x or higher</td></tr><tr><td>ionCube Loader</td><td>v13 or newer (v14, v15)</td></tr></tbody></table>

> **Important:** The module registers opposite values for upload and download speeds in the Mikrotik router compared to WHMCS settings, because Mikrotik measures incoming traffic while VPN clients experience outgoing traffic. Proper Mikrotik router configuration is essential (NAT, firewall, routing, and all required VPN server settings).

- - - - - -

## Links

- **Product page:** [https://panel.puqcloud.com/index.php?rp=/store/whmcs-module-mikrotik-vpn](https://panel.puqcloud.com/index.php?rp=/store/whmcs-module-mikrotik-vpn)
- **Documentation:** [https://doc.puq.info/books/mikrotik-vpn-whmcs-module](https://doc.puq.info/books/mikrotik-vpn-whmcs-module)
- **Support:** [https://puqcloud.com/submitticket.php](https://puqcloud.com/submitticket.php?step=2&deptid=1)
- **Community:** [https://community.puqcloud.com/](https://community.puqcloud.com/)

- - - - - -

## Screenshots

### Client area — Home screen

![Client area home screen](https://doc.puq.info/uploads/images/gallery/2026-04/embedded-image-wnkt5xlf.png)*01-description-client-area.png*

### Client area — Traffic statistics

![Traffic statistics](https://doc.puq.info/uploads/images/gallery/2026-04/embedded-image-w5hhydza.png)*02-description-traffic-stats.png*

### Admin area — Product information

![Admin area product information](https://doc.puq.info/uploads/images/gallery/2026-04/embedded-image-rsbqerq3.png)*03-description-admin-area.png*# Changelog

### Mikrotik VPN module **[WHMCS](https://puqcloud.com/link.php?id=77)**

##### [Order now](https://panel.puqcloud.com/index.php?rp=/store/whmcs-module-mikrotik-vpn) | [Download](https://download.puqcloud.com/WHMCS/servers/PUQ_WHMCS-Mikrotik-VPN/) | [FAQ](https://faq.puqcloud.com/)

- - - - - -

## v3.1.1 (02-06-2026)

- **Full support for the latest RouterOS 7.21.4.** The module has been verified end-to-end against the newest Mikrotik firmware, so you can confidently run your VPN services on up-to-date, secure routers.
- **Rock-solid router communication.** Connections to your Mikrotik devices are now even more reliable — requests that could previously stall on certain firmware versions complete instantly, keeping provisioning and management fast and dependable.
- **Stay current with peace of mind.** Whether you are deploying brand-new routers or upgrading existing ones to the latest RouterOS, your VPN automation keeps working smoothly out of the box.
- **PHP 7.4 support is back.** The module runs flawlessly on PHP 7.4 once again, so customers on established hosting stacks can keep their proven setup without rushing a server upgrade. We will continue to support PHP 7.4 for as long as it remains technically possible.

- - - - - -

## v3.1 (20-04-2026)

- **Improved stability across the WHMCS admin area.** Rare page-loading errors that could appear on some admin screens (for example when opening a support ticket on installations with non-standard file layouts, symlinks or custom hosting paths) have been eliminated. The admin panel now loads smoothly in every environment.
- **Greater compatibility with complex hosting setups.** The module is now fully resilient to WHMCS installations using symlinked directories, multi-domain hosting and custom include paths.
- **Smoother day-to-day operation for administrators.** Fewer interruptions, no unexpected "Oops!" pages, and a more predictable experience when working with tickets, clients and services — so your team can focus on customers, not on troubleshooting.

- - - - - -

## v3.0 (01-02-2026)

- Support for WHMCS 9+
- Redesigned product module settings
- Updated client area interface design
- Remote ability to have traffic-based packages has been removed; instead, a post-paid traffic billing model has been implemented using standard WHMCS metrics

> **Note:** Product reconfiguration is required after update.

- - - - - -

## v2.2 (23-01-2025)

- The product configuration method has been redesigned
- Added a configuration option in the product settings to display custom HTML in the client panel based on the VPN protocol

> **Important:** After the update, all products using this module must be completely reconfigured.

- - - - - -

## v2.0 (23-09-2024)

- Module coded with ionCube v13
- Supported PHP versions: 7.4, 8.1, 8.2
- Compatible with WHMCS 8.11.0+
- Client area more adapted for mobile
- Copy-to-clipboard buttons added for login and password

- - - - - -

## v1.3.5 (11-10-2023)

- Support for WHMCS v8.8.0
- 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 (04-02-2023)

- Redesigned client side with intuitive icons
- Improved PHP 8.1 compatibility
- Bug fix: "Attempt to assign property bytes\_upload on string" in puqMikrotikVPN.php

- - - - - -

## v1.2 (04-01-2023)

- Support for WHMCS v8.6
- Support for IonCube PHP Loader v12
- PHP 8.1 support
- Template improvements
- Added configurable frequency for traffic statistics collection (daily cron and per cron)
- Traffic counters on Mikrotik are reset to zero after each statistics collection
- Email template selection changed from text input to dropdown menu

- - - - - -

## v1.1 (28-10-2022)

- Client area design improvements
- Ukrainian and Persian translations added
- PPP secret profile selection in product settings changed from text input to dropdown

- - - - - -

## v1.0 (01-08-2022)

- First release# Installation and Configuration Guide

Step-by-step instructions for installing, configuring, and setting up the Mikrotik VPN WHMCS module, including Mikrotik router preparation (RouterOS certificates, HTTPS and API-SSL, VPN server), WHMCS integration, email templates, server registration, and product configuration.

# WHMCS setup (install/update)

### Mikrotik VPN module **[WHMCS](https://puqcloud.com/link.php?id=77)**
#####  [Order now](https://panel.puqcloud.com/index.php?rp=/store/whmcs-module-mikrotik-vpn) | [Download](https://download.puqcloud.com/WHMCS/servers/PUQ_WHMCS-Mikrotik-VPN/) | [FAQ](https://faq.puqcloud.com/)

## System requirements

| Requirement | Minimum version |
|-------------|-----------------|
| **PHP** | 8.2 or higher |
| **WHMCS** | 9.x or higher |
| **Mikrotik RouterOS** | 7.x or higher |
| **ionCube Loader** | v13 or newer (v14, v15) |

> **Note:** The module uses ionCube encoding. Make sure ionCube Loader is installed and active on your server.

---

## Download

The module can be ordered and downloaded from PUQ Cloud:

- **Order / Download:** [https://panel.puqcloud.com/index.php?rp=/store/whmcs-module-mikrotik-vpn](https://panel.puqcloud.com/index.php?rp=/store/whmcs-module-mikrotik-vpn)
- **FAQ:** [https://faq.puqcloud.com/](https://faq.puqcloud.com/)
- **Direct download link for the latest version:**

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

> Older module versions for WHMCS 8 are available in PHP-specific directories:
> - PHP 7.4: [https://download.puqcloud.com/WHMCS/servers/PUQ_WHMCS-Mikrotik-VPN/php74/](https://download.puqcloud.com/WHMCS/servers/PUQ_WHMCS-Mikrotik-VPN/php74/)
> - PHP 8.1: [https://download.puqcloud.com/WHMCS/servers/PUQ_WHMCS-Mikrotik-VPN/php81/](https://download.puqcloud.com/WHMCS/servers/PUQ_WHMCS-Mikrotik-VPN/php81/)

After downloading, extract the archive:

```
unzip PUQ_WHMCS-Mikrotik-VPN-latest.zip
```

---

## Installation

### Step 1: Upload files

Extract the module archive and copy the `puqMikrotikVPN` directory to the WHMCS servers module directory:

```
WHMCS_WEB_DIR/modules/servers/puqMikrotikVPN
```

### Step 2: Add server

Navigate to **System Settings** → **Servers** → **Add New Server**:

1. Enter the correct **Name** and **Hostname**
2. In **Assigned IP Addresses**, enter the list of IPs to distribute to users
3. In Server Details, select the **PUQ Mikrotik VPN** module
4. Enter valid Mikrotik router credentials (username and password)
5. Click **Test connection** to verify

### Step 3: Create product

Navigate to **System Settings** → **Products/Services** → **Create a New Product**:

1. Select the **PUQ Mikrotik VPN** module in the Module settings section
2. Configure the product parameters

---

## Update

### Step 1: Backup

Before updating, it is recommended to back up:
- WHMCS database
- Module files in `modules/servers/puqMikrotikVPN/`

### Step 2: Upload new files

Download and extract the new version, then overwrite all files in:

```
WHMCS_WEB_DIR/modules/servers/puqMikrotikVPN/
```

### Step 3: Verification

1. Log in to the WHMCS admin panel
2. Check the module is functioning correctly
3. Verify product settings

> **Important (v3.0):** Product reconfiguration is required after updating to version 3.0. The traffic package model has been replaced with post-paid billing via WHMCS metrics.


<!-- sync:6c19db4f8621edcd -->

# Setup guide: Mikrotik preparation and configuration

### Mikrotik VPN module **[WHMCS](https://puqcloud.com/link.php?id=77)**
#####  [Order now](https://panel.puqcloud.com/index.php?rp=/store/whmcs-module-mikrotik-vpn) | [Download](https://download.puqcloud.com/WHMCS/servers/PUQ_WHMCS-Mikrotik-VPN/) | [FAQ](https://faq.puqcloud.com/)

This guide covers the preparation of a Mikrotik router for use with the PUQ Mikrotik VPN WHMCS module: root CA certificate, Webfig certificate, HTTPS, API-SSL and VPN server activation.

> **Note:** Enter the following commands one by one and wait for each command to complete before running the next.

---

## 1. Check RouterOS version

Ensure RouterOS version is 7.x or higher:

```
system/package/print
```

---

## 2. Create a root CA on the router

Enable HTTPS by creating your own local root Certificate Authority:

```
/certificate
add name=LocalCA common-name=LocalCA key-usage=key-cert-sign,crl-sign
```

---

## 3. Sign the root CA certificate

```
/certificate
sign LocalCA
```

---

## 4. Create a non-root certificate for Webfig

> Replace `XXX.XXX.XXX.XXX` with your router's public IP address (or the hostname you use to reach it).

```
/certificate
add name=Webfig common-name=XXX.XXX.XXX.XXX
```

---

## 5. Sign the Webfig certificate with the local CA

```
/certificate
sign Webfig ca=LocalCA
```

---

## 6. Enable HTTPS (www-ssl) with the Webfig certificate

```
/ip service
set www-ssl certificate=Webfig disabled=no
```

---

## 7. Enable API-SSL with the Webfig certificate

The PUQ Mikrotik VPN module communicates with the router through the **API-SSL** service:

```
/ip service
set api-ssl certificate=Webfig disabled=no
```

> **Important:** The module uses the Mikrotik API only. Make sure the API-SSL port is reachable from the WHMCS server.

---

## 8. Enable VPN server

Enable the VPN protocol(s) you plan to offer to clients (PPTP, L2TP, etc.) and configure the corresponding PPP profile, service and IP pool. The PPP profile name configured here will later be selected in the product settings on the WHMCS side.

![Mikrotik VPN server setup](https://doc.puq.info/uploads/images/gallery/2026-04/embedded-image-d62sok6d.png)
*16-mikrotik-setup.png*

---

## 9. Firewall, NAT and routing

Configure NAT, firewall and routing on the Mikrotik router so that VPN clients can reach the Internet and any internal resources you want to expose. The module itself only provisions the user account (PPP secret) — the surrounding network configuration is the responsibility of the router administrator.

> **Important:** The module registers opposite values for upload and download speeds in the Mikrotik router compared to the WHMCS product settings, because Mikrotik measures incoming traffic while VPN clients experience outgoing traffic.


<!-- sync:2a7f64d7660f5598 -->

# Setup guide: WHMCS setup

### Mikrotik VPN module **[WHMCS](https://puqcloud.com/link.php?id=77)**
#####  [Order now](https://panel.puqcloud.com/index.php?rp=/store/whmcs-module-mikrotik-vpn) | [Download](https://download.puqcloud.com/WHMCS/servers/PUQ_WHMCS-Mikrotik-VPN/) | [FAQ](https://faq.puqcloud.com/)

## System requirements

| Requirement | Minimum version |
|-------------|-----------------|
| **PHP** | 8.2 or higher |
| **WHMCS** | 9.x or higher |
| **Mikrotik RouterOS** | 7.x or higher |
| **ionCube Loader** | v13 or newer (v14, v15) |

> **Note:** The module uses ionCube encoding. Make sure ionCube Loader is installed and active on your server.

> Older module versions for WHMCS 8 are available in PHP-specific directories:
> - PHP 7.4: [https://download.puqcloud.com/WHMCS/servers/PUQ_WHMCS-Mikrotik-VPN/php74/](https://download.puqcloud.com/WHMCS/servers/PUQ_WHMCS-Mikrotik-VPN/php74/)
> - PHP 8.1: [https://download.puqcloud.com/WHMCS/servers/PUQ_WHMCS-Mikrotik-VPN/php81/](https://download.puqcloud.com/WHMCS/servers/PUQ_WHMCS-Mikrotik-VPN/php81/)

---

## Step 1: Download the module

```bash
wget https://download.puqcloud.com/WHMCS/servers/PUQ_WHMCS-Mikrotik-VPN/php82/PUQ_WHMCS-Mikrotik-VPN-latest.zip
```

---

## Step 2: Extract the archive

```bash
unzip PUQ_WHMCS-Mikrotik-VPN-latest.zip
```

---

## Step 3: Copy module files

Copy the `puqMikrotikVPN` directory to:

```
WHMCS_WEB_DIR/modules/servers/
```

---

## Step 4: Add server in WHMCS

Navigate to **System Settings** → **Servers** → **Add New Server**

1. Enter the correct **Name** and **Hostname**
2. In **Assigned IP Addresses**, enter the list of IPs that will be distributed to users
3. In the Server Details section, select the **PUQ Mikrotik VPN** module
4. Enter valid Mikrotik router credentials (username and password)
5. Click **Test connection** to verify the connection

![Add server - general settings](https://doc.puq.info/uploads/images/gallery/2026-04/embedded-image-injeplej.png)
*04-add-server-1.png*

![Add server - module settings](https://doc.puq.info/uploads/images/gallery/2026-04/embedded-image-rrlnzyut.png)
*05-add-server-2.png*

---

## Step 5: Create product in WHMCS

Navigate to **System Settings** → **Products/Services** → **Create a New Product**

Select the **PUQ Mikrotik VPN** module in the Module settings section.

![WHMCS product module settings](https://doc.puq.info/uploads/images/gallery/2026-04/embedded-image-o6xr27tg.png)
*06-whmcs-setup.png*


<!-- sync:d43a457a33b3d29e -->

# Email Template (puqMikrotikVPN notification traffic limit)

### Mikrotik VPN module **[WHMCS](https://puqcloud.com/link.php?id=77)**
#####  [Order now](https://panel.puqcloud.com/index.php?rp=/store/whmcs-module-mikrotik-vpn) | [Download](https://download.puqcloud.com/WHMCS/servers/PUQ_WHMCS-Mikrotik-VPN/) | [FAQ](https://faq.puqcloud.com/)

## Creating the email template

Navigate to **System Settings** → **Email Templates** → **Create New Email Template**

This template is used to notify the customer when the remaining traffic falls below the threshold configured in the product settings ("Notification traffic remainder less than X GB").

---

## Template configuration

| Parameter | Value |
|-----------|-------|
| **Email Type** | Product/service |
| **Unique Name** | puqMikrotikVPN notification traffic limit |

---

## Email subject

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

---

## Email 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}
```

---

## Available template variables

The following custom variables are passed to the email template by the module:

| Variable | Description | Example |
|----------|-------------|---------|
| `{$username}` | VPN account username | mikrotik-user-42 |
| `{$notification_traffic_remainder}` | Traffic threshold configured in product settings (GB) | 5 |
| `{$traffic_balance_gb}` | Remaining traffic balance for the customer (GB) | 4.2 |
| `{$traffic_billingcycle_gb}` | Traffic that will be added on the next billing cycle (GB) | 100 |

In addition, all standard WHMCS product/service merge fields are available (e.g. `{$client_name}`, `{$service_product_name}`, `{$service_next_due_date}`, `{$signature}`).

> **Note:** Notifications are sent automatically during the WHMCS cron execution when remaining traffic falls below the threshold configured in the product settings.

---

## Screenshots

![Email template creation](https://doc.puq.info/uploads/images/gallery/2026-04/embedded-image-5qihi70s.png)
*07-email-template-1.png*

![Email template configuration](https://doc.puq.info/uploads/images/gallery/2026-04/embedded-image-n5725aro.png)
*08-email-template-2.png*


<!-- sync:13bdee8824b9fa41 -->

# Email Template (puqMikrotikVPN Suspension Notification traffic limit)

### Mikrotik VPN module **[WHMCS](https://puqcloud.com/link.php?id=77)**
#####  [Order now](https://panel.puqcloud.com/index.php?rp=/store/whmcs-module-mikrotik-vpn) | [Download](https://download.puqcloud.com/WHMCS/servers/PUQ_WHMCS-Mikrotik-VPN/) | [FAQ](https://faq.puqcloud.com/)

## Creating the email template

Navigate to **System Settings** → **Email Templates** → **Create New Email Template**

This template is used to notify the customer that the VPN account has been **suspended on the Mikrotik router** because the traffic balance reached zero or below. The traffic limit will be restored on the next billing cycle.

---

## Template configuration

| Parameter | Value |
|-----------|-------|
| **Email Type** | Product/service |
| **Unique Name** | puqMikrotikVPN Suspension Notification traffic limit |

---

## Email subject

```
Suspension Information - {$username}
```

---

## Email 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}
```

---

## Available template variables

The same custom variables as in the traffic-limit notification template are available:

| Variable | Description |
|----------|-------------|
| `{$username}` | VPN account username |
| `{$traffic_balance_gb}` | Remaining traffic balance (GB) — normally zero or below when this template is sent |
| `{$traffic_billingcycle_gb}` | Traffic that will be added on the next billing cycle (GB) |

Plus all standard WHMCS product/service merge fields (`{$client_name}`, `{$service_product_name}`, `{$service_next_due_date}`, `{$signature}`).

> **Note:** This email is sent automatically by the module when the VPN account is auto-suspended on the Mikrotik router because the customer's traffic balance has been exhausted.


<!-- sync:ca0599f37e65c9af -->

# Add server (Mikrotik router)

### Mikrotik VPN module **[WHMCS](https://puqcloud.com/link.php?id=77)**
#####  [Order now](https://panel.puqcloud.com/index.php?rp=/store/whmcs-module-mikrotik-vpn) | [Download](https://download.puqcloud.com/WHMCS/servers/PUQ_WHMCS-Mikrotik-VPN/) | [FAQ](https://faq.puqcloud.com/)

## Adding a Mikrotik router to WHMCS

Configure a Mikrotik router as a server within WHMCS using the PUQ Mikrotik VPN module.

Navigate to **System Settings** → **Servers** → **Add New Server**

---

### Step 1: General settings

Enter the correct **Name** and **Hostname** for your Mikrotik router.

- **Name** — an internal identification for the server (e.g. "My great Mikrotik router")
- **Hostname** — a resolvable domain pointing to the router's IP address (e.g. `vpn.mydomain.com`)

If your Mikrotik API-SSL service listens on a non-standard port, enter it in the **Port** field. Check the **Secure** checkbox (the module talks to the router through API-SSL).

![Add server - general settings](https://doc.puq.info/uploads/images/gallery/2026-04/embedded-image-sih9y7ai.png)
*04-add-server-1.png*

---

### Step 2: Assigned IP addresses

In the **Assigned IP Addresses** field, enter the list of IP addresses that will be distributed to users. These IPs are consumed sequentially as new VPN accounts are provisioned. Both private and public IP addresses are supported.

---

### Step 3: Module settings

1. In the Server Details section, select the **PUQ Mikrotik VPN** module from the dropdown
2. Enter valid Mikrotik router credentials:
   - **Username** — Mikrotik user with API access (typically with the `full` group or custom group that includes `api`, `write`, `read`, `policy`)
   - **Password** — the corresponding password
3. Click **Test connection** to verify the connection is working correctly

The test connection verifies that the module can reach the Mikrotik API-SSL service and authenticate with the provided credentials.

![Add server - module settings](https://doc.puq.info/uploads/images/gallery/2026-04/embedded-image-pdji3qgn.png)
*05-add-server-2.png*

> **Important:** The Mikrotik user must have sufficient privileges to create and manage PPP secrets, read traffic counters and reset them. The module uses the Mikrotik API only — SSH access is not used.


<!-- sync:0c27c7243d0dfcc7 -->

# Product Configuration

### Mikrotik VPN module **[WHMCS](https://puqcloud.com/link.php?id=77)**
#####  [Order now](https://panel.puqcloud.com/index.php?rp=/store/whmcs-module-mikrotik-vpn) | [Download](https://download.puqcloud.com/WHMCS/servers/PUQ_WHMCS-Mikrotik-VPN/) | [FAQ](https://faq.puqcloud.com/)

## Add new product to WHMCS

Navigate to **System Settings** → **Products/Services** → **Create a New Product**

Select the **PUQ Mikrotik VPN** module in the Module settings section.

---

## Configuration parameters

| Parameter | Description |
|-----------|-------------|
| **License key** | A pre-purchased license key for the PUQ Mikrotik VPN module. The license must be active for correct operation. After saving, the verification status is displayed below the field. |
| **Comment PREFIX** | Prefix applied to the VPN user comments on the Mikrotik router. Helps identify which PPP secrets belong to WHMCS-managed accounts. |
| **Profile** | PPP secret profile on the Mikrotik router. The dropdown is populated with the profiles configured on the selected server. |
| **Service** | Available VPN service on the Mikrotik router (e.g. `any`, `pptp`, `l2tp`, `pppoe`, etc.). |
| **Bandwidth Download** | Download speed limit in M/s applied to the VPN account. |
| **Bandwidth Upload** | Upload speed limit in M/s applied to the VPN account. |
| **Traffic (One Time / Monthly / Quarterly / Semi-Annual / Annual / Biennial / Triennial)** | Packet of traffic added per billing cycle (in GB). Values match the WHMCS billing cycle of the product. |
| **Save traffic history (days)** | Number of days to retain daily traffic usage statistics. Older records are deleted automatically during cron execution. |
| **User notification traffic limit email template** | Email template sent when remaining traffic falls below the threshold configured in the next field. Select a Product/service email template (created manually in WHMCS). |
| **Notification traffic remainder less than X GB** | Traffic threshold (in GB) that triggers the notification email. |
| **Suspend exceeding traffic limit email template** | Email template sent when the traffic balance reaches zero or below and the VPN account is automatically suspended on the router. |
| **Link to instruction** | Optional URL to a client-facing setup manual. Displayed as a button in the client area. Leave empty to hide the button. |
| **Support PPtP** | Toggles the display of PPtP connection details (server address, credentials) in the client area. |
| **Support L2TP** | Toggles the display of L2TP connection details in the client area. |
| **L2TP IPSec PSK key** | The IPSec pre-shared key for L2TP; displayed in the client area when L2TP support is enabled. |
| **Statistics collection frequency** | The frequency at which traffic usage statistics are collected by the WHMCS cron. Also checks the traffic balance and disables the VPN account on the Mikrotik router when the balance is exhausted. |

---

## Important notes

> **Warning:** This module works only as a **server module** (Products/Services). It cannot be used as an add-on product. Attempting to use it with add-on products will result in an error message.

> **Post-paid traffic billing (v3.0+):** The module no longer exposes its own traffic package selector. Traffic consumption is reported back to WHMCS using standard metrics, so you can build any post-paid traffic pricing model directly in the WHMCS product configuration.

> **Opposite upload/download values on Mikrotik:** the module intentionally registers opposite values on the router compared to the WHMCS settings, because Mikrotik measures incoming traffic while VPN clients experience outgoing traffic.

---

## Screenshots

![Product configuration settings](https://doc.puq.info/uploads/images/gallery/2026-04/embedded-image-5u1bnbmf.png)
*09-product-configuration.png*

![Product configuration — module settings area](https://doc.puq.info/uploads/images/gallery/2026-04/embedded-image-grrojxvj.png)
*17-product-configuration-2.png*


<!-- sync:b30d50d25334e537 -->

# Client Area

Overview of the client-facing features available in the Mikrotik VPN WHMCS module, including the home screen (VPN server address, protocols, credentials, connection status, bandwidth limit), email notifications (traffic limit, suspension) and traffic usage statistics.

# Home screen

### Mikrotik VPN module **[WHMCS](https://puqcloud.com/link.php?id=77)**
#####  [Order now](https://panel.puqcloud.com/index.php?rp=/store/whmcs-module-mikrotik-vpn) | [Download](https://download.puqcloud.com/WHMCS/servers/PUQ_WHMCS-Mikrotik-VPN/) | [FAQ](https://faq.puqcloud.com/)

## Client area home screen

After authenticating to the client panel, the end customer sees the VPN service management page with the following sections:

### Service information

- **User manual** — a button linking to the instruction URL (displayed only if configured by the administrator in product settings, "Link to instruction" field)
- **VPN server address** — the hostname or IP address the customer should connect to
- **VPN protocols** — information about which protocols (PPtP, L2TP) are available for this product, based on the "Support PPtP" / "Support L2TP" product settings
- **L2TP IPSec PSK key** — displayed when L2TP support is enabled
- **Username** — the VPN username with a **copy-to-clipboard** button
- **Password** — the VPN password with a **copy-to-clipboard** button
- **Connection status** — real-time indicator of whether the VPN account is currently connected on the router
- **Bandwidth limit** — displays the configured download / upload speed limits

### Traffic information

- **Remaining traffic balance** — the current traffic balance for the customer
- **Traffic that will be added** on the next billing cycle

### Sidebar navigation

The client area sidebar contains two menu items:
- **Information** — the main service details page (described above)
- **Traffic statistics** — historical traffic usage charts (see [Traffic statistics](#) page)

> **Note:** If the service status is not Active or if the VPN account cannot be found on the Mikrotik router, an error page is displayed instead.

---

## Screenshot

![Client area home screen](https://doc.puq.info/uploads/images/gallery/2026-04/embedded-image-zwounpmi.png)
*10-home-screen.png*


<!-- sync:584abcf3b37f0cbc -->

# Email notification

### Mikrotik VPN module **[WHMCS](https://puqcloud.com/link.php?id=77)**
#####  [Order now](https://panel.puqcloud.com/index.php?rp=/store/whmcs-module-mikrotik-vpn) | [Download](https://download.puqcloud.com/WHMCS/servers/PUQ_WHMCS-Mikrotik-VPN/) | [FAQ](https://faq.puqcloud.com/)

## Email notification examples

The module sends two types of automatic email notifications based on the customer's traffic balance and the templates configured in the product settings.

---

### 1. Traffic limit about to be exhausted

Sent automatically when the remaining traffic balance falls below the threshold configured in the product settings ("Notification traffic remainder less than X GB"). Uses the template selected in "User notification traffic limit email template".

![Email notification — traffic limit](https://doc.puq.info/uploads/images/gallery/2026-04/embedded-image-3hpefsuk.png)
*11-email-notification-1.png*

---

### 2. Suspension notification (traffic exhausted)

Sent automatically when the traffic balance reaches zero or below and the module suspends the VPN account on the Mikrotik router. Uses the template selected in "Suspend exceeding traffic limit email template".

![Email notification — suspension](https://doc.puq.info/uploads/images/gallery/2026-04/embedded-image-7bu1wl1b.png)
*12-email-notification-2.png*

> **Note:** Both templates must be created manually in WHMCS before they can be selected in the product settings. See the [Email Template](#) pages in the Installation and Configuration chapter.


<!-- sync:e0ca70542ebd9e59 -->

# Traffic statistics

### Mikrotik VPN module **[WHMCS](https://puqcloud.com/link.php?id=77)**
#####  [Order now](https://panel.puqcloud.com/index.php?rp=/store/whmcs-module-mikrotik-vpn) | [Download](https://download.puqcloud.com/WHMCS/servers/PUQ_WHMCS-Mikrotik-VPN/) | [FAQ](https://faq.puqcloud.com/)

## Traffic usage statistics

The client can view traffic usage statistics in the sidebar menu item **"Traffic statistics"**.

The statistics page shows the customer's traffic on a **daily basis**, broken down into **incoming** and **outgoing** traffic. Both charts are powered by Google Charts and automatically resize to fit the browser window. The raw data is collected by the WHMCS cron job and stored in the database for the number of days configured in the product settings ("Save traffic history (days)" parameter).

> **Note:** Statistics data is only available after the WHMCS cron has run at least once with the UsageUpdate function. After each collection, traffic counters on the Mikrotik router are reset to zero to guarantee accurate accounting for the next interval.

---

## Screenshots

![Traffic statistics — chart view](https://doc.puq.info/uploads/images/gallery/2026-04/embedded-image-wy37gs4q.png)
*13-traffic-statistics-1.png*

![Traffic statistics — table view](https://doc.puq.info/uploads/images/gallery/2026-04/embedded-image-nq8c9hvh.png)
*14-traffic-statistics-2.png*


<!-- sync:55732058b8af2613 -->

# Admin Area

Administrative features and tools available in the WHMCS admin panel for managing Mikrotik VPN services.

# Product Information

### Mikrotik VPN module **[WHMCS](https://puqcloud.com/link.php?id=77)**
#####  [Order now](https://panel.puqcloud.com/index.php?rp=/store/whmcs-module-mikrotik-vpn) | [Download](https://download.puqcloud.com/WHMCS/servers/PUQ_WHMCS-Mikrotik-VPN/) | [FAQ](https://faq.puqcloud.com/)

## Admin area product information

The administrator can view detailed service information in the WHMCS admin panel on the product/service page. The module adds a custom panel in the **Module Data** section with the following information:

### License verification status

Displays the current license status with a colored indicator:
- **Green** — license is valid and active
- **Red** — license is invalid, expired, or missing

### API connection status

Shows the result of a real-time connection test to the Mikrotik router API-SSL, confirming that the credentials entered for the server are working correctly.

### VPN account information

| Field | Description |
|-------|-------------|
| **Username** | The VPN account username (PPP secret name) on the Mikrotik router |
| **Enabled** | Whether the VPN account is currently enabled or disabled on the router |
| **Profile** | The PPP profile assigned to the account |
| **Service** | The VPN service / protocol (e.g. `any`, `pptp`, `l2tp`, `pppoe`) |
| **IP address** | The IP address assigned to the account from the server's IP pool |
| **Comment** | Includes the configured Comment PREFIX and WHMCS service identifier |

### Traffic information

- **Bandwidth limits** — configured download / upload speed limits
- **Traffic balance** — current remaining traffic balance for the customer
- **Traffic that will be added** on the next billing cycle
- **Connection status** — shows whether the client is currently online

### Available management actions

The standard WHMCS module command buttons are available:
- **Create** — provision a new VPN account on the Mikrotik router
- **Suspend** — disable the VPN account
- **Unsuspend** — re-enable the VPN account
- **Terminate** — permanently delete the VPN account from the router
- **Change Password** — reset the account's password
- **Change Package** — update profile, service, bandwidth limits and traffic configuration (used during upgrades/downgrades)
- **Reset Connection** — force-disconnect the current VPN session (useful when the customer needs to re-establish the tunnel)

---

## Screenshot

![Admin area product information](https://doc.puq.info/uploads/images/gallery/2026-04/embedded-image-4etvbmzs.png)
*15-product-information.png*


<!-- sync:ee5a85cf281a1fc9 -->

