07-05-2019 02:47 AM
Hi Experts
can you please help me for the below as-path filter creation -IOS XR
I am AS-500 and i have peering with AS-200 (my customer ) .AS-200 have peering with there customers for example AS-20 ,100.
how can i created as filter TEST for sending all routes from my cutomer AS-200 to my uplink providers.need to consider as prepending from customer side
as-path-set TEST
ios-regex '^$',-----routes orginated in AS-500
ios-regex '^200',---routes orginated in AS-200
ios-regex '200+ .* (100|20)'- routes orginated in as 100 and as-20 ( as-200 customers)
end-set
Regards
Solved! Go to Solution.
07-07-2019 01:36 AM - edited 07-07-2019 01:45 AM
Hello aruldaspr,
follow the document below that provides context for Route Policy Language in IOS XR
About the as-set to be configured to pass prefixes that are locally originated or coming from customer AS 200 or coming from AS200 but originated in AS200 customers ASes 100 or 20 you need to use the anchor characters.
Specifically "^" means beginning of the AS path attribute and "$" means end of the AS path attribute.
For example A route is originated by AS 100 if AS100 is the last in the AS path attribute and matches the regexp '_100$'
The special character "_" means a separator in the AS path like a space.
Let's review your proposed configuration
as-path-set TEST
ios-regex '^$',-----routes orginated in AS-500 ! empty AS path this is fine
ios-regex '^200',---routes orginated in AS-200 ! this line is wrong it matches every AS path starting with AS 200
the best formulation is
ios-regex '^200$'
but this does not handle AS path prepending performed by AS200
so you should add
ios-regex '^200_+.*(200_)+200$'
ios-regex '200+ .* (100|20)'- routes orginated in as 100 and as-20 ( as-200 customers)
I would see it as:
ios-regex '^200_+.*(100_|20_)+ (100|20)$'
end-set
to be noted you can also avoid to use the regular expression if you use specific match commands like
neighbor is ! here you specify the peer AS AS 200 in your case
originates-from ! here you specify AS 100 or AS 20
see the following reference
Hope to help
Giuseppe
07-05-2019 11:21 PM
i assume u have access to bgp router of your customer AS-200, right?
07-06-2019 12:19 AM
Hello,
--> how can i created as filter TEST for sending all routes from my cutomer AS-200 to my uplink providers.need to consider as prepending from customer side
It is unclear what you are trying to do. Who are your uplink providers ?
Can you provide a schematic drawing of your topology including the ASs involved and what you try to filter going where ?
07-06-2019 05:19 AM
07-07-2019 01:36 AM - edited 07-07-2019 01:45 AM
Hello aruldaspr,
follow the document below that provides context for Route Policy Language in IOS XR
About the as-set to be configured to pass prefixes that are locally originated or coming from customer AS 200 or coming from AS200 but originated in AS200 customers ASes 100 or 20 you need to use the anchor characters.
Specifically "^" means beginning of the AS path attribute and "$" means end of the AS path attribute.
For example A route is originated by AS 100 if AS100 is the last in the AS path attribute and matches the regexp '_100$'
The special character "_" means a separator in the AS path like a space.
Let's review your proposed configuration
as-path-set TEST
ios-regex '^$',-----routes orginated in AS-500 ! empty AS path this is fine
ios-regex '^200',---routes orginated in AS-200 ! this line is wrong it matches every AS path starting with AS 200
the best formulation is
ios-regex '^200$'
but this does not handle AS path prepending performed by AS200
so you should add
ios-regex '^200_+.*(200_)+200$'
ios-regex '200+ .* (100|20)'- routes orginated in as 100 and as-20 ( as-200 customers)
I would see it as:
ios-regex '^200_+.*(100_|20_)+ (100|20)$'
end-set
to be noted you can also avoid to use the regular expression if you use specific match commands like
neighbor is ! here you specify the peer AS AS 200 in your case
originates-from ! here you specify AS 100 or AS 20
see the following reference
Hope to help
Giuseppe
07-18-2019 10:38 AM
Dear Giuseppe,
Thank you
i will configure and update thank you for your support.
Regards
Aruldas
02-02-2020 02:17 AM
Dear Giuseppee,
Thans for your help
One more ,
I am in AS200 and my customer is AS300 , I need to accept and advertise all the prefixes from AS300 ( including AS300 routes and its customer AS routes not only AS300 directly connected customers routes, from all AS behind AS300 Customers )
ios-regex ^300_
how we can create bgp regular expression for this
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide