Check-gateway on DHCP and PPPoE

Hello,
I’m interested if there is a possiblity to set “check-gateway” feature on default gateway pushed by DHCP or PPPoE server?

Is there a hidden trick, script or something to make this possible?

Both DHCP and PPPoE has the possiblity for a dynamic IP customer endpoint, that provider gives different Gateway,
so if i manually add what i know - and disable “add default route” - may hurt (unless i know all the possiblities they can push, and
manually add all of them)

If not, should we add that to feature requests?

Greets,

You can use/abuse routing filters, e.g.
/routing filter
add chain=dynamic-in prefix=0.0.0.0/0 set-check-gateway=ping

changes /ip route print detail from
0 ADS dst-address=0.0.0.0/0 gateway=pppoe-xxxxxxx
gateway-status=pppoe-xxxxxxx reachable distance=1 scope=30
target-scope=10

to
0 ADS dst-address=0.0.0.0/0 gateway=pppoe-xxxxxxx
gateway-status=pppoe-xxxxxxx reachable check-gateway=ping distance=1
scope=30 target-scope=10

Can somebody know how to achieve same effect on ROS 7.1.1?

Tried something like this, released and renewed dhcp client, but without effect.

/routing filter rule
add chain=dynamic_in disabled=no rule="if (distance == 20) { set distance 10; accept; set gw-check icmp; accept }"

There’s no dynamic-in in v7, but another way how to achieve what you want is using lease script:

http://forum.mikrotik.com/t/routing-filters-fixes-request/154210/10

Thank you mate! That’s quite brilliant sollution. I’ve even added to ignore gateway given by broadband modem while in syncing mode (It is assigning address from 192.168.100.0/24 before it sync with docsis network):

:if ($bound=1 and $"gateway-address" != "192.168.100.254") do={
/ip route set [ find where dst-address="0.0.0.0/0" and distance=1 ] disabled=no gateway=$"gateway-address"
} else={
/ip route set [ find where dst-address="0.0.0.0/0" and distance=1 ] disabled=yes
}

Thanks for your information, you can achieve this by adding this to script section of dhcp client :

:if ($bound=1) do={
/ip route set [ find where dst-address="0.0.0.0/0" and distance=1 ] check-gateway=ping
}