Community discussions

MikroTik App
 
reion
just joined
Topic Author
Posts: 24
Joined: Mon Nov 05, 2012 10:16 am

routes to address list

Tue Dec 27, 2016 3:09 pm

Hi to All!
Who can help me solve my issue!
Is there any way to add subnets received via BGP into one address-list?
I've tried like:
/ip firewall address-list add address=[/ip route find where bgp] list BGP
no results.
Thanks!
 
User avatar
BartoszP
Forum Guru
Forum Guru
Posts: 2880
Joined: Mon Jun 16, 2014 1:13 pm
Location: Poland

Re: routes to address list

Tue Dec 27, 2016 5:08 pm

Haven't you forgot one equal sign after "list" keyword ?
/ip firewall address-list add address=[/ip route find where bgp] list=BGP
 
reion
just joined
Topic Author
Posts: 24
Joined: Mon Nov 05, 2012 10:16 am

Re: routes to address list

Tue Jan 17, 2017 6:09 pm

failure: *440761e1;*4407b265;*4406f747;*........
...
...
...
;*4407
51bb is not a valid dns name
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7056
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: routes to address list

Tue Jan 17, 2017 6:25 pm

This is not going to work because you are trying to add strng of internal IDs as address not the prefix from the routing table.
:foreach i in=[/ip route find where bgp] do={
  /ip firewall address-list add address=[/ip route get $i dst-address] list=bgp
}
 
reion
just joined
Topic Author
Posts: 24
Joined: Mon Nov 05, 2012 10:16 am

Re: routes to address list

Thu Mar 02, 2017 11:13 am

Thanks a lot!!!
Works perfect!
Can you please suggest me, can I create an scheduler and run this script every day for example?
 
reion
just joined
Topic Author
Posts: 24
Joined: Mon Nov 05, 2012 10:16 am

Re: routes to address list

Thu Mar 02, 2017 11:33 am

Hi again! One one of my routers I can get next output:
[user@R1] > foreach i in=[/ip route find where bgp] do={/ip firewall address-list add ad
dress=[/ip route get $i dst-address] list=BGP}
failure: already have such entry
[user@R1] > ip fir address-list print where list=BGP
Flags: X - disabled, D - dynamic
# LIST ADDRESS TIMEOUT
0 BGP 0.0.0.0/0
[user@R1] >
can this be output because of multi-homing, and same routes are received from 2 different peers? Can I exclude 0.0.0.0/0 adding to this list?
Thank you very much!
 
raminmalek
Member Candidate
Member Candidate
Posts: 156
Joined: Sun Nov 02, 2008 5:51 pm

Re: routes to address list

Sat Feb 24, 2018 8:21 pm

I have router OS 6.39.3


I see this error


failure: already have such entry

Who is online

Users browsing this forum: No registered users and 57 guests