Hi,
we use policy based routing with two default routes (two different routing marks).
We need default routes for unmarked traffic as well. Therefore we have two default routes without routing marks.
One is the primary (distance 1) and one the backup (distance 2). This works great so far.
Unfortunately the primary uplink has a DHCP-IP. Now we have update the route for unmarked traffic each time the WAN-IP changes.
We would need a script that checks if the gateway of the dynamic route (WAN-KDE) has changed and update the gateway of the static route (for unmarked traffic).

Thanks.
Hey
why not use the dhcp client script for that: when any ip data changes this script is executed https://wiki.mikrotik.com/wiki/Manual:IP/DHCP_Client#Lease_script_example
Wow nice, exact what we need! Thanks a LOT!
For all who search and need such a solution as well: let the option “add default route” in the DHCP-client enabled. This will create two routes, one with the routing mark (created by the script) and one without routing mark (for all unmarked traffic, created by the DHCP-client → option “add default route”).
Edit the script to your routing mark, “WAN1” is in the example, simply change all “WAN1” to your routing mark. And DO NOT remove the comment form the route created by the script!!