Connecting Android and IOS to WireGuard VPN hosted in MikroTik

This guide covers connecting your Android or iPhone to a WireGuard VPN server running on a MikroTik Cloud Hosted Router (CHR) or any physical MikroTik device running RouterOS v7. If you have not set up the server yet, start with our WireGuard server setup guide. It only takes a few minutes..


1
Install the WireGuard app on your phone

Download the official WireGuard client from your app store. Any WireGuard-compatible client will work, but the official apps from the WireGuard team are the most reliable and kept up to date.

WireGuard app listing in the Google Play Store by WireGuard Development Team

Android: WireGuard on Google Play

WireGuard app in the Apple App Store

iPhone / iOS: WireGuard on the App Store

2
Create a peer on the MikroTik CHR

In WinBox or WebFig, go to WireGuard > Peers and click + to add a new peer. Each peer represents one device that connects to your VPN. Fill in the following fields:

  • Name (RouterOS 7.15+) - give it a recognisable name, e.g. Android1 or iPhone-Work
  • Interface - select your WireGuard interface (e.g. wg1)
  • Private Key - set to auto - RouterOS will generate the key pair for you
  • Allowed Address & Client Address - the IP address that will be assigned to this device; must be within your WireGuard subnet (e.g. 192.168.34.2/32)
  • Client DNS - the DNS server the device will use; you can enter a public DNS like 1.1.1.1, or the address of a local resolver running on your CHR
  • Client Endpoint - your CHR's public IP address or domain name
  • Client Allowed Address (RouterOS 7.21+) - set to 0.0.0.0/0 to route all traffic through the VPN, or specific IP addresses/networks in CIDR format for partial tunneling.

RouterOS WinBox - WireGuard > Peers > New dialog with Name=Android1, Interface=wg1, Private Key=auto, Allowed Address=192.168.34.2/32, Client Address, DNS and Endpoint fields filled in; overlay note warning that RouterOS 7.21 and newer requires the Client Allowed Address (IPv4) field or the connection will not work

RouterOS 7.21 and newer: The default value for new peers is ::/0. You must fill in the Client Allowed Address field (0.0.0.0/0 for full traffic redirect). Without it, the connection will fail silently — the tunnel will appear to connect but no traffic will pass through.

Click OK to save the peer. RouterOS will automatically generate the key pair and build the client configuration. Scroll down in the peer dialog to see the Client Config section. This is what you will use to configure the device.

WinBox WireGuard peer dialog showing the auto-generated Client Config section with [Interface] and [Peer] blocks (ListenPort, PrivateKey, Address, DNS, PublicKey, AllowedIPs, Endpoint) and a Client QR code area below it

CLI users can add, list, and print the configurationof each peers with QR code using the following commands (you will need a large terminal window to render the QR code):

RouterOS CLIinterface wireguard peers add interface=wg1 private-key=auto allowed-address=192.168.34.2/32 client-address=192.168.34.2/32 client-dns=1.1.1.1 client-endpoint=yourmchr.ip name="Android1"(ROS 7.15+) client-allowed-address="0.0.0.0/0"(ROS 7.21+)

List all peers:
interface wireguard peers print

List peer's configuration with QR code:
interface wireguard peers show-client-configuration 0 show-sensitive

3
Method 1 - Import by scanning the QR code

This is the quickest method. RouterOS generates a QR code directly inside the peer dialog and you just scan it from your phone. No file transfers needed.

Open the WireGuard app on your phone and tap the + button. It's in the bottom-right corner on Android and the top-right corner on iOS. From the menu that appears, choose Scan from QR code.

Android WireGuard app, the + button highlighted in the top right corner and the add-tunnel menu open showing Import from file or archive, Scan from QR code (highlighted), and Create from scratch options

Allow the app to use the camera when prompted, then point your phone at the QR code shown in the WinBox peer dialog. Once it is detected, you will be asked to give the tunnel a name. Name it however you like and tap Create Tunnel.

Android WireGuard app, Import Tunnel from QR Code dialog with Tunnel Name field containing BGOcloud-VPN and the Create Tunnel button highlighted

iOS only: after saving the tunnel, iOS will show a system prompt asking WireGuard permission to add VPN configurations. Tap Allow to proceed. This is a standard iOS security requirement for all VPN apps.

iOS system alert, WireGuard Would Like to Add VPN Configurations, stating that all network activity on this iPhone may be filtered or monitored when using VPN, with Allow button highlighted and Don't Allow option

Once the tunnel is imported, tap the toggle next to it to test the connection. The tunnel should activate within a second or two.

Android WireGuard app showing the BGOcloud-VPN tunnel entry with the toggle switch highlighted, ready to activate the VPN connection

Android only: the first time you activate a VPN tunnel, Android will show a connection request dialog explaining that WireGuard will be able to monitor network traffic. Tap OK to allow it. This is a standard Android VPN permission.

Android Connection request dialog

If you have a working internet connection after enabling the tunnel, the setup is complete. If not and the traffic counters report ~92 bytes are received, not kilobytes, double-check the peer settings on the CHR. Particularly that the firewall rule for the WireGuard port is above any drop rules, and that the NAT masquerade rule is in place and that the right allowed IPs are set.


4
Method 2 - Import from a .conf file

This method is useful when you want to distribute a ready-made configuration file to users, or when the QR code is not practical (e.g. remotely configuring a device). Create a plain text file with the .conf extension and paste in the following template, filling in your own values:

WireGuard .conf template[Interface]
PrivateKey = <copy from the WireGuard app or use the one RouterOS generated>
Address = 192.168.34.2/32
DNS = 1.1.1.1

[Peer]
PublicKey = <public key of the WireGuard interface on your CHR>
AllowedIPs = 0.0.0.0/0, ::/0
Endpoint = yourmchr.ip:13231
Tip: If you used private-key=auto when creating the peer, RouterOS already generated a key pair. You can find the private key in the Client Config section of the peer dialog in WinBox. Otherwise, generate a fresh key pair inside the WireGuard app and copy the public key to the peer on the CHR manually.

Transfer the .conf file to your phone - via AirDrop, email, cloud storage, or any other method. Then import it into WireGuard.

Android: open the WireGuard app, tap + and choose Import from file or archive. Locate the file and open it.

Android WireGuard app, the + add button highlighted, showing the add-tunnel menu with Import from file or archive option highlighted, alongside Scan from QR code and Create from scratch

iPhone / iOS: locate the .conf file in Files or your Downloads folder, tap the Share button, and choose WireGuard from the share sheet. The tunnel will be imported automatically with the filename as its name.

iOS Share sheet for a WireGuard .conf file named BGOcloudVPN, showing AirDrop, WireGuard app (highlighted), Messages, and Mail as share targets

Once imported, tap the toggle to activate the tunnel and test the connection. If everything is configured correctly you will have full internet access routed through your BGOCloud MikroTik CHR.


Don't have a MikroTik CHR yet? BGOCloud's MikroTik VPS plans give you a fully licensed RouterOS v7 instance deployed in under a minute — perfect for running your own private WireGuard VPN server. Everything in this guide works out of the box.

Get Powerful MikroTik CHR VPS with unlimited traffic.

Get Started!
icon knowledge

Related Articles

Set up OpenVPN in Windows

This guide shows you how to connect a Windows PC or Mac to an OpenVPN server running on a...

OpenVPN Access Server: Setting Up Multi-Factor Authentication

In this guide, we will show you how to set up Multi-Factor Authentication(MFA) for your OpenVPN...

Setup OpenVPN Connect Client in iPhone iOS

This guide walks you through connecting your iPhone or iPad to an OpenVPN server running on a...

BGOcloud WireGuard VPN Service: Quickstart guide

The BGOcloud VPN is a new VPN service that is easy to connect to with just one click or a tap....