I have written a script that can be used and stored on the MiktoTik Routers that will allow you to do the same as the following Cisco commands:-
show ip bgp summary
show ip bgp ipv4 unicast summary
show ip bgp ipv6 unicast summary
show ip bgp summary | include 64500
show ip bgp ipv4 unicast summary | include 64500
show ip bgp ipv6 unicast summary | include 64500
You will need to paste the following into the router from a terminal window
Code: Select all
/system script
add name="show bgp summary include" policy=ftp,winbox,api source=":if ( \$as = nil ) do={\r\
\n\t/routing bgp peer\r\
\n\t:do {\r\
\n\t:put \"Neighbor \\t\\t ASN \\t Prefix Limit \\t Passive \\t PfxRcd \\t State \\t Up/Down\" \r\
\n\t:foreach i in=[find instance=default] do={ :put \"\$[get \$i remote-address] \\t \$[get \$i remote-as] \\t \$[get \$i max-prefix-limit] \\t\\t \$[get \$i passive] \\t\\t \$[get \$i prefix-count] \\t\\t \$[get \$i state] \\t \$[get \$i upti\
me]\" } \r\
\n\t}\r\
\n} else={\r\
\n\t/routing bgp peer\r\
\n\t:do {\r\
\n\t:put \"Neighbor \\t\\t ASN \\t Prefix Limit \\t Passive \\t PfxRcd \\t State \\t Up/Down\" \r\
\n\t:foreach i in=[find remote-as=\$as] do={ :put \"\$[get \$i remote-address] \\t \$[get \$i remote-as] \\t \$[get \$i max-prefix-limit] \\t\\t \$[get \$i passive] \\t\\t \$[get \$i prefix-count] \\t\\t \$[get \$i state] \\t \$[get \$i uptime\
]\" } \r\
\n\t}\r\
\n}\r\
\n"
/system scheduler
add name="Show BGP Summary Schedule" on-event=":global shbgpsum [:parse [/system script get \"show bgp summary include\" source]]\r\
\n" policy=reboot,read,write,policy,test,winbox start-time=startup
Once the above has been done you will be able to use the following global command fro anywhere in a terminal window to print the information to the screen in the same way as Cisco devices do
Code: Select all
$shbgpsum as=64500
$shbgpsum
Kind regards,
Marc