Hello Everyone I have a complicated scenario that I have trouble configuring it
as you can see I have multiple WANs that I have to use WG Client with one of them and WG Server with another one
I have to use WG Client from outside of my LAN using my second wan that has WG Server
this is my configuration I’m not an advanced user if any part of my configuration have problem please mention it
my main problem is with firewall and routes
# by RouterOS 7.16beta7
# model = C52iG-5HaxD2HaxD
/interface bridge
add name=LAN
/interface wireguard
add listen-port=13231 mtu=1420 name=wireguard-inet
add listen-port=37773 mtu=1420 name=wireguard-server
/interface macvlan
add interface=ether2 mac-address=3E:63:A2:A4:99:49 mode=private name=macvlan2
/interface pppoe-client
add dial-on-demand=yes disabled=no interface=macvlan2 name=pppoe-out2 user=*******
/ip pool
add name=dhcp_pool0 ranges=192.168.50.2-192.168.50.254
/routing table
add disabled=no fib name=IRWAN
/interface bridge port
add bridge=LAN interface=wifi2
add bridge=LAN interface=wifi1
add bridge=LAN interface=ether5
add bridge=LAN interface=ether4
/ipv6 settings
set disable-ipv6=yes
/interface wireguard peers
add allowed-address=0.0.0.0/0 endpoint-address="VPN Endpoint" endpoint-port=\
51820 interface=wireguard-inet name=Client persistent-keepalive=25s \
public-key="*****"
add allowed-address=192.168.60.2/24 client-address=192.168.60.2/24 \
client-dns=8.8.8.8 client-endpoint="My Public IP" client-listen-port=37773 \
interface=wireguard-server is-responder=yes name=Server public-key=\
"********"
/ip address
add address=192.168.50.1/24 interface=LAN network=192.168.50.0
add address=10.2.0.2/30 interface=wireguard-inet network=10.2.0.0
add address=192.168.60.1/24 interface=wireguard-server network=192.168.60.0
/ip cloud
set ddns-enabled=yes ddns-update-interval=1m
/ip cloud advanced
set use-local-address=yes
/ip dhcp-client
add add-default-route=no interface=ether1 use-peer-dns=no
/ip dhcp-server
add address-pool=dhcp_pool0 interface=LAN name=dhcp1
/ip dhcp-server network
add address=192.168.50.0/24 dns-server=192.168.50.1 gateway=192.168.50.1
/ip dns
set allow-remote-requests=yes servers=10.2.0.1
/ip firewall address-list
add address=217.219.208.0/20 list=IranAddList
add address=217.219.224.0/19 list=IranAddList
add address=192.168.0.0/16 comment=LOCAL-IP list=LOCAL-IP
add address=172.16.0.0/12 comment=LOCAL-IP list=LOCAL-IP
add address=10.0.0.0/8 comment=LOCAL-IP list=LOCAL-IP
add address=cloud2.mikrotik.com comment="Mikrotik Cloud" list="Mik Cloud"
/ip firewall mangle
add action=mark-routing chain=output dst-address-list="Mik Cloud" log=yes new-routing-mark=IRWAN passthrough=no
add action=mark-routing chain=prerouting dst-address-list=IranAddList new-routing-mark=IRWAN passthrough=yes src-address-list=LOCAL-IP
add action=mark-routing chain=output dst-address-list=IranAddList new-routing-mark=IRWAN passthrough=yes src-address-list=LOCAL-IP
add action=mark-routing chain=output dst-address-list=!IranAddList new-routing-mark=main passthrough=yes src-address-list=LOCAL-IP
add action=mark-routing chain=prerouting in-interface=wireguard-server new-routing-mark=main passthrough=yes
/ip firewall nat
add action=masquerade chain=srcnat dst-address-list="Mik Cloud" out-interface=pppoe-out2 routing-mark=IRWAN
add action=masquerade chain=srcnat dst-address-list=IranAddList out-interface=pppoe-out2
add action=masquerade chain=srcnat out-interface=wireguard-inet src-address-list=LOCAL-IP
/ip route
add disabled=no distance=1 dst-address=0.0.0.0/0 gateway=pppoe-out2 \
routing-table=IRWAN scope=30 suppress-hw-offload=no target-scope=10
add disabled=no distance=1 dst-address=0.0.0.0/1 gateway=10.2.0.1 pref-src="" \
routing-table=main scope=30 suppress-hw-offload=no target-scope=10
add disabled=no distance=1 dst-address=128.0.0.0/1 gateway=10.2.0.1 pref-src=\
"" routing-table=main scope=30 suppress-hw-offload=no target-scope=10
add disabled=no dst-address=*VPN Endpoint* gateway=192.168.1.1 \
routing-table=main suppress-hw-offload=no
/routing rule
add action=lookup-only-in-table disabled=no routing-mark=IRWAN table=IRWAN