MikroTik & VPN

WireGuard VPN on MikroTik CHR

Create a WireGuard server on RouterOS 7 and connect laptops or phones. · 6 min read

1. Create the interface

/interface wireguard add name=wg0 listen-port=13231
/ip address add address=10.10.10.1/24 interface=wg0

Copy the public key: /interface wireguard print.

2. Add a peer (client)

Generate keys in the WireGuard app on the client, then:

/interface wireguard peers add interface=wg0 public-key="CLIENT_PUBLIC_KEY" allowed-address=10.10.10.2/32

3. NAT for internet access

/ip firewall nat add chain=srcnat src-address=10.10.10.0/24 out-interface=ether1 action=masquerade

4. Client configuration

[Interface]
PrivateKey = CLIENT_PRIVATE_KEY
Address = 10.10.10.2/32
DNS = 1.1.1.1

[Peer]
PublicKey = SERVER_PUBLIC_KEY
Endpoint = YOUR_CHR_IP:13231
AllowedIPs = 0.0.0.0/0
PersistentKeepalive = 25

Open UDP port 13231 in the input firewall (see first login).

Order a server built by real engineers or talk to our team — we are online 24/7. Support →

MikroTik & VPN

All tutorials

Ready to launch your project?

Order a server built by real engineers or talk to our team — we are online 24/7.