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
2,354 217

Building a WireGuard VPN Server on MikroTik RouterOS v7

Introduction

Once your MikroTik router (running RouterOS v7+) has a Mozfactor Dedicated Static Public IP, you can turn it into your own central WireGuard VPN Server so remote laptops, smartphones, and branch routers can securely access your office or home network.

Step 1: Configure WireGuard Server on MikroTik

A. Create the WireGuard Interface

Open WinBox → New Terminal and run (RouterOS v7 generates the keypair automatically):

/interface/wireguard/add name=wg-server listen-port=13234
/interface/wireguard/print

Copy the generated server Public Key.

B. Assign a Local VPN Gateway IP

/ip/address/add address=10.10.10.1/24 interface=wg-server

C. Allow UDP Port 13234 in Firewall Input

/ip/firewall/filter/add chain=input protocol=udp dst-port=13234 action=accept comment="Allow WireGuard Server" place-before=0

D. Enable NAT Masquerade (Optional)

/ip/firewall/nat/add chain=srcnat src-address=10.10.10.0/24 out-interface=ether1-wan action=masquerade comment="NAT WireGuard Clients"

Step 2: Configure the WireGuard Client

  1. Open the official WireGuard app on Windows, macOS, Android, or iOS.
  2. Click Add Tunnel → Add empty tunnel... and copy the auto-generated Client Public Key.
  3. Fill in the configuration:
[Interface]
PrivateKey = <Auto_Generated_Client_Private_Key>
Address = 10.10.10.2/32
DNS = 8.8.8.8, 1.1.1.1

[Peer]
PublicKey = <MikroTik_Server_Public_Key>
Endpoint = <Your_Mozfactor_Public_IP>:13234
AllowedIPs = 0.0.0.0/0
PersistentKeepalive = 25

Step 3: Register the Client Peer on MikroTik

/interface/wireguard/peers/add interface=wg-server public-key="CLIENT_PUBLIC_KEY" allowed-address=10.10.10.2/32 comment="Admin-Laptop"

Step 4: Activate & Test

Click Activate on your client device and test pinging 10.10.10.1 or reaching your local LAN servers.