Thanks, this looks pretty amazing! I didn’t notice that I can attach scripts to a DHCP Client, this opens whole new possibilities. I’m still a Mikrotik NOOB, sorry for my dumb assumptions.
Disabled default route on the DHCP clients + Added the three routes + Configured the two DHCP clients with the scripts. After toggling the DHCP clients, the routes updated with the correct gateways. That’s already very nice.
I’m now stuck that it looks like the check-gateway fails. Thus it always prefers ISP2.
My routes:
[admin@MikroTik] > /ip/route print
Flags: D - DYNAMIC; I - INACTIVE, A - ACTIVE; c - CONNECT, s - STATIC, y - COPY; H - HW-OFFLOADED
Columns: DST-ADDRESS, GATEWAY, DISTANCE
# DST-ADDRESS GATEWAY DI
;;; C - ISP2 is alternative Gateway
0 As 0.0.0.0/0 172.16.50.1 20
;;; B - Recursive Routing, check ping 1.1.1.1 instead of ISP IP
1 IsH 0.0.0.0/0 1.1.1.1 10
;;; A - 1.1.1.1 must be reachabble only from ISP1
2 As 1.1.1.1/32 77.109.171.1 1
DAc 77.109.171.0/24 init7 0
DAc 172.16.50.0/24 50 0
DAc 172.16.90.0/24 90 0
DAc 192.168.88.0/24 lan 0
3 As 192.168.99.0/24 172.16.50.1 1
Next I checked if the static route for 1.1.1.1/32 worked. This seems to be the case compared to a traceroute with another IP (172.16.50.3 is an external NAT Router behind the same ISP for testing purposes):
[admin@MikroTik] > /tool/traceroute 1.1.1.1
Columns: ADDRESS, LOSS, SENT, LAST, AVG, BEST, WORST, STD-DEV
# ADDRESS LO S LAST AVG BES WOR STD
1 77.109.183.62 0% 2 7.3ms 7.4 7.3 7.4 0.1
2 77.109.183.61 0% 2 8ms 7.7 7.4 8 0.3
3 82.197.168.35 0% 2 9ms 8.4 7.7 9 0.7
4 194.42.48.14 0% 2 7.7ms 7.6 7.5 7.7 0.1
5 1.1.1.1 0% 2 7ms 7 6.9 7 0.1
[admin@MikroTik] > /tool/traceroute 8.8.8.8
Columns: ADDRESS, LOSS, SENT, LAST, AVG, BEST, WORST, STD-DEV
# ADDRESS LO S LAST AVG BES WOR S
1 172.16.50.3 0% 1 0.6ms 0.6 0.6 0.6 0
2 77.109.183.62 0% 1 7.7ms 7.7 7.7 7.7 0
3 77.109.183.61 0% 1 7.9ms 7.9 7.9 7.9 0
4 5.180.135.161 0% 1 7.9ms 7.9 7.9 7.9 0
5 77.109.135.214 0% 1 7.3ms 7.3 7.3 7.3 0
6 74.125.243.161 0% 1 8.8ms 8.8 8.8 8.8 0
7 172.253.50.19 0% 1 8.5ms 8.5 8.5 8.5 0
8 8.8.8.8 0% 1 7.7ms 7.7 7.7 7.7 0
Did I miss something?