I'm trying to get the default route with routing mark main using API, but returned array is empty
Code with routing mark main.
I see that, if I don't specify routing mark, the array of the default gateway returned hasn't got the routing-mark key
$gateway=$API->comm('/ip/route/getall', array('?dst-address'=>'0.0.0.0/0', '?distance'=>'1', '?routing-mark'=>'main'));
Code without routing mark
Print of $gateway
$gateway=$API->comm('/ip/route/getall', array('?dst-address'=>'0.0.0.0/0', '?distance'=>'1'));
The problem is that I have other routes with dst-address 0.0.0.0/0 but with a different routing mark than main.
Array ( [.id] => *30000006 [dst-address] => 0.0.0.0/0 [gateway] => pppoe-client [gateway-status] => pppoe-client reachable [distance] => 1 [scope] => 30 [target-scope] => 10 [active] => true [dynamic] => true [static] => true [disabled] => false ) )
Can I exclude them with something similar like the first code, or I have to take them all, save arrays in another array and then take the one without routing mark?