match as-number

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

match as-number { number [, number ...] | as-path-access-list name [... name ]}

no match as-number { number [, number ...] | as-path-access-list name [... name ]}]

Syntax Description

number
AS number. The range is from 1 to 65535.
...number
(Optional) AS number. The range is from 1 to 65535.
as-path-access-list name
Specifies an AS-path access list to match AS numbers against. The name can be any alphanumeric string up to 63 characters.
... name
(Optional) AS-path access list. The name can be any alphanumeric string up to 63 characters.

Command Default

None

Command Modes

Route-map configuration mode

Command History

Release
Modification
5.0(3)N1(1)
This command was introduced.

Usage Guidelines

Use the match as-number command to provide a list of AS numbers or an AS-path access list using a regular expression. BGP uses this match criteria to determine which BGP peers to create a BGP session with.

Use the route map to specify a range of AS numbers whose peers can establish a session with the local BGP through prefix peering. Cisco NX-OS ignores any other match commands if the match as-number command is present in the route map.

Examples

This example shows how to configure a list of AS numbers:

switch(config)# route-map IGP2BGP
switch(config-route-map)# match as-number 64496, 64498-64510
switch(config-route-map)#

Related Commands

Command
Description
ip as-path access-list
Creates an AS-path list.
neighbor
Configures BGP peers.
route-map
Defines the conditions for redistributing routes from one routing protocol into another.