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

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

Network Topology

arrow-up-right

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.

1

Router 2 (Site B) configuration

Step 1 — Access Mikrotik Router

Log in to the Mikrotik router.

2

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.

3

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).

4

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.

5

Router 2 — Step 5: Configure Routes

  • Go to IP > Routes.

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

6

Router 2 — Step 6: Add a NAT Rule

  • Navigate to IP > Firewall > NAT tab.

  • Add a new NAT rule as required.

Ping test

chevron-rightPing from Router A to Router B VPChashtag
chevron-rightPing from Router B to Router A VPChashtag

Last updated

Was this helpful?