Forwar VPN through specific Dynamic Wan

Good evening,
As you read from the title i need help on that. I have one Mikrotik with two pppoe clients (Wan1 , Wan2) which are dynamic. I want the 1st Wan to be used for work and the 2nd Wan i want to be used for remote backup through VPN (L2tp) in another location again with Mikrotik and again with dynamic pppoe wan. If i take the dynamic ip of the remote location and put it directly in routes (dst addr = ip, Gateway = Wan2) of the 1st Mikrotik then it works fine. But Ip changes every day so i cant work with that.
Any ideas cause i’m out of them…

Thank you

PPPoE can run scripts when it connects or disconnects, you can configure routes from there.

Manual (look for on-up and on-down): https://wiki.mikrotik.com/wiki/Manual:PPP_AAA#User_Profiles

Good evening
Thank you for the reply but i can’t manage to understand your solution. Maybe i didnt explain correct.
Site1
Mikrotik
2 Wan (WAN1, WAN2) via PPPOE Client through internet provider that takes random ip from now and then (i want to use WAN2 for vpn)
Server

Site2
Mikrotik
1 Wan via PPPOE Client through internet provider that takes random ip from now and then
Nas

L2TP VPN
Site 1 L2tp Client via Mikrotik Cloud of site2 L2tp Server.
How can i use the pppoe Scipt for site 1 to renew route ip taken from Site 2?

Hope it is more clear now.
Thank you in advance

Ok i made a new profile for VPN and added this script on up and worked.

:log info "Starting VPN update"
:global RemoteIp [:resolve <>]
:log info "New remote IP is $RemoteIp"
/ip route set 0 dst-address=$RemoteIp


Thank you

That’s it. Only instead of using rule number directly, you may want to give the route some unique comment and use that to find it, i.e.:

/ip route set [/ip route find comment="my-route"] dst-address=$RemoteIp

That way it will work even if you make some changes in routes and this one will no longer be number 0.

You are the best. Thank you