Community discussions

MikroTik App
 
Multik
newbie
Topic Author
Posts: 29
Joined: Wed Mar 10, 2010 9:00 am

API -> get Routing Tables

Tue Apr 05, 2016 4:08 pm

How to get all available routing tables?

for example - /ping a have routing-table parameter... how i can get it all from API?

thanks!
 
User avatar
boen_robot
Forum Guru
Forum Guru
Posts: 2400
Joined: Thu Aug 31, 2006 4:43 pm
Location: europe://Bulgaria/Plovdiv

Re: API -> get Routing Tables

Tue Apr 05, 2016 6:44 pm

Question is how would you get them from the command line...

I'm guessing "/ip route print", and then loop over that to find all distinct occurrences of "table".
 
User avatar
docmarius
Forum Guru
Forum Guru
Posts: 1224
Joined: Sat Nov 06, 2010 12:04 pm
Location: Timisoara, Romania
Contact:

Re: API -> get Routing Tables

Tue Apr 05, 2016 9:48 pm

Routing tables may exist even if no route is associated with them. e.g. a VRF with no assigned IP address on its interface. Or a mangle rule setting a routing mark.
But there must be an direct method, since they appear in the dropdown lists in winbox.
If not, this is the moment of a feature request :-)