Community discussions

MikroTik App
 
tiernano
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 79
Joined: Fri Jul 20, 2012 1:51 pm

Removing items from an AS-Path

Sun Jul 31, 2022 3:37 am

Good morning all.

I am running a CHR instance in Vultr, and after a LOT of messing, i have a few things working, and a few things not working... But one thing i am trying to get working is removing items from AS-Paths... Vultr sends back their AS-Path with 2 private AS items (in my case, 64525 and 65534 in Amsterdam). So, i might get an AS Path of: 64515,65534,20473,13335 for 1.1.1.0/24. In reality, that should only be the last 2... Any ideas how to remove the first 2 from the list? I have a filter rule in Bird that removes the items, but I cant seem to figure out how to do the same (if possbile) on RouterOS... I can append items, but not remove... Any ideas?

Thanks.
 
eduplant
Member Candidate
Member Candidate
Posts: 122
Joined: Tue Dec 19, 2017 9:45 am

Re: Removing items from an AS-Path

Sun Jul 31, 2022 10:00 am

I don't think you're missing anything.

From reading the documentation, it seems like bgp-as-path is an immutable property of a BGP route in RouterOS 6 and 7. In 6.x, the only AS_PATH related actions in route filters are set-bgp-prepend and set-bgp-prepend-path. In 7.x, bgp-path-peer-prepend and bgp-path-prepend are writable properties that can be used with the set action, but bgp-as-path itself is immutable.
 
pe1chl
Forum Guru
Forum Guru
Posts: 8998
Joined: Mon Jun 08, 2015 12:09 pm

Re: Removing items from an AS-Path

Sun Jul 31, 2022 11:40 am

It is very important that you mention the RouterOS version (v6 or v7) in questions about BGP because these are completely different BGP implementations.
In v7 there is a config "remove-private-as=yes" but its function seems to be limited to the use on your own export side of internally used private AS numbers: if and only if the entire path consists of private AS numbers, it is deleted (and then of course the local AS is used instead).
Maybe you can submit a feature request to have this function extended to cover the use case you have...
(where some other mode of remove-private-as would remove private AS numbers from the head of the list, and keep the others)

Of course, when you are still using v6 you would have to upgrade to v7, and that is a decision not to be made lightly when you are using BGP.
 
tiernano
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 79
Joined: Fri Jul 20, 2012 1:51 pm

Re: Removing items from an AS-Path

Sun Jul 31, 2022 9:40 pm

I forgot to mention i was using RouterOS 7... Thanks for the heads up. I will open a request to see if it can be added as a feature...

Who is online

Users browsing this forum: Bing [Bot] and 5 guests