BGP AS Path Filter Example

Hi @cradlepoint,

It is possible to mix route-maps, filter-lists, distribute-lists etc. but it’s better to stick to a single route-map.

The route-map can do everything you want and it allows you to keep everything in one place. If you want to match on an AS path and set the local preference for those routes, you can do something like this:

ip as-path access-list 1
 permit ^46435_[0-9]*$
!
route-map filter-and-local-pref permit 10
  match as-path 1
 set local-preference 200
!
neighbor x.x.x.x route-map filter-and-local-pref in

Without the empty permit 20 statement, all other prefixes that don’t match your AS path will be denied.

Rene