For the complete documentation index, see llms.txt. This page is also available as Markdown.

Site-to-Site VPN with Mikrotik router using wg plugin

Site-to-Site VPN with Mikrotik router using wg plugin

Network Topology

Configuration Steps

1

Router 1 (Site A) configuration

Step 1 — Access Mikrotik Router

Log in to the Mikrotik router.

Step 2 — Create WireGuard Interface

  • Go to Interfaces > Add New > WireGuard.

  • Configure the following: Name, Listen Port. Private and public keys will be generated automatically.

Click Apply and OK.

2

Router 1 — Step 3: Set IP Address for WireGuard Interface

  • Navigate to IP > Addresses.

  • Add a new IP address for the WireGuard interface (wg-client).

3

Router 1 — Step 4: Add WireGuard Peer

  • Go to WireGuard > Peers.

  • Add a new peer for Site A.

4

Router 1 — Step 5: Configure Routes

  • Go to IP > Routes.

  • Add a route to Site B’s local network through the WireGuard interface.

5

Router 1 — Step 6: Add a NAT Rule

  • Navigate to IP > Firewall > NAT tab.

  • Add a new NAT rule as required.

6

Router 2 (Site B) configuration

Step 1 — Access Mikrotik Router

Log in to the Mikrotik router.

7

Router 2 — Step 2: Create WireGuard Interface

  • Go to Interfaces > Add New > WireGuard.

  • Configure Name, Listen Port. Private and public keys will be generated automatically.

Click Apply and OK.

8

Router 2 — Step 3: Set IP Address for WireGuard Interface

  • Navigate to IP > Addresses.

  • Add a new IP address for the WireGuard interface (wg-plugin).

9

Router 2 — Step 4: Add WireGuard Peer

  • Go to WireGuard > Peers.

  • Add a new peer for Site B which is Site A using its public key.

10

Router 2 — Step 5: Configure Routes

  • Go to IP > Routes.

  • Add a route to Site A’s local network through the WireGuard interface.

11

Router 2 — Step 6: Add a NAT Rule

  • Navigate to IP > Firewall > NAT tab.

  • Add a new NAT rule as required.

Ping test

Ping from Router A to Router B VPC
Ping from Router B to Router A VPC

Last updated

Was this helpful?