Community discussions

MikroTik App
 
stelios_g
just joined
Topic Author
Posts: 4
Joined: Sun Nov 18, 2007 9:45 pm
Location: Greece
Contact:

Convert BGP routes to static in Ros 7.x

Fri Mar 11, 2022 5:31 pm

In ros 6.x i had a script that was working fine
:foreach i in [/ip route find dynamic=yes] do={
  /ip route add copy-from=$i distance=100 check-gateway=no
}

If i am not wrong it was working because in front of the dynamic routes there were numbers in front of every route static or dynamic route....

Ros V6.x
 #      DST-ADDRESS        PREF-SRC        GATEWAY            DISTANCE
 0 A S  0.0.0.0/0                          10.188.x.x              1
 1 ADC  10.188.x.0/24      10.188.x.x      ether1                    0
 

Ros V7.x
But in version 7 it only has numbers in the static routes and not in the dynamic...

 
 #       DST-ADDRESS         GATEWAY                                                  DISTANCE
 0  Xs   10.188.x.x/32     172.31.x.x                                                    100
 1  As     0.0.0.0/0           85.x.x.x                                                    1
   DAb   10.0.0.0/8          172.x.x.x                                                     20
   DAb   10.0.0.0/24         172.x.x.x                                                    20

Can anyone tell me how can i edit this script to work in Ros7.

Who is online

Users browsing this forum: triss and 43 guests