How-To: Configuring WireGuard in MikroTik CHR - Faster and secure VPN protocol

How to set up a WireGuard VPN server on a MikroTik CHR — BGOCloud guide

If you are looking to set up a fast, modern VPN server on your MikroTik router or Cloud Hosted Router (CHR), WireGuard is currently the best choice available. Compared to older protocols like PPTP, L2TP, and even OpenVPN, WireGuard is leaner, faster, and genuinely easier to configure — especially on a BGOCloud MikroTik CHR instance running RouterOS v7.

This guide walks you through the complete WireGuard server setup on MikroTik — from updating RouterOS all the way to firewall rules and NAT masquerading — using WinBox, WebFig, or the RouterOS CLI. The same steps apply to physical MikroTik devices running RouterOS v7 on x86 or ARM hardware.

Why WireGuard instead of OpenVPN, PPTP, or L2TP?

WireGuard is a modern, actively developed VPN protocol that solves a lot of the practical headaches that come with running older VPN solutions. Here is how it stacks up:

  • Faster connections and higher throughput — WireGuard operates in the kernel space and uses a much slimmer codebase than OpenVPN, translating into noticeably better real-world speeds.
  • Simpler setup, especially on a CHR — No IP pools, no PPP profiles, no secrets, no certificates. You create an interface, assign an IP, add peers, and you are done.
  • State-of-the-art encryption — WireGuard uses Curve25519 for key exchange and ChaCha20-Poly1305 for traffic encryption. These are modern, audited algorithms considered resistant to quantum computing attacks — something older protocols cannot claim.
  • Key-based authentication, no passwords — There are no usernames or passwords to manage. Access is controlled entirely by cryptographic public/private key pairs, which eliminates a whole category of brute-force attacks.
  • No SSL certificates required — Unlike OpenVPN and SSTP, WireGuard does not need a Certificate Authority, server certificates, or client certificates. This makes disaster recovery and rebuilds significantly faster.
  • Cross-platform support — Official WireGuard clients are available for Windows, macOS, Linux, Android, and iOS, so connecting any device to your VPN server is straightforward.
  • Harder to block and firewall-friendly — WireGuard uses UDP and can run on any port, unlike PPTP and L2TP which use well-known ports that are frequently blocked by ISPs and corporate firewalls. It is also fully NAT-friendly.
  • Fewer disconnections — WireGuard handles network changes (switching from Wi-Fi to mobile data, for example) much more gracefully than L2TP, which tends to drop and require manual reconnection.
  • Lower resource usage — WireGuard uses less CPU and RAM than OpenVPN, which matters a lot on smaller BGOCloud CHR plans where resources are shared.

All BGOCloud MikroTik CHR plans support WireGuard natively starting from RouterOS v7. If you are still on RouterOS v6, step one of this guide covers the upgrade.

What you will need

  • A BGOCloud MikroTik CHR, or any physical MikroTik device running on x86 or ARM hardware. Other architectures are supported too, though you might get really slow speeds and 100% CPU usage. If you do not have one yet, you can check our CHR plans and get one deployed in under a minute.
  • A private IP network subnet to assign to the WireGuard interface and its peers. We will use 192.168.34.0/24 throughout this guide.
  • One or more client devices that you want to connect to the VPN server.

1
Update RouterOS to v7

WireGuard support in RouterOS was introduced in version 7. If your CHR or MikroTik device is already running RouterOS v7, you can skip this step. If you are still on v6, you need to upgrade before the WireGuard menu will appear.

In WinBox or WebFig, go to System > Packages and click Check for Updates.RouterOS Package Manager in WinBox — System > Packages window with Check For Updates button highlighted, showing the current RouterOS version installed on a MikroTik CHR

Upgrading from v6? You cannot jump directly from RouterOS v6 to the latest v7. First switch the channel to Upgrade to install v7.12.1, then check for updates a second time on the Stable channel to get the most current version.

Alternatively, you can run the update from the CLI:

RouterOS CLIsystem package update check-for-updates
system package update download
system reboot
2
Create the WireGuard interface

In WinBox or WebFig, open the WireGuard menu from the sidebar and click the + NEW button to add a new interface. Give it a descriptive name, or leave the default wg1. For the listen port, you can enter any unused, non-reserved port number. If you leave it blank, RouterOS will pick one automatically when you save. Click OK to create the interface.

If you plan to run multiple WireGuard interfaces on the same CHR, for example to separate different client groups, you can add a comment to each interface to keep things organised.

Creating a new WireGuard interface in MikroTik WinBox — WireGuard > New dialog with interface name wg1 and listen port field visible, RouterOS v7 CHR

RouterOS CLIinterface wireguard add listen-port=13231 name=wg1

Next, assign an IP address to the WireGuard interface. Go to IP > Addresses, click + NEW, and enter the first usable address of your chosen private subnet. In this example we are using 192.168.34.1/24. Select your newly created WireGuard interface from the dropdown and save. The remaining addresses in that subnet (.2, .3, etc.) will be assigned manually to each peer (client) later.

Assigning the IP address 192.168.34.1/24 to the WireGuard interface wg1 in RouterOS — IP > Addresses > New dialog on a MikroTik CHR

RouterOS CLIip address add address=192.168.34.1/24 interface=wg1
3
Configure firewall rules for WireGuard

If your CHR has a restrictive firewall, which we strongly recommend, as described in our MikroTik CHR basic security guide, you need to explicitly allow inbound traffic on the WireGuard UDP port, otherwise all connection attempts will be silently dropped.

Go to IP > Firewall > Filter Rules, click + NEW, and create a new rule with the following settings:

  • Chain: input
  • Protocol: UDP
  • Dst. Port: the listen port you set in Step 2 (default: 13231)
  • Action: accept
  • Comment: WireGuard pass

Creating a WireGuard firewall accept rule in MikroTik RouterOS — IP > Firewall > Filter Rules, chain input, UDP protocol, destination port 13231, action accept

Save the rule, then drag it above any drop or reject rules in the list. If you put it too low, the drop rules will match incoming WireGuard packets before the accept rule gets a chance to process them.

Animation showing a WireGuard firewall accept rule being dragged above the drop-all rule in the MikroTik WinBox firewall filter list

From the CLI, use place-before to insert the rule above your existing drop rules. Adjust the port number to match your configuration:

RouterOS CLIip firewall filter add chain=input action=accept comment="WireGuard pass" protocol=udp dst-port=13231 place-before=1

Now set up NAT masquerading so that VPN clients can reach the internet through the CHR. Go to IP > Firewall > NAT, click + NEW, and create a new rule:

  • Chain: srcnat
  • Out. Interface: ether1 (or whichever interface has your WAN / internet connection)
  • Action: masquerade

Creating a NAT masquerade rule in MikroTik RouterOS — IP > Firewall > NAT, chain srcnat, out-interface ether1, action masquerade, to give WireGuard VPN clients internet access

RouterOS CLIip firewall nat add chain=srcnat out-interface=ether1 action=masquerade
4
Additional firewall rules for internal services (e.g. Pi-Hole DNS)

This step is only needed if you want WireGuard clients to access services running directly on the CHR — for example, if you are using the CHR as your DNS server, or if you are running an internal DNS resolver like Pi-Hole inside a Docker container, as covered in our Docker and Pi-Hole on MikroTik CHR guide.

By default, a restrictive firewall will block traffic originating from the WireGuard subnet from reaching other services on the router itself (DNS, HTTP, etc.). The rule below creates an explicit exception for the entire WireGuard network.

Go to IP > Firewall > Filter Rules, click +, and enter:

  • Chain: input
  • Src. Address: your WireGuard subnet — in our example, 192.168.34.0/24
  • Action: accept
  • Comment: Allow access from WireGuard network

Creating a second WireGuard firewall rule in MikroTik RouterOS — IP > Firewall > Filter Rules, chain input, src-address 192.168.34.0/24, action accept, to allow WireGuard clients to reach internal CHR services
Save, then drag this rule above the drop rules just like you did with the WireGuard port rule.

RouterOS CLIip firewall filter add chain=input action=accept src-address=192.168.34.0/24 comment="Allow access from WireGuard network" place-before=1

Your WireGuard VPN server is now fully configured and running on your MikroTik CHR. The next step is adding peers — the individual client devices that will connect to it. WireGuard uses a peer-based model, so each device gets its own key pair and a manually assigned IP address from your WireGuard subnet.

Need a MikroTik CHR to run this on? BGOCloud's MikroTik VPS plans give you a fully licensed RouterOS v7 instance with root access, SSD storage, and unlimited traffic options — deployed in under a minute. Everything in this guide works out of the box on our CHR instances, with no extra configuration needed on our end.

You can also browse our full MikroTik CHR knowledge base for more guides on getting the most out of your router.

Expertly create, route, and secure your bespoke virtual network with our MikroTik solutions.

Get Started!
icon knowledge

Related Articles

Setup Secure VPN access between client and server

  This guide will describe one of the many possible usages of MikroTik CHR and Virtual Private...

MikroTik CHR: How to set-up The Dude Monitoring

This article will help You deploy cloud-based network and infrastructure monitoring tool: The...

Set UP L2TP over IPSec VPN client on macOS (+ video)

Hello,In this article, we will show you how to set up VPN connection L2TP over IPSec to your...

How-To: Configuring Adlists in Mikrotik routers

In this article we will show you how to quickly set up an adblocker on your MikroTik device. This...