Name

match as-path — route-map

Synopsis

match as-path path-list-number
no match as-path path-list-number

Configures

BGP route filtering

Default

None

Description

This command allows you to require that any route in a route map pass an AS path access list. Routes that are permitted by the list undergo further processing. You might use this command to create a route map that modifies routing metrics or changes the routes in some way, depending on the routes’ AS path. These modifications are applied only to routes matching the AS path access list.

Example

The following code filters all routes to be sent to the neighboring router 10.10.1.1 through the AS path list 1. The AS path list is applied in the route map test-as-path, which adds our AS number (300) to all routes that match this list.

route-map test-as-path
  match as-path 1
  set as-path prepend 300
!
ip as-path access-list 1 permit .*
!
router bgp 300
  neighbor 10.10.1.1 route-map set-as-path out

Get Cisco IOS in a Nutshell, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.