Community discussions

MikroTik App
 
loca995
newbie
Topic Author
Posts: 41
Joined: Wed Sep 01, 2021 10:31 am
Location: Italy

RouterOS 7 - Wireguard site-to-site over multiple wans

Mon Feb 14, 2022 10:04 am

Good morning everyone,
I tried to setup a lab environment with 2 virtual CHR in order to simulate a BO to HQ scenario and testing the wireguard feature.
I am new to wireguard so I don't have any knowlegde about this topic.

I have two Wans on BO and two Wans on HQ.
I created the first wireguard tunnel over the first wan for each site and everything works correctly.

When I tried to setup the second wireguard peer, Mikrotik didn't allow me.
The error was something like "the peer already exists". I guess it's because the peer public key it's the same as the first peer.

If I want to have active redundancy between to sites, is it possible with Wireguard?
I mean, I want to manage my routes based on wan capabilities.
I usually performed it with a GRE over IPSEC scenario.

Any idea?
 
sindy
Forum Guru
Forum Guru
Posts: 10206
Joined: Mon Dec 04, 2017 9:19 pm

Re: RouterOS 7 - Wireguard site-to-site over multiple wans

Mon Feb 14, 2022 12:33 pm

There seems to be a dispute in progress in Riga currently whether to permit the same remote public key for peers under different Wireguard interfaces on the same machine.

So for the time being, use different keys for each wireguard "link". Forever, use different Wireguard interfaces (one per each WAN) and the same approach you used with GRE over IPsec.

You could also make use of Wireguard's multi-homing and address-tracking capability in terms that you'd use a single Wireguard interface and peer at each site, and use a failover between WANs to let the Wireguard transport packets use the WAN that is currently alive, but it is probably not what you want. Plus, unless all four WANs have public addresses, it may have difficulties to work.

For an improved redundancy, use a pair of routers at each site, OSPF, and VRRP.
 
User avatar
mozerd
Forum Veteran
Forum Veteran
Posts: 884
Joined: Thu Oct 05, 2017 3:39 pm
Location: Canada
Contact:

Re: RouterOS 7 - Wireguard site-to-site over multiple wans

Mon Feb 14, 2022 5:19 pm

For High availability the following example may prove to be useful for your needs ....
its not MikroTik centric but the same principles apply and I am certain that the same example can be converted into MikroTik Speak

High Availability WireGuard Site To Site
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19318
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: RouterOS 7 - Wireguard site-to-site over multiple wans

Mon Feb 14, 2022 5:39 pm

For High availability the following example may prove to be useful for your needs ....
its not MikroTik centric but the same principles apply and I am certain that the same example can be converted into MikroTik Speak

High Availability WireGuard Site To Site
Yes please if you were offering to create the MT equivalent!! :-)
 
loca995
newbie
Topic Author
Posts: 41
Joined: Wed Sep 01, 2021 10:31 am
Location: Italy

Re: RouterOS 7 - Wireguard site-to-site over multiple wans

Tue Feb 15, 2022 7:18 pm

There seems to be a dispute in progress in Riga currently whether to permit the same remote public key for peers under different Wireguard interfaces on the same machine.

So for the time being, use different keys for each wireguard "link". Forever, use different Wireguard interfaces (one per each WAN) and the same approach you used with GRE over IPsec.

You could also make use of Wireguard's multi-homing and address-tracking capability in terms that you'd use a single Wireguard interface and peer at each site, and use a failover between WANs to let the Wireguard transport packets use the WAN that is currently alive, but it is probably not what you want. Plus, unless all four WANs have public addresses, it may have difficulties to work.

For an improved redundancy, use a pair of routers at each site, OSPF, and VRRP.
The main problem is that every wireguard interface on one routerboard/CCR/CHR has the same public key, so I can't use the same approach for GRE over IPSEC, if I understood what you meant
 
Sob
Forum Guru
Forum Guru
Posts: 9120
Joined: Mon Apr 20, 2009 9:11 pm

Re: RouterOS 7 - Wireguard site-to-site over multiple wans

Wed Feb 16, 2022 4:31 am

Different WG interfaces have different keys, unless you give same one to all.
 
sindy
Forum Guru
Forum Guru
Posts: 10206
Joined: Mon Dec 04, 2017 9:19 pm

Re: RouterOS 7 - Wireguard site-to-site over multiple wans

Wed Feb 16, 2022 10:16 am

The main problem is that every wireguard interface on one routerboard/CCR/CHR has the same public key, so I can't use the same approach for GRE over IPSEC, if I understood what you meant
Unless some "older" 7.x.y version was creating the same key pair for all interfaces, the only other reason to come to my mind would be creating one interface as a copy of the other one. So add a third one and see whether the key is different from the other two; if yes, move the peer(s) from the second interface to the third one and remove the second one.

I've just added two more interfaces on a CHR (7.2rc3), the key pairs are unique. I've just added two interfaces to an RB711, it gave it a hard time and caused a reboot each time (7.1.2, mibsbe), but again key pairs are unique.
 
loca995
newbie
Topic Author
Posts: 41
Joined: Wed Sep 01, 2021 10:31 am
Location: Italy

Re: RouterOS 7 - Wireguard site-to-site over multiple wans  [SOLVED]

Sat Mar 12, 2022 6:44 pm

Hello Everyone,
I come back after a very long time. I confirm that the problem is not occuring with 7.1.3

So it's solved.
Thanks.
 
haris013
Frequent Visitor
Frequent Visitor
Posts: 80
Joined: Mon Jun 18, 2018 2:13 am

Re: RouterOS 7 - Wireguard site-to-site over multiple wans

Mon Sep 12, 2022 2:01 pm

Hello,

I have 2 ccr2004 and i want high availability. I have setup VRRP between the 2 routers and i have identical setup at addresses, dhcp, bridge VLAN fitering etc etc.

I have 10 roadwarrior VPNs using wireguard. I have setup the wireguard at router 1. When router 1 becomes passive and router 2 becames active, roadwarrior VPNs cannot connect because wireguard is running at router 1.

Can i setup the exact configuration at wireguard from router1 to router2 and when router2 is active the VPNs will work?
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19318
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: RouterOS 7 - Wireguard site-to-site over multiple wans

Mon Sep 12, 2022 4:54 pm

If you look at mozerds link, one creates two distinct wireguard networks (different public IP and different wireguard IPs).

Who is online

Users browsing this forum: googol, phascogale and 65 guests