MikroTik Integration

Connect your MikroTik router to Qserve Billing with a single terminal command.

Overview

Qserve Billing communicates with your MikroTik router over a secure WireGuard VPN tunnel. Once the tunnel is up, Qserve can provision PPPoE profiles, manage hotspot sessions, send CoA (Change of Authorization) signals to disconnect or reconnect subscribers, and monitor router health — all in real time.

The entire setup is handled by a single script you run once in the MikroTik terminal.

Prerequisites

  • MikroTik router running RouterOS 6.45+ or 7.x
  • Router connected to the internet (any WAN type: DHCP, PPPoE, static)
  • Terminal access: WinBox, SSH (ssh admin@router-ip), or Telnet
  • A Site and Router already created in your Qserve dashboard (see Sites & Routers)

Step 1 — Get the Installation Command

  1. In your Qserve dashboard, go to Sites and open your site.
  2. Find the router in the list and click Install.
  3. On the installation page, copy the command displayed. It looks like:
/tool fetch url="https://qserve-isp.net/downloads/mikrotik/set-vpn/abc123" \
  dst-path=qserve-setup.rsc; /import qserve-setup.rsc

Step 2 — Open the MikroTik Terminal

Connect using one of these methods:

  • WinBox: Connect to the router → click New Terminal in the toolbar
  • SSH: ssh admin@192.168.88.1 (replace with your router's IP)
  • WebFig: Open the router's web interface → Terminal menu

Step 3 — Run the Script

Paste the command into the terminal and press Enter. The script will:

  1. Download the Qserve configuration file from the cloud
  2. Create a WireGuard interface and peer pointing to Qserve's server
  3. Configure PPPoE server profiles and user templates
  4. Set up IP pools linked to your Qserve IP pools
  5. Add firewall rules to allow VPN traffic
  6. Register the router with Qserve's management system

The script takes about 60–120 seconds to complete. You will see progress output in the terminal.

When the script finishes, the router status in your dashboard should change to Online within 30 seconds.

What the Script Configures

ComponentDescription
WireGuard VPNSecure tunnel between router and Qserve management server
PPPoE ServerPPPoE service profile bound to the local LAN bridge
RADIUS ClientPoints to Qserve's RADIUS server for subscriber authentication
IP PoolsAddress pools for PPPoE and DHCP subscribers
Firewall RulesAllows VPN and RADIUS traffic, blocks direct management access from untrusted sources
SchedulerA keepalive script that reconnects the VPN if it drops

Verifying the Connection

In the MikroTik terminal, run:

/interface wireguard peers print

You should see the peer with a recent last-handshake time (within the last few minutes).

# Expected output:
 0 name="qserve-peer" endpoint-address=51.195.110.5 endpoint-port=13231
   last-handshake=1m30s rx=12KiB tx=8KiB

Troubleshooting

Router shows "Offline" after running the script

  • Check that UDP port 13231 is not blocked by your upstream firewall.
  • Verify the router has a working internet connection: /tool fetch url="https://qserve-isp.net" keep-result=no
  • Re-run the install script — it is safe to run multiple times (idempotent).

Script fails to download

  • Check DNS resolution: /ip dns cache print
  • Try a manual DNS test: /tool fetch url="https://1.1.1.1" keep-result=no
  • Ensure /tool fetch is available (some minimal RouterOS builds omit it — upgrade RouterOS).

WireGuard peer shows no handshake

  • Confirm the router's public IP can reach 51.195.110.5:13231 (UDP).
  • Some ISPs block non-standard UDP ports — contact your upstream provider.
  • Try restarting the WireGuard interface: /interface wireguard disable qserve-vpn; /interface wireguard enable qserve-vpn

Need help with a specific router model or network configuration? Chat with support on WhatsApp.