I'm trying to get the default route with routing mark main using API, but returned array is empty
Code with routing mark main.
Code: Select all
$gateway=$API->comm('/ip/route/getall', array('?dst-address'=>'0.0.0.0/0', '?distance'=>'1', '?routing-mark'=>'main'));
Code without routing mark
Code: Select all
$gateway=$API->comm('/ip/route/getall', array('?dst-address'=>'0.0.0.0/0', '?distance'=>'1'));
Code: Select all
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?