Community discussions

MikroTik App
 
imnew
just joined
Topic Author
Posts: 4
Joined: Tue Nov 14, 2023 4:24 am

BGP filter with as-path

Tue Nov 14, 2023 4:41 am

Hi , Anyone how are you ?

Today I have a question about Mikrotik OS7 v 7.12 Filtering bgp routes. My connection is iBGP with an ISP. I want to Filter / reject some as-paths. Recently I used this filter.

if (bgp-as-path 7XXX) {reject}

When I add this filter on the bgp I'm connected to, I check the route and I still get This as-path comes along. Therefore, I would like to ask for advice from all knowledgeable people. Please advise me, for example, is my filter command wrong? Or is there another command to make it work correctly?


Thank you all in advance.
 
nediis
Frequent Visitor
Frequent Visitor
Posts: 63
Joined: Wed Jul 11, 2018 10:32 am

Re: BGP filter with as-path

Wed Nov 15, 2023 1:31 am

it will be visible, but filtered and inactive?
 
imnew
just joined
Topic Author
Posts: 4
Joined: Tue Nov 14, 2023 4:24 am

Re: BGP filter with as-path

Wed Nov 22, 2023 5:38 am

it will be visible, but filtered and inactive?
i checked is show active but i try on some Os6 is rejected not show route of that as i don't know on os7 what is correct filter command

Thankyou
 
LdB
Member Candidate
Member Candidate
Posts: 145
Joined: Thu May 20, 2021 4:23 pm

Re: BGP filter with as-path

Wed Nov 22, 2023 6:50 am

Accept
if (dst in xxx.xxx.xxx.0/24 && dst-len in 24-32) { accept; }
Reject
if (dst in xxx.xxx.xxx.0/24 && dst-len in 24-32) { reject; }
 
User avatar
chechito
Forum Guru
Forum Guru
Posts: 3007
Joined: Sun Aug 24, 2014 3:14 am
Location: Bogota Colombia
Contact:

Re: BGP filter with as-path

Thu Nov 23, 2023 4:46 am

 
User avatar
jspool
Member
Member
Posts: 469
Joined: Sun Oct 04, 2009 4:06 am
Location: Oregon

Re: BGP filter with as-path

Thu Nov 23, 2023 7:15 am

Hi , Anyone how are you ?

Today I have a question about Mikrotik OS7 v 7.12 Filtering bgp routes. My connection is iBGP with an ISP. I want to Filter / reject some as-paths. Recently I used this filter.

if (bgp-as-path 7XXX) {reject}

When I add this filter on the bgp I'm connected to, I check the route and I still get This as-path comes along. Therefore, I would like to ask for advice from all knowledgeable people. Please advise me, for example, is my filter command wrong? Or is there another command to make it work correctly?


Thank you all in advance.
You need to apply the correct syntax to get the desired match.

if (bgp-as-path ^6939) {reject} = reject any routes that begin with AS6939
if (bgp-as-path 6939$) {reject} = reject any routes with origin AS6939

https://help.mikrotik.com/docs/display/ ... xpMatching
 
imnew
just joined
Topic Author
Posts: 4
Joined: Tue Nov 14, 2023 4:24 am

Re: BGP filter with as-path

Mon Nov 27, 2023 7:32 am

Hi , Anyone how are you ?

Today I have a question about Mikrotik OS7 v 7.12 Filtering bgp routes. My connection is iBGP with an ISP. I want to Filter / reject some as-paths. Recently I used this filter.

if (bgp-as-path 7XXX) {reject}

When I add this filter on the bgp I'm connected to, I check the route and I still get This as-path comes along. Therefore, I would like to ask for advice from all knowledgeable people. Please advise me, for example, is my filter command wrong? Or is there another command to make it work correctly?


Thank you all in advance.
You need to apply the correct syntax to get the desired match.

if (bgp-as-path ^6939) {reject} = reject any routes that begin with AS6939
if (bgp-as-path 6939$) {reject} = reject any routes with origin AS6939

https://help.mikrotik.com/docs/display/ ... xpMatching

Thankyou somuch

Who is online

Users browsing this forum: No registered users and 2 guests