You want to filter the BGP routes that you send or receive based on the AS path information in the routes.
To filter the routes, create a routing policy that acts on a route's AS path information. The first step is to define a regular expression that matches the AS path information:
[edit policy-options] aviva@RouterD#
set as-path from-
Then reference the AS path information in a routing policy:
[edit policy-options policy-statement
Finally, apply the policy to a BGP group:
[edit protocols bgp] aviva@RouterD#
It it often useful to develop routing policies based on information within the AS path information. You can then use these policies to enforce your network's administrative policy with respect to a customer or peer. Instead of looking for many prefixes or routes individually, it can be easier to use the AS path. The AS path attribute lets you filter all routes that originated from or transited through a particular AS, all routes announced by a particular neighboring AS, and routes that originated in the local AS.
To match information in the AS path attribute, you first create a regular expression that identifies the match conditions. In this recipe, the
set as-path command creates the regular ...