Did anyone find a working example of a bgp-as-path filter?
The writing of documentation was clearly interrupted halfway and it is not complete now.
There is a special paragraph that says:
There are two common ways how to operate with AS Path data:
convert whole AS path to string and let regexp operate on the string (ROS v6 or Cisco style)
let regexp operate on each entry in the AS path as a number (ROS v7, Juniper style)
The latter method is much faster and less resource-intensive than the string matching approach.
That is clear. We have to use a new method to look in AS path entries. I think that is reasonable, but nowhere it is specified how the match statements should look.
I need filter rules that match a certain AS at:
- the begin of the AS path (this can probably be replaced with bgp-input-remote-as now)
- the originating AS (this would be matched using " 1234$" in the v6 syntax but now we supposedly can match "the last item of the AS list" with a literal number. but how?)
- some AS occurring anywhere in the path.
It should not be difficult to add examples for these cases to the documentation, and then the full capabilities can be documented later.