Routing mikrotik's own traffic

I am trying to route mikrotik’s dns request’s (using DNS server) through a specific gateway but with no luck. I am using
action=mark-routing chain=output comment=“” disabled=no dst-port=53
new-routing-mark=ICMP passthrough=yes protocol=udp
comment=“ICMP” disabled=no distance=1 dst-address=0.0.0.0/24
gateway=192.168.2.254 routing-mark=“icmp” scope=30
target-scope=10

Although the mangle roule marks packets, they are not redirecting to the gateway. Same thing with ping requests from mikrotik (i am trying to create a script for checking gateway availiability)

dst-address=0.0.0.0/24 is wrong dst-address. use dst-address=0.0.0.0/0

My mistake, it is actually 0.0.0.0/0. Any other tips?

what version of ROS? do you have default gateway in your ‘main’ routing table? how do you check that it’s not working?

ping has an option for src-ip now right? I think i saw that added. Or was it routing-table?

also, “ICMP” routing mark isnt the same as “icmp” - was tht an actual export or pseudo code?

SAm

ping supports setting both src-address and routing-table

I am using Ros 4.4. Sorry for the misunderstanding ICMP is the same in both. The actual configuration is a little big so i don't want to paste it. Ping does support src-address but it doesn't force the ping through the interface the address is assigned on.(at least not in my case) I have also tried interface=ether2 but when it is used, mikroting pings with arp and I cannot ping, for example, webpages, only local machines. The weird thing is that the ping utility in mikrotik behaves correctly, meaning it can ping the same address using different interfaces without using arp. Here is the scrip I am trying to use:
#set variables
:local pingcount 3
:local intA ether2
:local GatewayA 192.168.1.1
:local intB ether3
:local GatewayB 192.168.2.254
:local intC ether4
:local GatewayC 192.168.3.254

#ping gateways with interface
:local pingresultA [/ping 74.52.29.242 interface=$intA count=$pingcount]
:local pingresultB [/ping 74.52.29.242 interface=$intB count=$pingcount]
:local pingresultC [/ping 74.52.29.242 interface=$intC count=$pingcount]

\

GatewayA enable/disable:

:if ($pingresultA=0) do={/ip route set [find gateway=$GatewayA] disabled=yes}
:if ($pingresultA=3) do={/ip route set [find gateway=$GatewayA] disabled=no}

GatewayB enable/disable:

:if ($pingresultB=0) do={/ip route set [find gateway=$GatewayB] disabled=yes}
:if ($pingresultB=3) do={/ip route set [find gateway=$GatewayB] disabled=no}

GatewayC enable/disable:

:if ($pingresultA=0) do={/ip route set [find gateway=$GatewayC] disabled=yes}
:if ($pingresultA=3) do={/ip route set [find gateway=$GatewayC] disabled=no}