joi
June 5, 2024, 2:43am
1
Hi, I have a question about BGP filters in V7. If I want to filter by source ASN, but I have multiple sources, can I put them in a single instruction like this?
"if(bgp-input-remote-as=20000 30000 40000 50000 60000) {accept}"
or do I have to put each line in different scripts?
I appreciate it in advance.
mrz
June 5, 2024, 5:36am
2
Add all numbers in num-list, and then use that numlist in a single rule.
if(bgp-input-remote-as==20000||bgp-input-remote-as==30000||bgp-input-remote-as==40000||bgp-input-remote-as==50000||bgp-input-remote-as==60000) {accept}
or use num-list as mentioned by @mrz
joi
June 5, 2024, 10:15pm
4
Thank you for your help. I apologize for the questions, but this is the first time I’m going to use this option. How can I generate a num-list in V7?
Larsa
June 5, 2024, 11:02pm
5
Check “num-list” in “https://help.mikrotik.com/docs/display/ROS/Route+Selection+and+Filters ”. You can also use regex as described in the section “Regex Testing Tool”
Example of num-list:
/routing/filter/num-list
add list=MYLIST-AS range=20000
add list=MYLIST-AS range=30000
add list=MYLIST-AS range=40000
"if (bgp-as-path [[:MYLIST-AS:]]){ accept }"
joi
June 6, 2024, 2:55am
6
Thank you all for taking the time to reply