This is an old revision of the document!
Mikrotik WireGuard Site to Site VPN
Both Ends Static
One End Dynamic
Server (Static IP)
CPE (Dynamic IP)
Using Winbox
Here we configure a RB3011UiAS-RM client router on RouterOS 7.10 reset to factory defaults using Winbox.
First we configure the admin
password:
Use Quick Set for basic router configuration:
Create the WireGuard VPN interface:
The name of the interface is arbitrary and we use the default here
The MTU matters, but we use the default here
The
UDP listen port probably doesn't matter, but we use the same port as on the server here
This CPE router
must initiate the VPN connections because it has a dynamic IP and is behind Carrier Grade
NAT (double
NAT)
In at least one case, the default
UDP port 13231 was blocked by the ISP
You may need to find a
UDP port that is not blocked by your ISP and use it on the server
Define a WireGuard VPN peer:
The peer is the remote WireGuard endpoint (server, router)
The public key is the public key from the remote WireGuard endpoint
The endpoint address is the static public IP address of the remote WireGuard endpoint (server)
The endpoint port is the
UDP listen port of the
remote WireGuard endpoint
The allowed address is a list of remote IP addresses on or behind the remote WireGuard endpoint
The persistent keepalive is a timer to send an empty packet accross the tunnel to keep it open
Show a connected peer:
Add an IP address to the WireGuard interface:
Add a static route for remote IP subnet behind peer:
At this point, you should be able to ping devices to or from the subnets behind either router.
Note that Windows workstations do not respond to pings by default, but will if you temporarily disable the firewall. Don't forget to turn it back on when you are done testing!