WireGuard - RouterOS - MikroTik Documentation
WireGuard - RouterOS - MikroTik Documentation
WireGuard
Property Description
Pages
Blog
Introduction
PAGE TREE
Introduction
Properties
Getting started
Read-only properties
Authentication, Authorization, Accounting
Bridging and Switching
Peers
Diagnostics, monitoring and troubleshooting
Read-only properties
Extended features Application examples
Firewall and Quality of Service Site to Site WireGuard tunnel
Hardware WireGuard interface configuration
High Availability Solutions Peer configuration
Internet of Things IP and routing configuration
IPv4 and IPv6 Fundamentals Firewall considerations
Management tools RoadWarrior WireGuard tunnel
Mobile Networking RouterOS configuration
Network Management iOS configuration
Routing
WireGuard® is an extremely simple yet fast and modern VPN
Multi Protocol Label Switching (MPLS)
that utilizes state-of-the-art cryptography. It aims to be
System Information and Utilities
faster, simpler, leaner, and more useful than IPsec while
Virtual Private Networks
avoiding massive headaches. It intends to be considerably
6to4
more performant than OpenVPN. WireGuard is designed as
EoIP
GRE
a general-purpose VPN for running on embedded interfaces
IPIP
and super computers alike, fit for many different
circumstances. Initially released for the Linux kernel, it is
IPsec
now cross-platform (Windows, macOS, BSD, iOS, Android)
L2TP
OpenVPN and widely deployable.
PPPoE
PPTP Properties
SSTP Property Description
WireGuard
comment Short description of the tunnel.
ZeroTier (string;
Default: )
Wired Connections
Wireless disabled Enables/disables the tunnel.
(yes | no;
Default: no)
Read-only properties
Property Description
public-key A base64 public key is calculated from the private key.
(string)
Peers
Property Description
allowed-address List of IP (v4 or v6) addresses with CIDR masks
(IP/IPv6 prefix;
from which incoming traffic for this peer is allowed
Default: )
and to which outgoing traffic for this peer is
directed. The catch-all 0.0.0.0/0 may be specified
for matching all IPv4 addresses, and ::/0 may be
specified for matching all IPv6 addresses.
comment (string; Short description of the peer.
Default: )
Read-only properties
Property Description
Application examples
Site to Site WireGuard tunnel
Consider setup as illustrated below. Two remote office
routers are connected to the internet and office
workstations are behind NAT. Each office has its own local
subnet, 10.1.202.0/24 for Office1 and 10.1.101.0/24 for
Office2. Both remote offices need secure tunnels to local
networks behind routers.
/interface/wireguard
add listen-port=13231 name=wireguard1
Office1
/interface/wireguard print
Flags: X - disabled; R - running
0 R name="wireguard1" mtu=1420 listen-port=13231 p
public-key="u7gYAg5tkioJDcm3hyS7pm79eADKPs/ZU
Office2
/interface/wireguard/print
Flags: X - disabled; R - running
0 R name="wireguard1" mtu=1420 listen-port=13231 p
public-key="v/oIzPyFm1FPHrqhytZgsKjU7mUToQHLr
Peer configuration
Peer configuration defines who can use the WireGuard
interface and what kind of traffic can be sent over it. To
identify the remote peer, its public key must be specified
together with the created WireGuard interface.
Office1
/interface/wireguard/peers
add allowed-address=10.1.101.0/24 endpoint-address=1
public-key="v/oIzPyFm1FPHrqhytZgsKjU7mUToQHLrW+Tb5e
Office2
/interface/wireguard/peers
add allowed-address=10.1.202.0/24 endpoint-address=1
public-key="u7gYAg5tkioJDcm3hyS7pm79eADKPs/ZUGON6/f
/ip/address
add address=10.255.255.1/30 interface=wireguard1
/ip/route
add dst-address=10.1.101.0/24 gateway=wireguard1
Office2
/ip/address
add address=10.255.255.2/30 interface=wireguard1
/ip/route
add dst-address=10.1.202.0/24 gateway=wireguard1
Firewall considerations
The default RouterOS firewall will block the tunnel from
establishing properly. The traffic should be accepted in the
"input" chain before any drop rules on both sites.
Office1
/ip/firewall/filter
add action=accept chain=input dst-port=13231 protoco
Office2
/ip/firewall/filter
add action=accept chain=input dst-port=13231 protoco
/ip/firewall/filter
add action=accept chain=forward dst-address=10.1.202
add action=accept chain=forward dst-address=10.1.101
Office2
/ip/firewall/filter
add action=accept chain=forward dst-address=10.1.101
add action=accept chain=forward dst-address=10.1.202
/interface wireguard
add listen-port=13231 name=wireguard1
/ip address
add address=192.168.100.1/24 interface=wireguard1
For the next steps, you will need to figure out the public key
of the remote device. Once you have it, add a new peer by
specifying the public key of the remote device and allowed
addresses that will be allowed over the WireGuard tunnel.
Firewall considerations
If you have default or strict firewall configured, you need to
allow remote device to establish the WireGuard connection
to your device.
iOS configuration
Download the WireGuard application from the App Store.
Open it up and create a new configuration from scratch.
No labels