Set up GemiGuard VPN on MikroTik RouterOS 7
Upload your configuration file, a small file with your connection settings, to the router and import it. Every device behind the router then goes through GemiGuard VPN.
Tested on RouterOS 7.25.1 on 7 November 2026.
Before you start
- RouterOS 7.19 or later for the configuration file import. On older RouterOS 7, use the manual setup further down.
- Access to WebFig or WinBox and its Terminal.
- The default configuration with the WAN interface list, as MikroTik ships its home routers.
- A GemiGuard VPN account with time on it. The router uses one of your five device slots.
Steps
Download a configuration file for the router
In your account, open Devices and choose Add device. Give it a name such as
MikroTik, keep Create the key in this browser (download a configuration file) and add it.Download the configuration file of the server you want. The file is named after the server, for example
frankfurt1.conf.Upload the file
In WebFig, open Files and click Upload under Actions, then choose the
.conffile. Upload only one.conffile: the next command imports the one it finds.
Import it
Open Terminal and paste this line:
/interface/wireguard/wg-import config-file=[/file/get [find name~"\\.conf\$"] name]
Name the interface
This renames the new interface to
gemiguard, so the following commands find it:/interface/wireguard/set [find name~"^wg[0-9]+\$"] name=gemiguardIf you already use other WireGuard interfaces on this router, run
/interface/wireguard/printand rename only the new one.Send all traffic through the tunnel
Paste these three lines one after another. The first keeps the route to our server on your normal connection, using the server address from the import and your current gateway. The other two send everything else through
gemiguard./ip/route/add dst-address=[/interface/wireguard/peers/get [find interface=gemiguard] endpoint-address] gateway=[/ip/route/get [find dst-address=0.0.0.0/0 active] gateway] comment=gemiguard-server /ip/route/add dst-address=0.0.0.0/1 gateway=gemiguard comment=gemiguard /ip/route/add dst-address=128.0.0.0/1 gateway=gemiguard comment=gemiguard
Treat the tunnel as WAN and set DNS
The first line adds
gemiguardto the WAN list, so the default firewall and masquerade rules cover it. The second makes the router use 1.1.1.1./interface/list/member/add list=WAN interface=gemiguard /ip/dns/set servers=1.1.1.1
Check that it works
- In your account, open Devices: Last connected for the router shows a time from the last minute or two.
- On a computer behind the router, open ip.gemiguard.com: it shows your public IP address, which should be the address of the server you chose.
- In the Terminal,
/interface/wireguard/peers/print detailshows the rx counter growing.
If the tunnel goes down
The two routes through gemiguard stay in place while the tunnel reconnects, so all traffic waits for the VPN.
Manual setup for RouterOS older than 7.19
- Create the interface in the Terminal:
/interface/wireguard/add name=gemiguard mtu=1420 - Show its public key with
/interface/wireguard/print. In your account, add a device, choose Use my device’s public key and paste it. - Open Server details for manual setup for the server you want. In WebFig, open WireGuard, Peers, New: interface
gemiguard, the server public key, the preshared key, the endpoint address and port from Server details, allowed address0.0.0.0/0and persistent keepalive25s. - Open IP, Addresses, New: your device address from the account with /32, interface
gemiguard. - Then continue with steps 5 and 6 above.
Troubleshooting
- The import answers
bad parameter file - RouterOS 7.25 calls the parameter
config-file, as in step 3. Older MikroTik documentation showsfile=. - RouterOS does not know
wg-import - It needs RouterOS 7.19 or later. Upgrade, or use the manual setup above.
- Devices behind the router have no internet
- Check that
gemiguardis in the WAN list (/interface/list/member/print) and that the default masquerade rule exists (/ip/firewall/nat/printshowsout-interface-list=WAN). - I want another server
- Remove the setup with the commands below. Choose New key on the device in your account, download that server’s configuration file and repeat steps 2 to 6.
Switch it off
Paste these lines to remove everything the guide added:
/ip/route/remove [find comment~"gemiguard"]
/interface/list/member/remove [find interface=gemiguard]
/ip/address/remove [find interface=gemiguard]
/interface/wireguard/peers/remove [find interface=gemiguard]
/interface/wireguard/remove [find name=gemiguard]
/ip/dns/set servers=""Get a configuration file for your router
One device slot covers every device behind the router. 6 months cost 29 USDT, 12 months 49 USDT, 24 months 79 USDT.
Guides for other routers
- OpenWrt
- Teltonika RutOS
- GL.iNet Mudi 7 (GL-E5800)
- GL.iNet Opal (GL-SFT1200)
- GL.iNet Flint 4 (GL-BE14000)
- GL.iNet Slate 7 Pro (GL-BE10000)
- GL.iNet Flint (GL-AX1800)
- GL.iNet Mango 2 (GL-MG1300)
- GL.iNet Mudi v2 (GL-E750V2)
- GL.iNet Puli (GL-XE300)
- GL.iNet Mango (GL-MT300N-V2)
- GL.iNet Shadow (GL-AR300M16)
- GL.iNet Flint 3e (GL-BE6500)
- GL.iNet Flint 3 (GL-BE9300)
- GL.iNet Beryl 7 (GL-MT3600BE)
- GL.iNet Flint 2 (GL-MT6000)
- GL.iNet Slate 7 (GL-BE3600)
- GL.iNet Beryl AX (GL-MT3000)
- GL.iNet Spitz AX (GL-X3000)
- GL.iNet Puli AX (GL-XE3000)
- GL.iNet Spitz Plus (GL-X2000)
- All router guides