{"id":6189,"date":"2026-11-09T13:32:24","date_gmt":"2026-11-09T08:32:24","guid":{"rendered":"https:\/\/zilleali.com\/?p=6189"},"modified":"2026-11-25T16:06:25","modified_gmt":"2026-11-25T11:06:25","slug":"mikrotik-wireguard-site-to-site-vpn-isp","status":"publish","type":"post","link":"https:\/\/zilleali.com\/it\/mikrotik-wireguard-site-to-site-vpn-isp\/","title":{"rendered":"VPN Site-to-Site WireGuard MikroTik per ISP multi-sito"},"content":{"rendered":"<p class=\"wp-block-paragraph\">Getting a MikroTik WireGuard site to site VPN right the first time saves hours of troubleshooting later.<\/p>\n<p class=\"wp-block-paragraph\">A <strong>MikroTik WireGuard site to site<\/strong> tunnel is usually the fastest way to connect two ISP locations on RouterOS. It is lighter than IPsec, the config is short, and RouterOS v7 has had native <a href=\"https:\/\/www.wireguard.com\/\">WireGuard<\/a> support for a while now. But two problems show up constantly once you move past a single-peer test lab: adding dual WAN PCC load balancing on top of the tunnel, and losing access to WinBox or WebFig on the remote router once the tunnel comes up. Both are live questions on the MikroTik forums right now, and both come down to a handful of specific config details that are easy to miss the first time.<\/p>\n<p class=\"wp-block-paragraph\">This guide walks through a working, production-tested setup for a multi-site ISP: the base tunnel, dual WAN load balancing without breaking the handshake, and the exact fix for the WinBox\/WebFig access gap. By the end you will have a tunnel that survives real traffic, not just a ping test.<\/p>\n\n<h2 id=\"prerequisites\" class=\"wp-block-heading\">Prerequisiti<\/h2>\n<ul class=\"wp-block-list\">\n<li>RouterOS v7.x on both ends (WireGuard has been part of the kernel since v7.0, but use a current stable release)<\/li>\n<li>Two sites, each with its own MikroTik router acting as the tunnel endpoint<\/li>\n<li>Dual WAN on at least one end (this guide assumes dual WAN at the hub site, single WAN at the branch, which is the most common real-world case)<\/li>\n<li>A static public IP, or at minimum a predictable DDNS hostname, on each WAN you want the tunnel to use<\/li>\n<li>Admin access to both routers, ideally via a console or out-of-band connection the first time you touch the tunnel (so a mistake in the firewall or routing table does not lock you out)<\/li>\n<\/ul>\n\n<h2 id=\"basic-mikrotik-wireguard-site-to-site-vpn-setup\" class=\"wp-block-heading\">Basic MikroTik WireGuard Site to Site VPN Setup<\/h2>\n<p class=\"wp-block-paragraph\">Start with the simplest working tunnel between two routers before layering anything else on top. Every WireGuard interface needs a private key, and every peer needs the other side&#8217;s public key and allowed address range.<\/p>\n\n<p class=\"wp-block-paragraph\">On the hub router:<\/p>\n<pre class=\"wp-block-code\"><code>\/interface wireguard\nadd name=wg-branch1 listen-port=13231 private-key=\"&lt;hub-private-key&gt;\"\n\n\/ip address\nadd address=10.90.0.1\/30 interface=wg-branch1\n\n\/interface wireguard peers\nadd interface=wg-branch1 public-key=\"&lt;branch-public-key&gt;\" \\\n    allowed-address=10.90.0.2\/32,192.168.20.0\/24 \\\n    endpoint-address=branch1.yourdomain.com endpoint-port=13231 \\\n    persistent-keepalive=25s<\/code><\/pre>\n\n<p class=\"wp-block-paragraph\">On the branch router, mirror it:<\/p>\n<pre class=\"wp-block-code\"><code>\/interface wireguard\nadd name=wg-hub listen-port=13231 private-key=\"&lt;branch-private-key&gt;\"\n\n\/ip address\nadd address=10.90.0.2\/30 interface=wg-hub\n\n\/interface wireguard peers\nadd interface=wg-hub public-key=\"&lt;hub-public-key&gt;\" \\\n    allowed-address=10.90.0.1\/32,192.168.10.0\/24 \\\n    endpoint-address=hub.yourdomain.com endpoint-port=13231 \\\n    persistent-keepalive=25s<\/code><\/pre>\n\n<p class=\"wp-block-paragraph\">Add routes so each side knows how to reach the other&#8217;s LAN over the tunnel:<\/p>\n<pre class=\"wp-block-code\"><code>\/ip route\nadd dst-address=192.168.20.0\/24 gateway=wg-branch1 ;# on the hub\nadd dst-address=192.168.10.0\/24 gateway=wg-hub ;# on the branch<\/code><\/pre>\n\n<p class=\"wp-block-paragraph\">Set <code>persistent-keepalive<\/code> on both ends, not just one, especially if either side sits behind NAT. Without it, NAT mappings time out and the tunnel appears to hang until traffic restarts it. 25 seconds is the usual safe value; you rarely need to go lower.<\/p>\n\n<p class=\"wp-block-paragraph\">At this point, a ping from the hub LAN to the branch LAN (and back) should work. Confirm that before moving on, because every problem below assumes the base tunnel is already solid.<\/p>\n\n\n<figure class=\"wp-block-image size-full\"><picture><source srcset=\"https:\/\/zilleali.com\/wp-content\/uploads\/2026\/11\/mikrotik-wireguard-dual-wan-pcc-topology.webp 1440w, https:\/\/zilleali.com\/wp-content\/uploads\/2026\/11\/mikrotik-wireguard-dual-wan-pcc-topology-600x375.webp 600w, https:\/\/zilleali.com\/wp-content\/uploads\/2026\/11\/mikrotik-wireguard-dual-wan-pcc-topology-1200x750.webp 1200w, https:\/\/zilleali.com\/wp-content\/uploads\/2026\/11\/mikrotik-wireguard-dual-wan-pcc-topology-768x480.webp 768w\" sizes=\"auto, (max-width: 1440px) 100vw, 1440px\" type=\"image\/webp\"><img loading=\"lazy\" decoding=\"async\" width=\"1440\" height=\"900\" src=\"https:\/\/zilleali.com\/wp-content\/uploads\/2026\/11\/mikrotik-wireguard-dual-wan-pcc-topology.webp\" alt=\"MikroTik WireGuard site to site VPN topology: hub with dual WAN PCC on ISP-A and ISP-B, tunnel 10.90.0.0\/30 to the branch, linking 192.168.10.0\/24 and 192.168.20.0\/24\" class=\"wp-image-6198\" srcset=\"https:\/\/zilleali.com\/wp-content\/uploads\/2026\/11\/mikrotik-wireguard-dual-wan-pcc-topology.webp 1440w, https:\/\/zilleali.com\/wp-content\/uploads\/2026\/11\/mikrotik-wireguard-dual-wan-pcc-topology-600x375.webp 600w, https:\/\/zilleali.com\/wp-content\/uploads\/2026\/11\/mikrotik-wireguard-dual-wan-pcc-topology-1200x750.webp 1200w, https:\/\/zilleali.com\/wp-content\/uploads\/2026\/11\/mikrotik-wireguard-dual-wan-pcc-topology-768x480.webp 768w\" sizes=\"auto, (max-width: 1440px) 100vw, 1440px\" \/><\/picture><figcaption class=\"wp-element-caption\">Hub with dual WAN PCC and a single WireGuard tunnel to the branch.<\/figcaption><\/figure>\n\n\n<h2 id=\"adding-pcc-based-dual-wan-load-balancing\" class=\"wp-block-heading\">Adding PCC-based dual WAN load balancing<\/h2>\n<p class=\"wp-block-paragraph\">The question that comes up constantly on the MikroTik forums right now is how to add dual WAN PCC (Per Connection Classifier) load balancing on top of a WireGuard site-to-site VPN. The key thing to understand is that PCC load-balances outbound sessions by WAN interface, and your WireGuard interface does not care which physical WAN the UDP packet that carries it actually goes out on, as long as routing sends it somewhere that reaches the internet.<\/p>\n\n<p class=\"wp-block-paragraph\">There are two different things people usually mean when they say &#8220;dual WAN with WireGuard,&#8221; and they need different setups:<\/p>\n\n<ol class=\"wp-block-list\">\n<li><strong>Load-balance the WireGuard tunnel&#8217;s own outbound traffic<\/strong> across two WANs for redundancy (if WAN1 drops, the tunnel should still come up over WAN2).<\/li>\n<li><strong>Load-balance everything else<\/strong> (general LAN traffic going to the internet) across two WANs, while the WireGuard tunnel itself still needs a single, predictable path so the remote peer&#8217;s <code>endpoint-address<\/code> keeps resolving.<\/li>\n<\/ol>\n\n<p class=\"wp-block-paragraph\">For case 2, which is the far more common real setup, keep PCC marking general traffic as usual, but explicitly exclude WireGuard UDP traffic from the PCC mangle rules so it always follows a fixed route (its own routing-mark or a plain static route to a chosen WAN). Something like this in <code>\/ip firewall mangle<\/code>, placed above your PCC rules:<\/p>\n<pre class=\"wp-block-code\"><code>\/ip firewall mangle\nadd chain=prerouting protocol=udp dst-port=13231 action=mark-routing \\\n    new-routing-mark=to-wan1 passthrough=no comment=\"WireGuard fixed path\"\nadd chain=prerouting protocol=udp src-port=13231 action=mark-routing \\\n    new-routing-mark=to-wan1 passthrough=no comment=\"WireGuard fixed path\"<\/code><\/pre>\n\n<p class=\"wp-block-paragraph\">For redundancy instead (case 1, failing the tunnel itself over to WAN2 if WAN1 dies), use <code>\/tool netwatch<\/code> or a recursive gateway check on WAN1, and have a second WireGuard peer entry pointed at the branch&#8217;s WAN2 address as a backup endpoint, or script a routing-mark swap on failure. A single peer cannot have two live endpoints simultaneously, so true automatic failover needs either a second peer\/interface pair or a script that rewrites the endpoint-address on WAN1 failure.<\/p>\n\n<p class=\"wp-block-paragraph\">Either way, keep PCC&#8217;s own two-rule classifier (by src-address, dst-address, or both, depending on what you are balancing) exactly as it is for normal traffic. The only change is making sure WireGuard&#8217;s own UDP conversation is not caught up in that classifier and bounced between WANs mid-session, which breaks the handshake.<\/p>\n\n<h2 id=\"fixing-local-service-access-over-the-tunnel\" class=\"wp-block-heading\">Fixing local service access over the tunnel<\/h2>\n<p class=\"wp-block-paragraph\">This is the other thing people keep hitting: the tunnel comes up, routing works, LAN-to-LAN traffic passes fine, but WinBox and WebFig on the remote router itself are unreachable from the other side. The tunnel is not broken; this is almost always one of three things.<\/p>\n\n<p class=\"wp-block-paragraph\"><strong>1. The router&#8217;s own services are not listening on the WireGuard interface&#8217;s address.<\/strong> By default WinBox\/API\/WebFig listen on all interfaces, but if you have an <code>\/ip services<\/code> entry restricting by address, or an <code>available-from<\/code> list, it will silently exclude the WireGuard subnet unless you add it.<\/p>\n\n<p class=\"wp-block-paragraph\"><strong>2. The input chain firewall is blocking it.<\/strong> Most production MikroTik firewalls drop everything in the input chain that is not explicitly allowed. If your &#8220;accept established\/related, accept from LAN, drop everything else&#8221; rule set does not also accept from the WireGuard interface\/subnet, WinBox traffic destined for the router itself (not routed through it) gets dropped before it reaches the service.<\/p>\n<pre class=\"wp-block-code\"><code>\/ip firewall filter\nadd chain=input in-interface=wg-branch1 action=accept \\\n    comment=\"Allow management over WireGuard\" place-before=0<\/code><\/pre>\n\n<p class=\"wp-block-paragraph\"><strong>3. The allowed-address on the peer entry is too narrow.<\/strong> If <code>allowed-address<\/code> on either peer only lists the far LAN subnet and not the router&#8217;s own tunnel IP (the \/32 of the other end), WireGuard&#8217;s own cryptokey routing will not accept packets destined for that router&#8217;s tunnel address, and traffic aimed at managing the router itself gets silently dropped at the WireGuard layer, before it ever reaches the firewall. This is the single most common cause of &#8220;LAN-to-LAN works, but I can&#8217;t reach the router itself over the tunnel.&#8221;<\/p>\n\n<p class=\"wp-block-paragraph\">Go back and check the earlier config: both peer entries above already include the far router&#8217;s own \/32 tunnel address in <code>allowed-address<\/code> alongside the LAN subnet. If you set this up without that \/32, add it now and the router&#8217;s own services should become reachable immediately, with no other change needed.<\/p>\n\n<h2 id=\"common-mistakes-and-troubleshooting\" class=\"wp-block-heading\">Common mistakes and troubleshooting<\/h2>\n<ul class=\"wp-block-list\">\n<li><strong>Clock skew.<\/strong> WireGuard&#8217;s handshake is time-sensitive. If either router&#8217;s clock is badly off (common on a router that just rebooted and has not reached NTP yet), the handshake can silently fail. Check <code>\/system clock<\/code> and make sure NTP is configured on both ends.<\/li>\n<li><strong>MTU problems.<\/strong> WireGuard adds overhead per packet. If you are tunneling over a PPPoE WAN (common for ISPs) the effective path MTU is already reduced, and stacking WireGuard on top can push you into fragmentation issues that look like &#8220;slow&#8221; or &#8220;some things work, some don&#8217;t.&#8221; Try lowering the WireGuard interface&#8217;s MTU to 1420 as a starting point if you see intermittent failures on larger transfers.<\/li>\n<li><strong>Checking tunnel status.<\/strong> <code>\/interface wireguard peers print<\/code> shows the last handshake time for each peer. If it is not updating, you have a reachability or key mismatch problem before you even get to routing.<\/li>\n<li><strong>Wrong public\/private key pairing.<\/strong> Easy to mix up when generating keys for multiple sites. Always confirm with <code>\/interface wireguard print<\/code> on each side that the public key you pasted into the peer entry on the other router actually matches.<\/li>\n<li><strong>NAT between the WireGuard peers.<\/strong> If either endpoint sits behind NAT without a forwarded UDP port matching <code>listen-port<\/code>, the handshake from the other side will never arrive. Port-forward the WireGuard UDP port if the router is not directly on a public IP.<\/li>\n<\/ul>\n\n<h2 id=\"faq\" class=\"wp-block-heading\">FAQ<\/h2>\n<p class=\"wp-block-paragraph\"><strong>Posso gestire pi\u00f9 di due siti sullo stesso router hub?<\/strong><br>S\u00ec. Aggiungi un peer WireGuard per ogni sito remoto sull\u2019unica interfaccia WireGuard dell\u2019hub (WireGuard supporta pi\u00f9 peer su una singola interfaccia, a differenza di un tipico tunnel IPsec punto\u2011a\u2011punto), ciascuno con il proprio intervallo di indirizzi consentiti e rotta.<\/p>\n\n<p class=\"wp-block-paragraph\"><strong>WireGuard supporta automaticamente una mesh completa tra le filiali?<\/strong><br>No. Per impostazione predefinita questa configurazione \u00e8 hub\u2011and\u2011spoke: le filiali si raggiungono tramite la tabella di routing dell\u2019hub, non direttamente. Una mesh completa richiede una voce peer tra ogni coppia di siti, il che diventa pi\u00f9 difficile da gestire oltre qualche posizione.<\/p>\n\n<p class=\"wp-block-paragraph\"><strong>WireGuard \u00e8 davvero sufficientemente sicuro per il traffico ISP in produzione?<\/strong><br>S\u00ec. Utilizza crittografia moderna e ben recensita (ChaCha20, Poly1305, Curve25519) e ha una superficie di attacco molto pi\u00f9 piccola rispetto ai protocolli di negoziazione di IPsec. I rischi pratici in produzione sono quasi sempre errori di configurazione (intervalli di indirizzi consentiti aperti, regole firewall mancanti), non il protocollo stesso.<\/p>\n\n<h2 id=\"conclusion\" class=\"wp-block-heading\">Conclusione<\/h2>\n<p class=\"wp-block-paragraph\">Un tunnel site\u2011to\u2011site MikroTik WireGuard \u00e8 semplice una volta che la configurazione di base \u00e8 corretta, ma due aspetti determinano se resiste al traffico di produzione: mantenere la conversazione UDP del tunnel fuori dal classificatore di bilanciamento del carico PCC affinch\u00e9 il handshake non rimbalzi tra le WAN e includere l\u2019indirizzo del tunnel di ciascun router in <code>allowed-address<\/code> in modo che l'accesso di gestione attraverso il tunnel funzioni effettivamente. Sistemati questi due dettagli e il resto (routing, firewall, keepalive) \u00e8 di routine. Testa prima il tunnel di base, aggiungi il dual WAN in secondo luogo e conferma l'accesso WinBox\/WebFig prima di dichiararlo pronto per la produzione.<\/p>\n\n<h2 id=\"related-posts\" class=\"wp-block-heading\">Articoli correlati<\/h2>\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/zilleali.com\/it\/mikrotik-pppoe-freeradius-isp\/\">MikroTik PPPoE + FreeRADIUS: Uno stack di autenticazione ISP reale<\/a> \u2013 il livello di autenticazione che di solito si trova sul lato WAN di un tunnel come questo.<\/li>\n<li><a href=\"https:\/\/zilleali.com\/it\/wisp-backhaul-design\/\">Progettare un backhaul WISP che resista alle ore di punta<\/a> \u2013 il pi\u00f9 ampio design multi\u2011sito in cui solitamente si inserisce questo tipo di tunnel.<\/li>\n<li><a href=\"https:\/\/zilleali.com\/it\/mikrotik-routeros-virtualbox-chr-lab\/\">MikroTik RouterOS in VirtualBox: Configurazione completa CHR<\/a> \u2013 crea un laboratorio sicuro per testare l\u2019intera configurazione prima di intervenire su un router in produzione.<\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>Configura la VPN site\u2011to\u2011site WireGuard di MikroTik per ISP multi\u2011sito: bilanciamento del carico dual WAN PCC, routing e correzione dell'accesso a WinBox\/WebFig una volta che il tunnel \u00e8 attivo.<\/p>","protected":false},"author":1,"featured_media":6412,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"googlesitekit_rrm_CAow6N_ODA:productID":"","_chatbot_visible":"","_zea_seo_title":"MikroTik WireGuard Site to Site VPN Guide for ISPs","_zea_seo_description":"Configure a MikroTik WireGuard site to site VPN across ISP PoPs and branch offices. Learn key exchange, OSPF routing over tunnels, and MTU optimization.","_zea_seo_focus_keyphrase":"MikroTik WireGuard site to site VPN","_zea_seo_canonical":"","_zea_seo_robots_noindex":false,"_zea_seo_robots_nofollow":false,"_zea_seo_sitemap_exclude":false,"_zea_seo_cornerstone":false,"_zea_seo_sitemap_priority":"","_zea_seo_og_title":"MikroTik WireGuard Site to Site VPN Guide for ISPs","_zea_seo_og_description":"Carrier-grade RouterOS v7 WireGuard guide for multi-site ISPs: Dual-WAN PCC failover, persistent keepalive, and WinBox access fix.","_zea_seo_og_image":"https:\/\/zilleali.com\/wp-content\/uploads\/2026\/11\/card_post_wireguard.jpg","_zea_seo_twitter_title":"MikroTik WireGuard Site to Site VPN Guide for ISPs","_zea_seo_twitter_description":"Carrier-grade RouterOS v7 WireGuard guide for multi-site ISPs: Dual-WAN PCC failover, persistent keepalive, and WinBox access fix.","_zea_seo_analysis_score":63,"_zea_ai_pending":false,"_zea_ai_notes":"","_zea_ai_keyword":"","footnotes":""},"categories":[11,207],"tags":[199,198,234,197,235,238,239,237,236,233,231,232,246,230],"class_list":["post-6189","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mikrotik","category-tutorials","tag-firewall","tag-isp","tag-load-balance","tag-mikrotik","tag-mtu","tag-p2p-ipsec-tunnel","tag-pcc-load-balancing","tag-point-to-point-ipsec-tunnel-2","tag-point-to-point-ipsec-tunnel","tag-routeros-v7","tag-site-to-site-tunnel","tag-site-to-site-vpn","tag-vpn","tag-wireguard"],"_links":{"self":[{"href":"https:\/\/zilleali.com\/it\/wp-json\/wp\/v2\/posts\/6189","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zilleali.com\/it\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zilleali.com\/it\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zilleali.com\/it\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/zilleali.com\/it\/wp-json\/wp\/v2\/comments?post=6189"}],"version-history":[{"count":5,"href":"https:\/\/zilleali.com\/it\/wp-json\/wp\/v2\/posts\/6189\/revisions"}],"predecessor-version":[{"id":6358,"href":"https:\/\/zilleali.com\/it\/wp-json\/wp\/v2\/posts\/6189\/revisions\/6358"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/zilleali.com\/it\/wp-json\/wp\/v2\/media\/6412"}],"wp:attachment":[{"href":"https:\/\/zilleali.com\/it\/wp-json\/wp\/v2\/media?parent=6189"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zilleali.com\/it\/wp-json\/wp\/v2\/categories?post=6189"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zilleali.com\/it\/wp-json\/wp\/v2\/tags?post=6189"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}