Community discussions

 
pavel7654321
just joined
Topic Author
Posts: 22
Joined: Tue Jun 02, 2009 9:00 am

How to print main routing table contents from console?

Wed Jun 01, 2011 1:15 pm

Hi!

I have several routing tables and routes with no mark.
When I type:
/ip route print where routing-mark=tab1
then all is ok and content of a tab1 is printed. But when I type:
/ip route print where routing-mark=main
then result is empty. And when I simply type
/ip route print
then console prints me all routes in all tables (Wiki says "routing-mark not set by default which is the same as main").

Is there some special command to print only main routing table (like in Winbox)?
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 5934
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: How to print main routing table contents from console?

Wed Jun 01, 2011 1:30 pm

by default routing-mark=main is not set. So to print all routes that are not in other routing tables you can use this command
/ip route print where !routing-mark
 
pavel7654321
just joined
Topic Author
Posts: 22
Joined: Tue Jun 02, 2009 9:00 am

Re: How to print main routing table contents from console?

Wed Jun 01, 2011 3:48 pm

Thank you very much
 
User avatar
SiB
Member Candidate
Member Candidate
Posts: 175
Joined: Sun Jan 06, 2013 11:19 pm
Location: Poland

Re: How to print main routing table contents from console?

Sat Mar 19, 2016 12:36 am

not only 'routing-mark=main' is not work at /ip route print where ... .

3x Flags (dynamic, connect, static) are not work with =no.
The 'disabled=no' and 'active=no' works correctly.

Workaround is to use '!flag=yes' or '!flag' what mean the same like 'flag=no'.
MTCNA + MTCRE + MTCINE | ~600 users at ~150 RouterBoards in EMEA | Telegram: @SiB_PL | WebChat: Tokonda
WinBox Tip: F6 works as ALT+TAB | Gliffy.com - free network schematic | prnt.sc - free ScreenShot software
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 5934
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: How to print main routing table contents from console?

Tue Mar 22, 2016 10:28 am

Value "no" is not the same as unset value. If route is not dynamic, then value for dynamic parameter is not set at all, so if you compare "no" to nothing then of course it will fail.
 
User avatar
SiB
Member Candidate
Member Candidate
Posts: 175
Joined: Sun Jan 06, 2013 11:19 pm
Location: Poland

Re: How to print main routing table contents from console?

Tue Mar 22, 2016 2:03 pm

I fully undestand your answer. But still when I press <TAB> or <?> key for any new information I can see the options who should be working.
cli345345.png
At many place of CLI I found a misleading syntax. I cannot go to wiki and add my own suggestion/corrections because is close for MT employer only. You know, I hope to have a proper CLI help in index.
I can only write to support and on this forum.
You do not have the required permissions to view the files attached to this post.
MTCNA + MTCRE + MTCINE | ~600 users at ~150 RouterBoards in EMEA | Telegram: @SiB_PL | WebChat: Tokonda
WinBox Tip: F6 works as ALT+TAB | Gliffy.com - free network schematic | prnt.sc - free ScreenShot software

Who is online

Users browsing this forum: No registered users and 84 guests