Mozfactor
Sign In Register

Setup Guides & Documentation

21 Guides

Step-by-step setup tutorials for Static Public IP, WireGuard, L2TP/SSTP, and complete Client Area feature guides.

All Guides Installation Guides ~2 min read
3,107 239

Setting Up WireGuard Public IP on a MikroTik Router (RouterOS v7)

Quick Setup — Zero Manual Typing (Ready-Made RouterOS v7 Script!)

You do not need to generate keys or build WireGuard peers manually. Your complete MikroTik WireGuard Script (with Private/Public Key, Endpoint, Mangle & Route, and DST-NAT) is ready to copy inside Client Area → My Services → Service Detail. Just click Copy Script and paste into RouterOS v7 New Terminal. The step-by-step guide below remains available as a reference.

Introduction

WireGuard runs natively in the MikroTik RouterOS v7 kernel, delivering lower latency, higher throughput, instant handshakes, and minimal CPU load compared to legacy VPN protocols.

Note: Requires RouterOS v7 or newer. For RouterOS v6 routers, please follow our L2TP/SSTP guide.

Method 1: 1-Click Auto Script (Recommended)

  1. Log in to the Mozfactor Client Area and open your WireGuard Service Detail page.
  2. Click Copy Script under the MikroTik Terminal Script (v7) tab.
  3. Open WinBox → New Terminal, paste the script, and press Enter.
  4. If routing local servers through the Public IP, also paste the WireGuard Mangle & Route Script from the same page.

Method 2: Manual Step-by-Step Setup

1. Create the WireGuard Interface

/interface wireguard
add name=wg-mozfactor listen-port=13231 mtu=1420 private-key="YOUR_PRIVATE_KEY"

2. Assign the Tunnel IP Address

/ip address
add address=YOUR_TUNNEL_IP/24 interface=wg-mozfactor

3. Add the Mozfactor Server Peer

/interface wireguard peers
add interface=wg-mozfactor public-key="SERVER_PUBLIC_KEY" endpoint-address=SERVER_HOST endpoint-port=SERVER_PORT allowed-address=0.0.0.0/0 persistent-keepalive=25s

4. Enable NAT Masquerade (Optional for Outbound LAN Traffic)

/ip firewall nat
add chain=srcnat action=masquerade out-interface=wg-mozfactor src-address=192.168.88.0/24

5. Configure DNS Servers

/ip dns
set servers=8.8.8.8,1.1.1.1 allow-remote-requests=yes

Verification

  1. Open WireGuard → Peers in WinBox and verify that Last Handshake updates within seconds and Rx / Tx counters increase.
  2. Check the live telemetry card on your Client Area Service Detail page — it should show Connected (Online).