MikroTik WireGuard VPN For WHMCS
| (14 intermediate revisions by one user not shown) | |||
| Line 1: | Line 1: | ||
<meta name="keywords" content="mikrotik wireguard vpn for whmcs, whmcs mikrotik wireguard vpn configuration, whmcs mikrotik wireguard vpn management, whmcs mikrotik wireguard vpn installation, whmcs mikrotik wireguard vpn common problems, about whmcs mikrotik wireguard vpn, whmcs mikrotik wireguard vpn documentation, whmcs mikrotik wireguard vpn faq, whmcs mikrotik wireguard vpn help, whmcs mikrotik wireguard vpn guide, whmcs mikrotik wireguard vpn wiki, whmcs mikrotik wireguard vpn tutorial, whmcs mikrotik wireguard vpn tips"></meta> | <meta name="keywords" content="mikrotik wireguard vpn for whmcs, whmcs mikrotik wireguard vpn configuration, whmcs mikrotik wireguard vpn management, whmcs mikrotik wireguard vpn installation, whmcs mikrotik wireguard vpn common problems, about whmcs mikrotik wireguard vpn, whmcs mikrotik wireguard vpn documentation, whmcs mikrotik wireguard vpn faq, whmcs mikrotik wireguard vpn help, whmcs mikrotik wireguard vpn guide, whmcs mikrotik wireguard vpn wiki, whmcs mikrotik wireguard vpn tutorial, whmcs mikrotik wireguard vpn tips"></meta> | ||
<meta name="description" content="ModulesGarden Wiki Contains All The Information You Need About The MikroTik WireGuard VPN For WHMCS Module."></meta> | <meta name="description" content="ModulesGarden Wiki Contains All The Information You Need About The MikroTik WireGuard VPN For WHMCS Module."></meta> | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
=About [https://www.modulesgarden.com/products/whmcs/mikrotik-wireguard-vpn MikroTik WireGuard VPN For WHMCS]= | =About [https://www.modulesgarden.com/products/whmcs/mikrotik-wireguard-vpn MikroTik WireGuard VPN For WHMCS]= | ||
{| | {| | ||
|style="padding: 10px 0px 10px 0px;"|'''MikroTik WireGuard VPN For WHMCS''' enables automated provisioning and management of WireGuard VPN services on MikroTik routers.<br/> | |style="padding: 10px 0px 10px 0px;"|'''MikroTik WireGuard VPN For WHMCS''' enables automated provisioning and management of WireGuard VPN services on MikroTik routers.<br/> | ||
| − | The module | + | The module handles the complete VPN service lifecycle, including peer creation, bandwidth enforcement, suspension, unsuspension, termination, configuration delivery, and usage-based billing.<br/> |
| − | Clients can access their connection details, scan a configuration QR code, download a ready-to-use configuration file, and review traffic statistics in the client area. | + | Clients can access their connection details, scan a configuration QR code, download a ready-to-use configuration file, and review traffic statistics in the client area, while administrators can monitor configured routers, inspect live WireGuard peers, and review traffic usage from one central addon module. |
|} | |} | ||
*'''Core Features:''' | *'''Core Features:''' | ||
| Line 205: | Line 196: | ||
{| | {| | ||
|style="padding: 0px 0px 30px 30px;"|✔ Easy [https://www.docs.modulesgarden.com/How_To_Upgrade_WHMCS_Module Module Upgrade] To [https://www.modulesgarden.com/products/whmcs/mikrotik-wireguard-vpn#open-source-version Open Source Version] | |style="padding: 0px 0px 30px 30px;"|✔ Easy [https://www.docs.modulesgarden.com/How_To_Upgrade_WHMCS_Module Module Upgrade] To [https://www.modulesgarden.com/products/whmcs/mikrotik-wireguard-vpn#open-source-version Open Source Version] | ||
| + | |} | ||
| + | |||
| + | ==Installation and Configuration== | ||
| + | {| | ||
| + | |style="padding: 10px 0px 30px 15px;"| | ||
| + | This tutorial will show you how to successfully install and configure '''MikroTik WireGuard VPN For WHMCS'''.<br/> | ||
| + | We will guide you step by step through the installation process, MikroTik server connection, product configuration, metric billing setup, addon module management, and client area features. | ||
| + | |} | ||
| + | |||
| + | ===Installation=== | ||
| + | {| | ||
| + | |style="padding: 10px 0px 20px 15px;"|'''1. Log in to our client area and download the module.''' | ||
| + | |} | ||
| + | {| | ||
| + | |style="padding: 0px 0px 20px 25px;"|[[File:MTWG_download.png]] | ||
| + | |} | ||
| + | {| | ||
| + | |style="padding: 0px 0px 15px 15px;"|'''2. Extract the module package into the main WHMCS directory.'''<br/> | ||
| + | The files should be uploaded into the corresponding WHMCS folders. | ||
| + | |} | ||
| + | {| | ||
| + | |style="padding: 0px 0px 20px 25px;"|[[File:MTWG_1.png]] | ||
| + | |} | ||
| + | {| | ||
| + | |style="padding: 0px 0px 15px 15px;"|'''3. When you install MikroTik WireGuard VPN For WHMCS for the first time you have to rename '' 'license_RENAME.php' '' file.'''<br /> | ||
| + | The file is located in '' 'modules/addons/MikroikWireGuardVpn For WHMCS/license_RENAME.php'. '' Rename it from '' 'license_RENAME.php' '' to '' 'license.php'. '' | ||
| + | |} | ||
| + | {| | ||
| + | |style="padding: 0px 0px 20px 25px;"|[[File:MTWG_license.png]] | ||
| + | |} | ||
| + | {| | ||
| + | |style="padding: 0px 0px 15px 15px;"|'''4. In order to configure your license key, you have to edit the previously renamed '' 'license.php' file.'''''<br /> | ||
| + | Enter your license key between quotation marks as presented on the following screen. You can find your license key in our client area → '' 'My Products'. '' | ||
| + | |} | ||
| + | {| | ||
| + | |style="padding: 0px 0px 20px 25px;"|[[File:MTWG_license2.png]] | ||
| + | |} | ||
| + | {| | ||
| + | |style="padding: 0px 0px 15px 15px;"|'''5. Log in to your WHMCS admin area and navigate to ''System Settings'' → ''Addon Modules''.'''<br/> | ||
| + | * Find ''MikroTik WireGuard VPN'' on the list and click ''Activate''. | ||
| + | * Set access permissions for the required administrator roles and save the changes.'''<br/> | ||
| + | The addon module can now be opened through ''Addons'' → ''MikroTik WireGuard VPN''. | ||
| + | |} | ||
| + | {| | ||
| + | |style="padding: 0px 0px 30px 25px;"|[[File:MTWG_3.png]] | ||
| + | |} | ||
| + | |||
| + | ===MikroTik Router Preparation=== | ||
| + | {| | ||
| + | |style="padding: 10px 0px 15px 15px;"| | ||
| + | Before connecting the router to WHMCS, make sure that: | ||
| + | |||
| + | * MikroTik RouterOS '''7.20 or later''' is installed. | ||
| + | * A WireGuard interface has been created on the router. | ||
| + | * The RouterOS REST API is available. | ||
| + | * The API user has permissions sufficient to manage WireGuard peers, addresses, queues, and traffic data required by the module. | ||
| + | * The selected HTTP or HTTPS service and port are accessible from the WHMCS server. | ||
| + | * When a secure connection is used, HTTPS and a valid router certificate are configured correctly. | ||
| + | |||
| + | <div class="box"> | ||
| + | '''Important:''' Restrict API access to trusted IP addresses whenever possible and use HTTPS for production environments. | ||
| + | </div> | ||
| + | |||
| + | The module communicates with the router exclusively through the MikroTik RouterOS REST API. Legacy API and Winbox access are not required. | ||
|} | |} | ||
===Server Configuration=== | ===Server Configuration=== | ||
{| | {| | ||
| − | |style="padding: 10px 0px 15px 15px;"|''' | + | |style="padding: 10px 0px 15px 15px;"|'''6. Navigate to ''System Settings'' → ''Servers'' and click ''Add New Server''.'''<br/> |
| − | Choose ''MikroTik WireGuard VPN'' from the ''Module'' dropdown menu and provide the router connection details. | + | The module uses the standard WHMCS server infrastructure. Choose ''MikroTik WireGuard VPN'' from the ''Module'' dropdown menu and provide the router connection details. |
| + | |} | ||
| + | {| | ||
| + | |style="padding: 0px 0px 20px 25px;"|[[File:MTWG_4.png]] | ||
| + | |} | ||
| + | {| | ||
| + | |style="padding: 0px 0px 15px 15px;"| | ||
Configure the following fields: | Configure the following fields: | ||
| Line 217: | Line 278: | ||
* '''Username''' – enter the RouterOS API username. | * '''Username''' – enter the RouterOS API username. | ||
* '''Password''' – enter the password assigned to the API user. | * '''Password''' – enter the password assigned to the API user. | ||
| − | * '''Port''' – provide the port used by the RouterOS REST API. | + | * '''Port''' – provide the port used by the RouterOS REST API. The default HTTPS port is ''443''. |
| − | * '''Secure''' – enable to connect through HTTPS | + | * '''Secure''' – enable to connect through HTTPS; leave disabled only when an HTTP connection is intentionally used. |
| − | + | ||
|} | |} | ||
{| | {| | ||
| − | |style="padding: 0px 0px | + | |style="padding: 0px 0px 15px 15px;"|'''7. Use ''Test Connection'' to verify the provided credentials and connection settings.'''<br/> |
| + | If the test is successful, save the server configuration. | ||
|} | |} | ||
{| | {| | ||
| − | |style="padding: 10px 0px 15px 15px;"|''' | + | |style="padding: 10px 0px 15px 15px;"|'''8. Create or select a server group and assign the configured MikroTik server to it.'''<br/> |
| − | + | The server group can later be selected in the product's module settings. Add multiple routers when you want to distribute VPN services across a larger infrastructure. | |
|} | |} | ||
{| | {| | ||
| − | |style="padding: | + | |style="padding: 0px 0px 30px 25px;"|[[File:MTWG_6.png]] |
| − | + | ||
| − | + | ||
| − | + | ||
|} | |} | ||
| − | |||
===Product Configuration=== | ===Product Configuration=== | ||
{| | {| | ||
| Line 246: | Line 303: | ||
{| | {| | ||
| − | |style="padding: | + | |style="padding: 0px 0px 20px 15px;"|'''8. Configure the VPN service parameters.''' |
|} | |} | ||
{| | {| | ||
| Line 256: | Line 313: | ||
* '''Server Group''' – select the group containing the MikroTik router that will host the VPN peer. | * '''Server Group''' – select the group containing the MikroTik router that will host the VPN peer. | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | + | * General | |
| − | ''' | + | ** '''WireGuard Interface''' – enter the WireGuard interface used for the service. |
| − | + | ** '''Comment Prefix''' – define the prefix added to comments identifying module-created peers. | |
| + | * Bandwidth | ||
| + | ** '''Upload Speed Limit''' – define the maximum upload speed assigned to the service. | ||
| + | ** '''Download Speed Limit''' – define the maximum download speed assigned to the service. | ||
| + | * Client Configuration | ||
| + | ** '''Tunnel IP Address Pool''' - assign tunnel IP addresses individually or define an IP address range. Separate the first and last address in the range with a hyphen, for example: 192.168.0.3-192.168.0.14 | ||
| + | ** '''Allowed IP Addresses''' – specify the addresses or networks routed through the VPN tunnel. | ||
| + | ** '''DNS Servers''' – define the DNS servers included in the client configuration. | ||
| + | ** '''Keepalive Interval (seconds)''' – set the keepalive interval in seconds. | ||
| + | * Client Area Features | ||
| + | ** '''Enable Traffic Statistics''' – enable traffic data collection and presentation. | ||
| + | ** '''Statistics Retention (days)''' – define how long collected traffic records should be stored. | ||
| + | ** '''Help / Setup Guide URL''' – provide a link to your VPN setup instructions. | ||
| + | ** '''Client Downloads URL''' – provide a link clients can use to download the WireGuard application. | ||
|} | |} | ||
{| | {| | ||
| − | |style="padding: | + | |style="padding: 0px 0px 30px 15px;"|'''9. Select the preferred provisioning method and save the product settings.'''<br/> |
Depending on the selected WHMCS option, the VPN account may be created automatically after the first payment, immediately after order placement, or manually by an administrator. | Depending on the selected WHMCS option, the VPN account may be created automatically after the first payment, immediately after order placement, or manually by an administrator. | ||
| + | |} | ||
| + | |||
| + | ===Usage-Based Metric Billing=== | ||
| + | {| | ||
| + | |style="padding: 10px 0px 15px 15px;"| | ||
| + | The Metric Billing section allows you to control which traffic metrics are billed through the native WHMCS metric billing system. | ||
| + | |||
| + | Use the switch next to each metric to enable or disable billing. When enabled, the metric usage is reported to WHMCS and included in usage-based billing. Disabled metrics are not billed. | ||
| + | |||
| + | Select Configure Pricing below each metric to define the included traffic allowance and the price charged for each additional gigabyte. Download and upload pricing can be configured independently for every available billing cycle. | ||
| + | |} | ||
| + | {| | ||
| + | |style="padding: 0px 0px 20px 25px;"|[[File:MTWG_10.png]] | ||
|} | |} | ||
{| | {| | ||
| − | |style="padding: 0px 0px | + | |style="padding: 0px 0px 30px 25px;"|[[File:MTWG_10_0.png]] |
|} | |} | ||
| Line 291: | Line 362: | ||
====Dashboard==== | ====Dashboard==== | ||
{| | {| | ||
| − | |style="padding: 10px 0px 15px 15px;"|The ''Dashboard'' | + | |style="padding: 10px 0px 15px 15px;"|The ''Dashboard'' opens with a configuration guide covering the main setup steps: adding a MikroTik server, configuring a product, inspecting live peers, and accessing the documentation.<br/> |
| − | + | The statistics widgets show the numbers of configured servers, active services, suspended services, and provisioned VPN accounts. The ''Traffic Overview (Last 30 Days, GB)'' graph presents the total recorded traffic. | |
|} | |} | ||
{| | {| | ||
| Line 301: | Line 372: | ||
{| | {| | ||
|style="padding: 10px 0px 15px 15px;"|The ''Servers'' page lists MikroTik routers configured in WHMCS.<br/> | |style="padding: 10px 0px 15px 15px;"|The ''Servers'' page lists MikroTik routers configured in WHMCS.<br/> | ||
| − | For each entry, you can review its name, hostname, connection port, | + | For each entry, you can review its name, hostname, connection port, connection scheme, number of assigned services, and current status. |
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
<div class="box"> | <div class="box"> | ||
'''Note:''' Router connection settings are managed in ''WHMCS System Settings'' → ''Servers''. The addon page provides a centralized overview of the configured servers. | '''Note:''' Router connection settings are managed in ''WHMCS System Settings'' → ''Servers''. The addon page provides a centralized overview of the configured servers. | ||
</div> | </div> | ||
| + | |} | ||
| + | {| | ||
| + | |style="padding: 0px 0px 30px 25px;"|[[File:MTWG_13.png]] | ||
| + | |} | ||
====Accounts==== | ====Accounts==== | ||
{| | {| | ||
| − | |style="padding: 10px 0px 15px 15px;"|The ''Accounts'' page | + | |style="padding: 10px 0px 15px 15px;"|The ''Accounts'' page lists the WireGuard peers currently available on the selected MikroTik router, including peers not created by the module.<br/> |
| − | Use search and filters to locate a specific | + | Use search and filters to locate a specific peer or narrow the list by its current state. |
|} | |} | ||
{| | {| | ||
| Line 321: | Line 392: | ||
{| | {| | ||
|style="padding: 0px 0px 15px 15px;"| | |style="padding: 0px 0px 15px 15px;"| | ||
| − | + | For each peer, the list may include: | |
| − | * | + | * peer comment |
| − | + | ||
* WireGuard interface | * WireGuard interface | ||
| + | * allowed address | ||
| + | * public key | ||
* peer state | * peer state | ||
| + | * received and transmitted traffic | ||
* last handshake | * last handshake | ||
| − | * | + | * related WHMCS service, when available |
|} | |} | ||
{| | {| | ||
| − | |style="padding: 0px 0px 15px 15px;"|Open | + | |style="padding: 0px 0px 15px 15px;"|Open a linked account to review its peer details, assigned tunnel address, connection information, and WireGuard configuration. |
|} | |} | ||
{| | {| | ||
| Line 337: | Line 410: | ||
|} | |} | ||
| − | ====Logs==== | + | ====[https://www.docs.modulesgarden.com/Logs Logs]==== |
{| | {| | ||
| − | |style="padding: 10px 0px 15px 15px;"|The ''Logs'' section | + | |style="padding: 10px 0px 15px 15px;"|The '' 'Logs' '' section is where the module logs are stored. You can filter the module logs by type with the '' 'Show' '' buttons.<br/> |
| − | + | For precise details on Logs, please refer to our dedicated documentation article, which you may find [https://www.docs.modulesgarden.com/Logs here]. | |
|} | |} | ||
{| | {| | ||
| Line 346: | Line 419: | ||
|} | |} | ||
| − | ====Translations==== | + | ====[https://www.docs.modulesgarden.com/Translations_Tool Translations]==== |
{| | {| | ||
| − | |style="padding: 10px 0px 15px 15px;"| | + | |style="padding: 10px 0px 15px 15px;"|Customizing language files is now extremely easy with the '' "Translations" '' tool that is now available directly in the addon.<br.> Its user-friendly design makes managing various language file tweaks a smooth and efficient process. <br/> |
| − | + | Prepare translations for the original English files with this handy built-in tool. For specific instructions on how to use this tool please refer to its dedicated article, you will find it [https://www.docs.modulesgarden.com/Translations_Tool here].<br/> | |
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
<div class="box"> | <div class="box"> | ||
'''Tip:''' Custom translations created with this tool are preserved separately from the original language files, making them easier to maintain during module updates. | '''Tip:''' Custom translations created with this tool are preserved separately from the original language files, making them easier to maintain during module updates. | ||
</div> | </div> | ||
| + | |} | ||
| + | {| | ||
| + | |style="padding: 0px 0px 30px 25px;"|[[File:MTWG_17.png]] | ||
| + | |} | ||
| − | ====Access Control | + | ====[https://www.docs.modulesgarden.com/Access_Control_Tool Access Control]==== |
{| | {| | ||
| − | |style="padding: 10px 0px 15px 15px;"| | + | |style="padding: 10px 0px 15px 15px;"|Ensure secure and tailored access to your module with the "Access Control" tool available in ModulesGarden addons.<br/> |
| − | + | This feature allows you to assign permissions, define resource access for administrators, and track activities with detailed logs.<br/> | |
| + | Customize access settings to fit your team’s structure and maintain transparency with ease. For comprehensive guidance, refer to the tool's [https://www.docs.modulesgarden.com/Access_Control_Tool dedicated article]. | ||
|} | |} | ||
{| | {| | ||
| − | |style="padding: 0px 0px | + | |style="padding: 0px 0px 30px 25px;"|[[File:MTWG_18.png]] |
|} | |} | ||
| Line 374: | Line 448: | ||
|} | |} | ||
{| | {| | ||
| − | |style="padding: 0px 0px 15px 15px;"|The service view displays the | + | |style="padding: 0px 0px 15px 15px;"|The service view displays whether the peer exists and is enabled, along with its assigned tunnel IP address, server endpoint, last handshake and traffic counters.<br/> |
Administrators can also perform the standard module commands: | Administrators can also perform the standard module commands: | ||
| Line 384: | Line 458: | ||
|} | |} | ||
{| | {| | ||
| − | + | |style="padding: 0px 0px 15px 15px;"|Use the available management actions to preview the WireGuard configuration, download the ''.conf'' file, reset the VPN interface, and review traffic statistics.<br/> | |
| − | + | Resetting the VPN interface disables and re-enables the WireGuard peer to force a new handshake (the received and sent traffic counters will be reset). The assigned keys, tunnel IP address, and configuration remain unchanged. | |
| − | + | ||
| − | + | ||
| − | |style="padding: 0px 0px 15px 15px;"|Use the available management actions to preview the WireGuard configuration, download the ''.conf'' file, reset the VPN | + | |
|} | |} | ||
{| | {| | ||
| − | |style="padding: 0px 0px | + | |style="padding: 0px 0px 30px 25px;"|[[File:MTWG_19.png]] |
|} | |} | ||
====Traffic Statistics==== | ====Traffic Statistics==== | ||
{| | {| | ||
| − | |style="padding: 10px 0px 15px 15px;"|The traffic | + | |style="padding: 10px 0px 15px 15px;"|The Traffic Statistics section displays two charts: Last 30 Days, showing daily traffic usage, and Monthly, showing total traffic usage aggregated by month.<br/> The metric statistics panel also displays the current download and upload totals and allows administrators to refresh the counters directly from the router. |
| − | + | ||
|} | |} | ||
{| | {| | ||
| − | |style="padding: 0px 0px 30px 25px;"|[[File: | + | |style="padding: 0px 0px 30px 25px;"|[[File:MTWG_20.png]] |
|} | |} | ||
====VPN Configuration==== | ====VPN Configuration==== | ||
{| | {| | ||
| − | |style="padding: 10px 0px 15px 15px;"|The configuration view contains the connection parameters required by the WireGuard client.<br/> | + | |style="padding: 10px 0px 15px 15px;"|The configuration view contains the complete connection parameters required by the WireGuard client, including the client interface settings and the remote peer details.<br/> |
Administrators can preview the generated configuration or download it as a ready-to-use ''.conf'' file. | Administrators can preview the generated configuration or download it as a ready-to-use ''.conf'' file. | ||
|} | |} | ||
{| | {| | ||
| − | |style="padding: 0px 0px | + | |style="padding: 0px 0px 30px 25px;"|[[File:MTWG_22.png]] |
|} | |} | ||
===Client Area=== | ===Client Area=== | ||
{| | {| | ||
| − | |style="padding: 10px 0px | + | |style="padding: 10px 0px 30px 15px;"| |
The client area gives customers direct access to their WireGuard VPN service and the resources required to configure a connection. | The client area gives customers direct access to their WireGuard VPN service and the resources required to configure a connection. | ||
|} | |} | ||
| Line 420: | Line 490: | ||
====VPN Dashboard==== | ====VPN Dashboard==== | ||
{| | {| | ||
| − | |style="padding: 10px 0px 15px 15px;"|The main service page displays the | + | |style="padding: 10px 0px 15px 15px;"|The main service page displays the live peer state, assigned tunnel IP address, server endpoint, last handshake, received and transmitted traffic, and applied upload and download limits.<br/> |
Depending on the product configuration, clients can also open the setup guide and download the WireGuard application. | Depending on the product configuration, clients can also open the setup guide and download the WireGuard application. | ||
|} | |} | ||
{| | {| | ||
| − | |style="padding: 0px 0px | + | |style="padding: 0px 0px 20px 25px;"|[[File:MTWG_23.png]] |
|} | |} | ||
{| | {| | ||
| − | |style="padding: 0px 0px | + | |style="padding: 0px 0px 30px 15px;"| |
Available client actions include: | Available client actions include: | ||
| Line 433: | Line 503: | ||
* scanning the configuration QR code | * scanning the configuration QR code | ||
* downloading the ready-to-use ''.conf'' file | * downloading the ready-to-use ''.conf'' file | ||
| − | * resetting the VPN | + | * resetting the VPN interface |
* opening the setup guide | * opening the setup guide | ||
* downloading the WireGuard client | * downloading the WireGuard client | ||
|} | |} | ||
| + | |||
====Configuration And QR Code==== | ====Configuration And QR Code==== | ||
{| | {| | ||
| − | |style="padding: 10px 0px 15px 15px;"|Clients can preview the complete WireGuard configuration and scan the generated QR code to quickly | + | |style="padding: 10px 0px 15px 15px;"|Clients can preview the complete WireGuard configuration, including the client interface and remote peer parameters, and scan the generated QR code to quickly import the tunnel into a compatible WireGuard application.<br/> |
| − | The same configuration can be downloaded as a ''.conf'' file. | + | The same configuration can be downloaded as a ready-to-import ''.conf'' file. |
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
<div class="box"> | <div class="box"> | ||
'''Important:''' The WireGuard configuration contains sensitive connection data. Clients should store it securely and should not share it with unauthorized persons. | '''Important:''' The WireGuard configuration contains sensitive connection data. Clients should store it securely and should not share it with unauthorized persons. | ||
</div> | </div> | ||
| + | |} | ||
| + | {| | ||
| + | |style="padding: 0px 0px 30px 25px;"|[[File:MTWG_24.png]] | ||
| + | |} | ||
====Traffic Statistics==== | ====Traffic Statistics==== | ||
| Line 459: | Line 531: | ||
|} | |} | ||
| − | ====Reset VPN | + | ====Reset VPN Interface==== |
{| | {| | ||
| − | |style="padding: 10px 0px 15px 15px;"|Use ''Reset VPN | + | |style="padding: 10px 0px 15px 15px;"|Use ''Reset VPN Interface'' to disable and re-enable the WireGuard peer and force a new handshake.<br/> |
| − | The client must confirm | + | The action does not change the assigned keys, tunnel IP address, or configuration. The client must confirm it before it is performed. |
|} | |} | ||
{| | {| | ||
| − | |style="padding: 0px 0px | + | |style="padding: 0px 0px 30px 25px;"|[[File:MTWG_26.png]] |
|} | |} | ||
==Cron Jobs== | ==Cron Jobs== | ||
{| | {| | ||
| − | |style="padding: 10px 0px | + | |style="padding: 10px 0px 30px 15px;"| |
| − | The module | + | The module uses the standard WHMCS automation cron for traffic collection, metric usage reporting, and data maintenance.<br/> |
| − | Make sure that the main WHMCS automation cron is configured according to the official [https://docs.whmcs.com/8-13/system/automation/system-cron/ WHMCS documentation]. | + | Make sure that the main WHMCS automation cron is configured and running according to the official [https://docs.whmcs.com/8-13/system/automation/system-cron/ WHMCS documentation]. |
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
|} | |} | ||
| + | |||
=Tips= | =Tips= | ||
{| | {| | ||
| Line 504: | Line 573: | ||
</div> | </div> | ||
|} | |} | ||
| + | =Upgrade Guide= | ||
| + | {| | ||
| + | |style="padding: 10px 0px 30px 15px;"|Seeking a solution that offers greater flexibility, customization tailored to your precise needs, and unrestricted availability?<br/> There is an option that not only proves to be cost-effective in the long run but also includes prioritized support services, making it a truly valuable investment.<br/> | ||
| + | |||
| + | Opt for the [https://www.modulesgarden.com/products/whmcs/mikrotik-wireguard-vpn#open-source-version Open Source version] of your MikroTik WireGuard VPN For WHMCS module to unlock these benefits.<br/> Simply click on either the '''Get Source Code''' or '''Upgrade To Lifetime''' button found on the product's page in our client area to complete the one-step upgrade process, with a '''dedicated discount''' already applied.<br/> | ||
| + | |||
| + | Follow a [https://www.docs.modulesgarden.com/How_To_Upgrade_WHMCS_Module comprehensive guide] covering the transition process, the advantages it brings, and step-by-step instructions on what to do next after the order has been successfully finalized. | ||
| + | |} | ||
| + | |||
=Common Problems= | =Common Problems= | ||
{| | {| | ||
| Line 533: | Line 611: | ||
|style="padding: 0px 0px 15px 30px;"| | |style="padding: 0px 0px 15px 30px;"| | ||
* Confirm that traffic statistics are enabled in the product's module settings. | * Confirm that traffic statistics are enabled in the product's module settings. | ||
| − | * Make sure the WHMCS cron is running correctly. | + | * Make sure the WHMCS metric billing cron is running correctly. |
* Allow the module enough time to collect the first traffic records. | * Allow the module enough time to collect the first traffic records. | ||
| + | * Use ''Refresh Now'' on the service page to read the current counters from the router on demand. | ||
* Review the module logs for traffic collection errors. | * Review the module logs for traffic collection errors. | ||
|} | |} | ||
| Line 548: | Line 627: | ||
* Verify that the WHMCS automation cron is running. | * Verify that the WHMCS automation cron is running. | ||
|} | |} | ||
| − | |||
Latest revision as of 15:43, 19 August 2026
Contents |
[edit] About MikroTik WireGuard VPN For WHMCS
| MikroTik WireGuard VPN For WHMCS enables automated provisioning and management of WireGuard VPN services on MikroTik routers. The module handles the complete VPN service lifecycle, including peer creation, bandwidth enforcement, suspension, unsuspension, termination, configuration delivery, and usage-based billing. |
- Core Features:
| ✔ Automate Complete WireGuard VPN Service Provisioning |
| ✔ Manage VPN Accounts On MikroTik Routers Through WHMCS |
| ✔ Control Bandwidth And Track Traffic Usage |
| ✔ Provide Clients With Ready-To-Use VPN Configurations |
| ✔ Support Usage-Based Billing For Transferred Traffic |
- Admin Area:
| ✔ Create, Suspend, Unsuspend And Terminate VPN Accounts |
| ✔ Change Service Packages |
| ✔ View Peer And Connection Details |
| ✔ Download VPN Configuration Files |
| ✔ View Daily And Monthly Traffic Statistics |
| ✔ Reset VPN Connections |
| ✔ Configure Products: |
| ✔ Select MikroTik Server And WireGuard Interface |
| ✔ Define Peer Comment Prefix |
| ✔ Configure Allowed IP Addresses And DNS Servers |
| ✔ Set Keepalive Interval |
| ✔ Define Upload And Download Speed Limits |
| ✔ Enable Traffic Statistics |
| ✔ Configure Traffic Data Retention Period |
| ✔ Define Setup Guide And WireGuard Client Download URLs |
| ✔ Enable Usage-Based Metric Billing |
- Addon Module:
| ✔ View Dashboard With Server, Account And Service Summaries |
| ✔ View General Traffic Overview Graph |
| ✔ Manage Multiple MikroTik Servers |
| ✔ View All WireGuard VPN Accounts And Peers |
| ✔ Preview Peer State, Interface, Last Handshake And Traffic Usage |
| ✔ View Connection Details And Configuration |
| ✔ Control Staff Access Level To Specific Resources With ACL |
| ✔ Customize Module Language Files With "Translations" Tool |
| ✔ Review Module Activity And Error Logs |
- Client Area:
| ✔ View VPN Account And Connection Status |
| ✔ View Connection Details And Assigned Tunnel IP Address |
| ✔ Check Applied Bandwidth Limits |
| ✔ Preview WireGuard Configuration |
| ✔ Scan Configuration QR Code |
| ✔ Download Ready-To-Use .conf File |
| ✔ View Daily And Monthly Traffic Statistics |
| ✔ Reset VPN Connection |
| ✔ Access Setup Guide |
| ✔ Download WireGuard Client |
- General Info:
| ✔ Supports MikroTik RouterOS 7.20 And Later |
| ✔ Supports Multiple MikroTik Routers |
| ✔ Multi-Language Support With Custom Translations Tool |
| ✔ Supports PHP 8.3 Back To PHP 8.2 |
| ✔ Supports WHMCS Themes "Six", "Twenty-One", "Nexus" And "Lagom WHMCS Client Theme" |
| ✔ Supports WHMCS V9.X |
| ✔ Requires ionCube Loader V14 Or Later |
| ✔ Easy Module Upgrade To Open Source Version |
[edit] Installation and Configuration
|
This tutorial will show you how to successfully install and configure MikroTik WireGuard VPN For WHMCS. |
[edit] Installation
| 1. Log in to our client area and download the module. |
|
| 2. Extract the module package into the main WHMCS directory. The files should be uploaded into the corresponding WHMCS folders. |
|
| 3. When you install MikroTik WireGuard VPN For WHMCS for the first time you have to rename 'license_RENAME.php' file. The file is located in 'modules/addons/MikroikWireGuardVpn For WHMCS/license_RENAME.php'. Rename it from 'license_RENAME.php' to 'license.php'. |
|
| 4. In order to configure your license key, you have to edit the 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 our client area → 'My Products'. |
|
5. Log in to your WHMCS admin area and navigate to System Settings → Addon Modules.
The addon module can now be opened through Addons → MikroTik WireGuard VPN. |
|
[edit] MikroTik Router Preparation
|
Before connecting the router to WHMCS, make sure that:
Important: Restrict API access to trusted IP addresses whenever possible and use HTTPS for production environments. The module communicates with the router exclusively through the MikroTik RouterOS REST API. Legacy API and Winbox access are not required. |
[edit] Server Configuration
| 6. Navigate to System Settings → Servers and click Add New Server. The module uses the standard WHMCS server infrastructure. Choose MikroTik WireGuard VPN from the Module dropdown menu and provide the router connection details. |
|
|
Configure the following fields:
|
| 7. Use Test Connection to verify the provided credentials and connection settings. If the test is successful, save the server configuration. |
| 8. Create or select a server group and assign the configured MikroTik server to it. The server group can later be selected in the product's module settings. Add multiple routers when you want to distribute VPN services across a larger infrastructure. |
|
[edit] Product Configuration
| 7. Navigate to System Settings → Products/Services and create a new product or edit an existing one. Open the Module Settings tab and select MikroTik WireGuard VPN as the module. |
|
| 8. Configure the VPN service parameters. |
|
|
The available settings include:
|
| 9. Select the preferred provisioning method and save the product settings. Depending on the selected WHMCS option, the VPN account may be created automatically after the first payment, immediately after order placement, or manually by an administrator. |
[edit] Usage-Based Metric Billing
|
The Metric Billing section allows you to control which traffic metrics are billed through the native WHMCS metric billing system. Use the switch next to each metric to enable or disable billing. When enabled, the metric usage is reported to WHMCS and included in usage-based billing. Disabled metrics are not billed. Select Configure Pricing below each metric to define the included traffic allowance and the price charged for each additional gigabyte. Download and upload pricing can be configured independently for every available billing cycle. |
|
|
[edit] Management
[edit] Addon Module
|
The addon module provides a centralized overview of MikroTik servers, WireGuard accounts, traffic, and module activity. |
[edit] Dashboard
| The Dashboard opens with a configuration guide covering the main setup steps: adding a MikroTik server, configuring a product, inspecting live peers, and accessing the documentation. The statistics widgets show the numbers of configured servers, active services, suspended services, and provisioned VPN accounts. The Traffic Overview (Last 30 Days, GB) graph presents the total recorded traffic. |
|
[edit] Servers
| The Servers page lists MikroTik routers configured in WHMCS. For each entry, you can review its name, hostname, connection port, connection scheme, number of assigned services, and current status. Note: Router connection settings are managed in WHMCS System Settings → Servers. The addon page provides a centralized overview of the configured servers. |
|
[edit] Accounts
| The Accounts page lists the WireGuard peers currently available on the selected MikroTik router, including peers not created by the module. Use search and filters to locate a specific peer or narrow the list by its current state. |
|
|
For each peer, the list may include:
|
| Open a linked account to review its peer details, assigned tunnel address, connection information, and WireGuard configuration. |
|
[edit] Logs
| The 'Logs' section is where the module logs are stored. You can filter the module logs by type with the 'Show' buttons. For precise details on Logs, please refer to our dedicated documentation article, which you may find here. |
|
[edit] Translations
| Customizing language files is now extremely easy with the "Translations" tool that is now available directly in the addon. Its user-friendly design makes managing various language file tweaks a smooth and efficient process. Prepare translations for the original English files with this handy built-in tool. For specific instructions on how to use this tool please refer to its dedicated article, you will find it here. Tip: Custom translations created with this tool are preserved separately from the original language files, making them easier to maintain during module updates. |
|
[edit] Access Control
| Ensure secure and tailored access to your module with the "Access Control" tool available in ModulesGarden addons. This feature allows you to assign permissions, define resource access for administrators, and track activities with detailed logs. |
|
[edit] Admin Area
|
Open a client's product or service in the WHMCS admin area to manage the related WireGuard VPN account. |
| The service view displays whether the peer exists and is enabled, along with its assigned tunnel IP address, server endpoint, last handshake and traffic counters. Administrators can also perform the standard module commands:
|
| Use the available management actions to preview the WireGuard configuration, download the .conf file, reset the VPN interface, and review traffic statistics. Resetting the VPN interface disables and re-enables the WireGuard peer to force a new handshake (the received and sent traffic counters will be reset). The assigned keys, tunnel IP address, and configuration remain unchanged. |
|
[edit] Traffic Statistics
| The Traffic Statistics section displays two charts: Last 30 Days, showing daily traffic usage, and Monthly, showing total traffic usage aggregated by month. The metric statistics panel also displays the current download and upload totals and allows administrators to refresh the counters directly from the router. |
|
[edit] VPN Configuration
| The configuration view contains the complete connection parameters required by the WireGuard client, including the client interface settings and the remote peer details. Administrators can preview the generated configuration or download it as a ready-to-use .conf file. |
|
[edit] Client Area
|
The client area gives customers direct access to their WireGuard VPN service and the resources required to configure a connection. |
[edit] VPN Dashboard
| The main service page displays the live peer state, assigned tunnel IP address, server endpoint, last handshake, received and transmitted traffic, and applied upload and download limits. Depending on the product configuration, clients can also open the setup guide and download the WireGuard application. |
|
|
Available client actions include:
|
[edit] Configuration And QR Code
| Clients can preview the complete WireGuard configuration, including the client interface and remote peer parameters, and scan the generated QR code to quickly import the tunnel into a compatible WireGuard application. The same configuration can be downloaded as a ready-to-import .conf file.
Important: The WireGuard configuration contains sensitive connection data. Clients should store it securely and should not share it with unauthorized persons. |
|
[edit] Traffic Statistics
| The Traffic Statistics section allows clients to review the amount of uploaded and downloaded data. Statistics can be displayed in daily or monthly intervals. |
|
[edit] Reset VPN Interface
| Use Reset VPN Interface to disable and re-enable the WireGuard peer and force a new handshake. The action does not change the assigned keys, tunnel IP address, or configuration. The client must confirm it before it is performed. |
|
[edit] Cron Jobs
|
The module uses the standard WHMCS automation cron for traffic collection, metric usage reporting, and data maintenance. |
[edit] Tips
| 1. Use HTTPS and restrict RouterOS API access to the IP address of your WHMCS server. |
| 2. Configure separate MikroTik server groups when you want to distribute products between different routers or locations. |
| 3. Make sure the tunnel IP address pools assigned to different routers do not overlap unless your network design explicitly requires it. |
| 4. Enable traffic statistics only when the related RouterOS permissions and the WHMCS cron are configured correctly. |
| 5. Configure both module metric reporting and WHMCS metric pricing before offering usage-based billing to clients. |
[edit] Update Instructions
|
An essential guidance through the module update process can be found here. Important: Before updating the module, create a backup of the WHMCS files and database. Review the module changelog for version-specific requirements and migration notes. |
[edit] Upgrade Guide
| Seeking a solution that offers greater flexibility, customization tailored to your precise needs, and unrestricted availability? There is an option that not only proves to be cost-effective in the long run but also includes prioritized support services, making it a truly valuable investment. Opt for the Open Source version of your MikroTik WireGuard VPN For WHMCS module to unlock these benefits. Follow a comprehensive guide covering the transition process, the advantages it brings, and step-by-step instructions on what to do next after the order has been successfully finalized. |
[edit] Common Problems
| 1. The connection test fails. |
|
| 2. A VPN peer cannot be created. |
|
| 3. Traffic statistics are not displayed. |
|
| 4. Usage-based charges are not generated. |
|
























