Hello,
Want to help a friend of mine who own a small business, but got stuck configuring Wireguard over two WAN.
Situation:
- small town in the mountains with frequent Internet failures - the need of two Internet connections;
- simple failover config it would be sufficient, but, as he pay for both, PCC was considered as better option;
- a number of 5 persons working remote - the need for Wireguard setup;
- equipment: 2 HAP ax2, if everything goes as planed, main router will be an RB5009 and first two will be used as APs.
Problem:
Can not access local network over Wireguard session when both WAN interfaces are active. Found at least six discussions regarding this topic, here on forums, but wasn’t unable to solve the issue.
With both WAN interfaces active, I can initiate a working Wireguard session, either on WAN1 or WAN2, and can ping the router 192.168.88.1, but can not access none of others LAN devices.
With only one WAN active (either one) everything goes fine.
The config:
# 2025-06-08 11:00:44 by RouterOS 7.19.1
# software id = ---
#
# model = C52iG-5HaxD2HaxD
# serial number = ---
/interface bridge
add admin-mac=48:A9:8A:D5:EB:C0 auto-mac=no comment=defconf name=bridge
/interface ethernet
set [ find default-name=ether1 ] disabled=yes name=ether1-orange
set [ find default-name=ether2 ] name=ether2-digi
/interface pppoe-client
add add-default-route=yes disabled=no interface=ether2-digi name=pppoe-digi \
password=--- use-peer-dns=yes user=---
/interface wireguard
add comment="Wireguard server" listen-port=13231 mtu=1420 name=wireguard \
private-key="---"
/interface list
add comment=defconf name=WAN
add comment=defconf name=LAN
add name=miniLAN
/interface wifi channel
add band=5ghz-ax disabled=no name=wifi6 skip-dfs-channels=10min-cac width=\
20/40mhz
add band=2ghz-ax disabled=no name=wifi4 skip-dfs-channels=10min-cac width=\
20mhz
/interface wifi security
add authentication-types=wpa2-psk,wpa3-psk disabled=no ft=yes name=security \
passphrase=---
/interface wifi configuration
add channel=wifi6 country=Romania disabled=no mode=ap name=wifi6 security=\
security ssid=---
add channel=wifi4 country=Romania disabled=no mode=ap name=wifi4 security=\
security ssid=---
/interface wifi
# operated by CAP 48:A9:8A:6B:39:EC%bridge, traffic processing on CAP
add configuration=wifi4 disabled=no name=cap-wifi1 radio-mac=\
48:A9:8A:6B:39:F1
# operated by CAP 48:A9:8A:6B:39:EC%bridge, traffic processing on CAP
add configuration=wifi4 disabled=no name=cap-wifi2 radio-mac=\
48:A9:8A:6B:39:F2
# no connection to CAPsMAN, managed locally
set [ find default-name=wifi1 ] channel.skip-dfs-channels=10min-cac \
configuration=wifi6 configuration.manager=capsman-or-local .mode=ap \
.ssid=--- disabled=no security.authentication-types=\
wpa2-psk,wpa3-psk .ft=yes .ft-over-ds=yes
# no connection to CAPsMAN, managed locally
set [ find default-name=wifi2 ] channel.skip-dfs-channels=10min-cac \
configuration=wifi4 configuration.manager=capsman-or-local .mode=ap \
disabled=no security.authentication-types=wpa2-psk,wpa3-psk .ft=yes \
.ft-over-ds=yes
/ip pool
add name=default-dhcp ranges=192.168.88.10-192.168.88.254
/ip dhcp-server
add address-pool=default-dhcp interface=bridge name=defconf
/routing table
add disabled=no fib name=digi
add disabled=no fib name=orange
/disk settings
set auto-media-interface=bridge auto-media-sharing=yes auto-smb-sharing=yes
/ip smb
set enabled=no
/interface bridge port
add bridge=bridge comment=defconf interface=ether3
add bridge=bridge comment=defconf interface=ether4
add bridge=bridge comment=defconf interface=ether5
add bridge=bridge comment=defconf interface=wifi1
add bridge=bridge comment=defconf interface=wifi2
/ip neighbor discovery-settings
set discover-interface-list=LAN
/ip settings
set rp-filter=strict
/ipv6 settings
set disable-ipv6=yes
/interface detect-internet
set detect-interface-list=all internet-interface-list=all lan-interface-list=\
all wan-interface-list=all
/interface list member
add comment=defconf interface=bridge list=LAN
add comment=defconf interface=ether1-orange list=WAN
add interface=wireguard list=LAN
add interface=pppoe-digi list=WAN
add interface=bridge list=miniLAN
/interface ovpn-server server
add mac-address=FE:B5:58:8B:42:3A name=ovpn-server1
/interface wifi cap
set certificate=none discovery-interfaces=bridge enabled=yes
/interface wifi capsman
set enabled=yes interfaces=bridge package-path="" require-peer-certificate=no \
upgrade-policy=none
/interface wifi provisioning
add action=create-enabled comment="---" disabled=no master-configuration=\
wifi4 radio-mac=48:A9:8A:6B:39:F1 slave-configurations=wifi4 \
slave-name-format=""
add action=create-enabled comment="---" disabled=no master-configuration=\
wifi4 radio-mac=48:A9:8A:6B:39:F2 slave-configurations=wifi6
add action=create-enabled comment="Local 1" disabled=no master-configuration=\
wifi4 radio-mac=48:A9:8A:D5:EB:C4 slave-configurations=wifi6
add action=create-enabled comment="Local 2" disabled=no master-configuration=\
wifi4 radio-mac=48:A9:8A:D5:EB:C5 slave-configurations=wifi6
/interface wireguard peers
add allowed-address=192.168.80.2/32 client-address=192.168.80.2/32 \
client-dns=192.168.88.1 comment="---" interface=wireguard name=\
wg1 private-key="---" \
public-key="---"
...
add allowed-address=192.168.80.12/32 client-address=192.168.80.12/32 \
client-dns=192.168.88.1 comment="Test" interface=wireguard name=\
wg11 private-key="---" \
public-key="---"
/ip address
add address=192.168.88.1/24 comment=defconf interface=bridge network=\
192.168.88.0
add address=192.168.80.1/24 interface=wireguard network=192.168.80.0
/ip dhcp-client
# Interface not active
add comment=defconf interface=ether1-orange
/ip dhcp-server network
add address=192.168.88.0/24 comment=defconf dns-server=\
1.1.1.1,8.8.8.8,8.8.4.4 gateway=192.168.88.1
/ip dns
set allow-remote-requests=yes servers=1.1.1.1,8.8.8.8
/ip dns static
add address=192.168.88.1 comment=defconf name=router.lan type=A
/ip firewall filter
add action=accept chain=input comment="allow WireGuard" dst-port=13231 \
protocol=udp
add action=accept chain=input comment=\
"defconf: accept established,related,untracked" connection-state=\
established,related,untracked
add action=drop chain=input comment="defconf: drop invalid" connection-state=\
invalid
add action=accept chain=input comment="defconf: accept ICMP" protocol=icmp
add action=accept chain=input comment=\
"defconf: accept to local loopback (for CAPsMAN)" dst-address=127.0.0.1
add action=drop chain=input comment="defconf: drop all not coming from LAN" \
in-interface-list=!LAN
add action=accept chain=forward comment="Allow forward for Wireguard Bridge" \
in-interface=wireguard out-interface=bridge
add action=accept chain=forward comment="Allow forward for Bridge Wireguard" \
in-interface=bridge out-interface=wireguard
add action=accept chain=forward comment="defconf: accept in ipsec policy" \
disabled=yes ipsec-policy=in,ipsec
add action=accept chain=forward comment="defconf: accept out ipsec policy" \
disabled=yes ipsec-policy=out,ipsec
add action=fasttrack-connection chain=forward comment="defconf: fasttrack" \
connection-state=established,related hw-offload=yes
add action=accept chain=forward comment=\
"defconf: accept established,related, untracked" connection-state=\
established,related,untracked
add action=drop chain=forward comment="defconf: drop invalid" \
connection-state=invalid
add action=drop chain=forward comment=\
"defconf: drop all from WAN not DSTNATed" connection-nat-state=!dstnat \
connection-state=new in-interface-list=WAN
/ip firewall mangle
add action=change-mss chain=forward new-mss=clamp-to-pmtu protocol=tcp \
tcp-flags=syn
add action=mark-connection chain=prerouting comment=\
"Mark NEW INPUT connections FROM Digi" connection-mark=no-mark \
connection-state=new in-interface=pppoe-digi new-connection-mark=\
digi_conn
add action=mark-connection chain=prerouting comment=\
"MARK NEW INPUT connections FROM Orange" connection-mark=no-mark \
connection-state=new in-interface=ether1-orange new-connection-mark=\
orange_conn
add action=mark-routing chain=output comment=\
"Mark NEW OUTPUT connections TO Digi" connection-mark=digi_conn \
new-routing-mark=digi
add action=mark-routing chain=output comment=\
"Mark NEW OUTPUT connections TO Orange" connection-mark=\
orange_conn new-routing-mark=orange
add action=mark-connection chain=prerouting comment=\
"PCC LAN - Digi 2/0" connection-mark=no-mark \
connection-state=new dst-address-type=!local in-interface-list=miniLAN \
new-connection-mark=digi_conn per-connection-classifier=\
src-address-and-port:2/0
add action=mark-connection chain=prerouting comment=\
"PCC LAN - Orange 2/1" connection-mark=no-mark \
connection-state=new dst-address-type=!local in-interface-list=miniLAN \
new-connection-mark=orange_conn per-connection-classifier=\
src-address-and-port:2/1
add action=mark-routing chain=prerouting comment=\
"Mark FORWARD FROM LAN - Digi" in-interface-list=miniLAN \
new-routing-mark=digi
add action=mark-routing chain=prerouting comment=\
"Mark FORWARD FROM LAN - Orange" in-interface-list=miniLAN \
new-routing-mark=orange
/ip firewall nat
add action=masquerade chain=srcnat comment="NAT - DIGI" disabled=yes \
ipsec-policy=out,none out-interface=pppoe-digi src-address=\
192.168.88.0/24
add action=masquerade chain=srcnat comment="NAT - Orange" disabled=yes \
ipsec-policy=out,none out-interface=ether1-orange
add action=masquerade chain=srcnat comment=\
"masquerade - simply WAN" ipsec-policy=out,none \
out-interface-list=WAN
/ip route
add check-gateway=ping disabled=no distance=2 dst-address=0.0.0.0/0 gateway=\
90.84.225.1 routing-table=orange scope=30 suppress-hw-offload=no \
target-scope=10
add check-gateway=ping disabled=no distance=1 dst-address=0.0.0.0/0 gateway=\
pppoe-digi routing-table=digi scope=30 suppress-hw-offload=no \
target-scope=10
/ip service
set ftp address=192.168.0.0/16
set ssh address=192.168.0.0/16
set telnet address=192.168.0.0/16 disabled=yes
set www address=192.168.0.0/16 disabled=yes
set www-ssl address=192.168.0.0/16 disabled=yes
set winbox address=192.168.0.0/16
set api address=192.168.0.0/16 disabled=yes
set api-ssl address=192.168.0.0/16 disabled=yes
/ipv6 firewall address-list
add address=::/128 comment="defconf: unspecified address" list=bad_ipv6
add address=::1/128 comment="defconf: lo" list=bad_ipv6
add address=fec0::/10 comment="defconf: site-local" list=bad_ipv6
add address=::ffff:0.0.0.0/96 comment="defconf: ipv4-mapped" list=bad_ipv6
add address=::/96 comment="defconf: ipv4 compat" list=bad_ipv6
add address=100::/64 comment="defconf: discard only " list=bad_ipv6
add address=2001:db8::/32 comment="defconf: documentation" list=bad_ipv6
add address=2001:10::/28 comment="defconf: ORCHID" list=bad_ipv6
add address=3ffe::/16 comment="defconf: 6bone" list=bad_ipv6
/ipv6 firewall filter
add action=accept chain=input comment=\
"defconf: accept established,related,untracked" connection-state=\
established,related,untracked
add action=drop chain=input comment="defconf: drop invalid" connection-state=\
invalid
add action=accept chain=input comment="defconf: accept ICMPv6" protocol=\
icmpv6
add action=accept chain=input comment="defconf: accept UDP traceroute" \
dst-port=33434-33534 protocol=udp
add action=accept chain=input comment=\
"defconf: accept DHCPv6-Client prefix delegation." dst-port=546 protocol=\
udp src-address=fe80::/10
add action=accept chain=input comment="defconf: accept IKE" dst-port=500,4500 \
protocol=udp
add action=accept chain=input comment="defconf: accept ipsec AH" protocol=\
ipsec-ah
add action=accept chain=input comment="defconf: accept ipsec ESP" protocol=\
ipsec-esp
add action=accept chain=input comment=\
"defconf: accept all that matches ipsec policy" ipsec-policy=in,ipsec
add action=drop chain=input comment=\
"defconf: drop everything else not coming from LAN" in-interface-list=\
!LAN
add action=accept chain=forward comment=\
"defconf: accept established,related,untracked" connection-state=\
established,related,untracked
add action=drop chain=forward comment="defconf: drop invalid" \
connection-state=invalid
add action=drop chain=forward comment=\
"defconf: drop packets with bad src ipv6" src-address-list=bad_ipv6
add action=drop chain=forward comment=\
"defconf: drop packets with bad dst ipv6" dst-address-list=bad_ipv6
add action=drop chain=forward comment="defconf: rfc4890 drop hop-limit=1" \
hop-limit=equal:1 protocol=icmpv6
add action=accept chain=forward comment="defconf: accept ICMPv6" protocol=\
icmpv6
add action=accept chain=forward comment="defconf: accept HIP" protocol=139
add action=accept chain=forward comment="defconf: accept IKE" dst-port=\
500,4500 protocol=udp
add action=accept chain=forward comment="defconf: accept ipsec AH" protocol=\
ipsec-ah
add action=accept chain=forward comment="defconf: accept ipsec ESP" protocol=\
ipsec-esp
add action=accept chain=forward comment=\
"defconf: accept all that matches ipsec policy" ipsec-policy=in,ipsec
add action=drop chain=forward comment=\
"defconf: drop everything else not coming from LAN" in-interface-list=\
!LAN
/system clock
set time-zone-name=Europe/Bucharest
/tool mac-server
set allowed-interface-list=LAN
/tool mac-server mac-winbox
set allowed-interface-list=LAN
Can you point me in the right direction or pin point the errors I made ?
Thank you!