WireGuard has revolutionized the way we think about VPNs. It’s faster than OpenVPN, leaner than IPsec, and significantly easier to configure. If you are running MikroTik hardware (RouterOS v7+), setting up a secure tunnel between two locations is now a 10-minute task.
In this guide, we’ll walk through connecting Site A (Headquarters) to Site B (Branch Office).
The Network Map
To keep things clear, let’s define our environment:
| Detail | Site A (HQ) | Site B (Branch) |
| Public IP | 1.1.1.1 | 2.2.2.2 |
| Local LAN | 192.168.10.0/24 | 192.168.20.0/24 |
| WireGuard IP | 10.0.0.1/30 | 10.0.0.2/30 |
| Listen Port | 13231 | 13231 |
Step 1: Create the WireGuard Interface
First, we need to create the “virtual” interface on both routers.
On Site A:
- Navigate to WireGuard in the main menu.
- Click + to add a new interface.
- Name it
wireguard-site-band set the port to13231. - Click OK. The router will automatically generate your Private and Public keys.
On Site B:
- Repeat the process. Name it
wireguard-site-aand use the same port13231. - Crucial: Copy the Public Key from Site B; you will need to paste it into Site A’s configuration (and vice versa).
Step 2: Assign IP Addresses to the Tunnel
The tunnel itself needs its own tiny network to “talk” across.
- Site A: Go to
IP > Addresses. Add10.0.0.1/30to thewireguard-site-binterface. - Site B: Go to
IP > Addresses. Add10.0.0.2/30to thewireguard-site-ainterface.
Step 3: Link the Peers
This is where we tell Site A how to find Site B.
On Site A:
- In the WireGuard menu, go to the Peers tab.
- Interface:
wireguard-site-b - Public Key: (Paste Site B’s Public Key here)
- Endpoint:
2.2.2.2(Site B’s Public IP) - Endpoint Port:
13231 - Allowed Address:
10.0.0.2/32,192.168.20.0/24(This allows the tunnel IP and the remote LAN).
On Site B:
- In the Peers tab, add a new peer.
- Interface:
wireguard-site-a - Public Key: (Paste Site A’s Public Key here)
- Endpoint:
1.1.1.1(Site A’s Public IP) - Endpoint Port:
13231 - Allowed Address:
10.0.0.1/32,192.168.10.0/24
Step 4: Routing and Firewall
Even if the tunnel is “Up,” your computers won’t know how to reach the other side without a map.
1. Static Routes:
- Site A: Go to
IP > Routes. Add a route for192.168.20.0/24with the gatewaywireguard-site-b. - Site B: Go to
IP > Routes. Add a route for192.168.10.0/24with the gatewaywireguard-site-a.
2. Firewall (The Handshake):
You must allow the WireGuard port through your input filter so the routers can talk.
IP > Firewall > Filter Rules: Add a rule, Chain:input, Protocol:udp, Port:13231, Action:accept. Move this to the top of your list.
Final Check
Go to the WireGuard > Peers tab. You should see “Last Handshake” updating every few minutes and “Tx/Rx” traffic increasing. If you can ping 192.168.20.1 from Site A, your site-to-site bridge is officially live!
Pro-Tip: If one of your sites has a dynamic IP, only set the Endpoint on the router with the static IP. The dynamic site will initiate the connection, and WireGuard will “learn” its address automatically.
