match as-path

To match a Border Gateway Protocol (BGP) autonomous system (AS) path access list, use the match as-path command. To remove a path list entry, use the no form of this command.

match as-path name [...name]

no match as-path name [...name]

Syntax Description

name

Autonomous system path access list. The name can be any alphanumeric string up to 63 characters.

...name

(Optional) Autonomous system path access list. You can configure up to 32 access list names.


Command Default

No path lists are defined.

Command Modes

Route-map configuration mode

Command History

Release
Modification

5.0(3)N1(1)

This command was introduced.


Usage Guidelines

The values set by the match as-path command overrides global values.

A route map can have several parts. Any route that does not match at least one match clause relating to a route-map command is ignored; that is, the route is not advertised for outbound route maps and is not accepted for inbound route maps. If you want to modify some particular data, you must configure a second route-map section with an explicit match specified.

Examples

This example sets the autonomous system path to match BGP autonomous system path access list 20:

switch(config)# route-map IGP2BGP
switch(config-route-map)# match as-path 20
switch(config-route-map)#

Related Commands

Command
Description

match community

Matches a BGP community.

match ip address

Distributes any routes that have a destination network number address that is permitted by a standard or expanded access list.

match ip next-hop

Redistributes any routes that have a next-hop router address passed by one of the access lists specified.

match route-type

Redistributes routes of the specified type.

match tag

Redistributes routes in the routing table that match the specified tags.

route-map

Defines the conditions for redistributing routes from one routing protocol into another.

set as-path

Modifies an autonomous system path for BGP routes.

set comm-list

Automatically computes the tag value in a route map configuration.

set community

Sets BGP community list (for deletion).

set level

Indicates where to import routes.

set local-preference

Specifies a preference value for the autonomous system path.

set metric (BGP, OSPF, RIP)

Sets the metric value for a routing protocol.

set metric-type

Sets the metric type for the destination routing protocol.

set origin (BGP)

Sets the BGP origin code.

set tag

Sets the value of the destination routing protocol.

set weight

Specifies the BGP weight for the routing table.