Route-map Configuration Mode Commands

The Route-Map Configuration sub-mode is used for the OSPFv2 and BGP-4 routing protocols. This mode includes commands that configure matching rules and set actions to perform on matched routes.

Mode

Exec > Global Configuration > Context Configuration > Route-map Configuration

configure > context context_name > route-map map_name { deny | permit } seq_number

Entering the above command sequence results in the following prompt:

[context_name]host_name(config-route-map)# 

Important


The commands or keywords/variables that are available are dependent on platform type, product version, and installed license(s).


do show

Executes all show commands while in Configuration mode.

Product

All

Privilege

Security Administrator, Administrator

Syntax

do show 

Usage Guidelines

Use this command to run all Exec mode show commands while in Configuration mode. It is not necessary to exit the Config mode to run a show command.

The pipe character | is only available if the command is valid in the Exec mode.


Caution


There are some Exec mode show commands which are too resource intensive to run from Config mode. These include: do show support collection , do show support details , do show support record and do show support summary . If there is a restriction on a specific show command, the following error message is displayed:

Failure: Cannot execute 'do	show support' command from Config mode.

end

Exits the current configuration mode and returns to the Exec mode.

Product

All

Privilege

Security Administrator, Administrator

Syntax

end 

Usage Guidelines

Use this command to return to the Exec mode.

exit

Exits the current mode and returns to the parent configuration mode.

Product

All

Privilege

Security Administrator, Administrator

Syntax

exit 

Usage Guidelines

Use this command to return to the parent configuration mode.

match as-path

Matches an Autonomous System (AS) path access list

Product

HA

Privilege

Security Administrator, Administrator

Mode

Exec > Global Configuration > Context Configuration > Route-map Configuration

configure > context context_name > route-map map_name { deny | permit } seq_number

Entering the above command sequence results in the following prompt:

[context_name]host_name(config-route-map)# 

Syntax

[ no ] match as-path AS_list 

no

Disables matching the specified AS path access list.

AS_list

Specifies the name of an AS path access list for matching as an alphanumeric string of 1 through 79 characters.

Usage Guidelines

This command is used for BGP-4 routing to specify an AS path access list to be matched. Refer to the ip as-path access-list command for more information.

Example

To match entries in an AS path access list named ASlist1, enter the following command;
match as-path ASlist1 

match community

Configures filtering (permit or deny) via a BGP community-list in a route map.

Product

All

Privilege

Security Administrator, Administrator

Mode

Exec > Global Configuration > Context Configuration > Route-map Configuration

configure > context context_name > route-map map_name { deny | permit } seq_number

Entering the above command sequence results in the following prompt:

[context_name]host_name(config-route-map)# 

Syntax

[no] match community { named  named_list | standard  identifier } 

no

Disables matching the specified community list.

named named_list

Specifies the name of a community list as an alphanumeric string of 1 through 79 characters.

standard identifier

Specifies the name of a community list as an integer from 1 through 99.

Usage Guidelines

Configures filtering (permit or deny) via a BGP community-list in a route map.

The community list must have been previously configured via the Context Configuration mode ip community-list command.

Example

This command matches community-list number 2:
match community standard 2 

match extcommunity

Configures filtering (permit or deny) via a BGP external community-list in a route map. An external community-list is a Route Target.

Product

HA

Privilege

Security Administrator, Administrator

Mode

Exec > Global Configuration > Context Configuration > Route-map Configuration

configure > context context_name > route-map map_name { deny | permit } seq_number

Entering the above command sequence results in the following prompt:

[context_name]host_name(config-route-map)# 

Syntax

[no] match extcommunity { named  named_list | standard  identifier } 

no

Disables matching the specified external community list.

named named_list

Specifies the name of an external community list as an alphanumeric string of 1 through 79 characters.

standard identifier

Specifies the name of an external community list as an integer from 1 through 99.

Usage Guidelines

Configures filtering (permit or deny) via a BGP external community-list in a route map. An external community-list is a Route Target.

A BGP extended community defines a route target. MPLS VPNs use a 64-bit Extended Community attribute called a Route Target (RT). An RT enables distribution of reachability information to the correct information table.

The external community list must have been previously configured via the Context Configuration mode ip extcommunity-list command.

Example

This command matches external community-list number 99:
match extcommunity standard 99 

match interface

Specifies the next-hop interface name of a route to be matched.

Product

All

Privilege

Security Administrator, Administrator

Mode

Exec > Global Configuration > Context Configuration > Route-map Configuration

configure > context context_name > route-map map_name { deny | permit } seq_number

Entering the above command sequence results in the following prompt:

[context_name]host_name(config-route-map)# 

Syntax

[ no ] match interface interface_name 

no

Disables matching the specified interface name.

interface_name

Specifies the name of the virtual interface for matching as an alphanumeric string of 1 through 79 characters.

Usage Guidelines

Use this command to specify the next hop interface name for routes to be matched.

Example

To match routes that have the next hop interface specified as Interface123, enter the following command:
match interface Interface123 

match ip address

Matches IPv4 routes with entries in a route-access-list or prefix-list.

Product

All

Privilege

Security Administrator, Administrator

Mode

Exec > Global Configuration > Context Configuration > Route-map Configuration

configure > context context_name > route-map map_name { deny | permit } seq_number

Entering the above command sequence results in the following prompt:

[context_name]host_name(config-route-map)# 

Syntax

[ no ] match ip address { prefix-list | route-access-list } list_name 

no

Disables matching from the specified prefix list or route access list.

prefix-list

Matches any routes with entries in a prefix-list.

route-access-list

Matches any routes with entries in a route-access-list.

list_name

Specifies the name of the IPv4 prefix list or IPv4 route access-list as an alphanumeric string of 1 through 79 characters.

Usage Guidelines

Use this command to match routes specified in an IPV4 route-access-list or prefix-list.

Example

To match routes that are specified in an IPv4 prefix list named Prefix100, enter the following command:
match ip address prefix-list Prefix100 

match ip next-hop

Matches next-hop IPv4 addresses with entries in a speicifed prefix-list or route-access-list.

Product

All

Privilege

Security Administrator, Administrator

Mode

Exec > Global Configuration > Context Configuration > Route-map Configuration

configure > context context_name > route-map map_name { deny | permit } seq_number

Entering the above command sequence results in the following prompt:

[context_name]host_name(config-route-map)# 

Syntax

[ no ] match ip next-hop { prefix-list | route-access-list } list_name 

no

Disables matching from the specified prefix list or route access list.

prefix-list

Matches any routes that have a next-hop router IPv4 address that has an entry in the specified prefix list.

route-access-list

Matches any routes that have a next-hop router IPv4 address that has an entry in the specified route-access-list.

list_name

Specifies the name of the prefix-list or route-access-list as an alphanumeric string of 1 through 79 characters.

Usage Guidelines

Use this command to match next-hop IPv4 addresses that have entries in the specified prefix-list or route-access-list.

Example

To match next-hop IPv4 addresses with entries in a prefix-list named Prefix100, enter the following command:
match ip next-hop prefix-list Prefix100 

match ipv6 address

Matches IPv6 routes with entries in a specified route-access-list or prefix-list.

Product

All

Privilege

Security Administrator, Administrator

Mode

Exec > Global Configuration > Context Configuration > Route-map Configuration

configure > context context_name > route-map map_name { deny | permit } seq_number

Entering the above command sequence results in the following prompt:

[context_name]host_name(config-route-map)# 

Syntax

[ no ] match ipv6 address { prefix-list | route-access-list } list_name 

no

Disables matching from the specified prefix list or route access list.

prefix-list

Matches any routes with entries in a prefix-list.

route-access-list

Matches any routes with entries in a route-access-list.

list_name

Specifies the name of the IPv6 prefix list or IPv6 route access-list as an alphanumeric string of 1 through 79 characters.

Usage Guidelines

Matches IPv6 routes with entries in a specified route-access-list or prefix-list.

Example

To match routes that are specified in an IPv6 prefix list named Prefix600, enter the following command:
match ipv6 address prefix-list Prefix600 

match ipv6 next-hop

Matches next-hop IPv6 addresses with entries in specified standard prefix-list or route-access-list.

Product

All

Privilege

Security Administrator, Administrator

Mode

Exec > Global Configuration > Context Configuration > Route-map Configuration

configure > context context_name > route-map map_name { deny | permit } seq_number

Entering the above command sequence results in the following prompt:

[context_name]host_name(config-route-map)# 

Syntax

[ no ] match ipv6 next-hop { prefix-list | route-access-list } list_name 

no

Disables matching from the specified prefix list or route access list.

prefix-list

Matches any routes that have a next-hop router IPv6 address that has an entry in the specified prefix list.

route-access-list

Matches any routes that have a next-hop router IPv6 address that has an entry in the specified route-access-list.

list_name

Specifies the name of the prefix-list or route-access-list as an alphanumeric string of 1 through 79 characters.

Usage Guidelines

Use this command to match next-hop IPv6 addresses that have entries in the specified prefix-list or route-access-list.

Example

To match next-hop IPv6 addresses with entries in a prefix-list named Prefix600, enter the following command:
match ipv6 next-hop prefix-list Prefix600 

match metric

Matches routes that have the specified route metric.

Product

All

Privilege

Security Administrator, Administrator

Mode

Exec > Global Configuration > Context Configuration > Route-map Configuration

configure > context context_name > route-map map_name { deny | permit } seq_number

Entering the above command sequence results in the following prompt:

[context_name]host_name(config-route-map)# 

Syntax

[ no ] match metric metric_value 

no

Disables matching of the specified route metric.

metric_value

Specifies the route metric to match as an integer from 0 through 4294967295.

Usage Guidelines

Use this command to match routes that have the specified route metric.

Example

To match routes with the route metric of 1200, enter the following command:
match metric 1200 

match origin

Matches the origin code learned from BGP. This command is for route maps that are used with BGP routing only.

Product

HA

Privilege

Security Administrator, Administrator

Mode

Exec > Global Configuration > Context Configuration > Route-map Configuration

configure > context context_name > route-map map_name { deny | permit } seq_number

Entering the above command sequence results in the following prompt:

[context_name]host_name(config-route-map)# 

Syntax

[ no ] match origin { egp | igp | incomplete } 

no

Disables matching of the origin code.

egp

Matches origins learned via the External Gateway Protocol (EGP)

igp

Match origins learned via the local Interior Glittery Protocol (IGP)

incomplete

Match origins with unknown heritage.

Usage Guidelines

Use this command to match origin codes for BGP routing.

Example

To match origin codes learned from EGP, enter the following command:
match origin egp 

match route-type external

Match external Open Shortest Path First (OSPF) routes of the specified type.

Product

All

Privilege

Security Administrator, Administrator

Mode

Exec > Global Configuration > Context Configuration > Route-map Configuration

configure > context context_name > route-map map_name { deny | permit } seq_number

Entering the above command sequence results in the following prompt:

[context_name]host_name(config-route-map)# 

Syntax

[ no ] match route-type external { type-1 | type-2 } 

no

Disables matching with external OSPF routes of the specified type.

type-1

Only matches type-1 external routes.

type-2

Only matches type-2 external routes.

Usage Guidelines

Use this command to match external routes of a specific type.

Example

The following command matches all external routes that are type-2:
match route-type external type-2 

match tag

Matches routes with the specified route tag value.

Product

All

Privilege

Security Administrator, Administrator

Mode

Exec > Global Configuration > Context Configuration > Route-map Configuration

configure > context context_name > route-map map_name { deny | permit } seq_number

Entering the above command sequence results in the following prompt:

[context_name]host_name(config-route-map)# 

Syntax

[ no ] match tag tag_value 

no

Disables matching routes with the specified route tag value.

tag_value

Specifies the route tag value to match as an integer from 0 through 4294967295.

Usage Guidelines

Use this command to match routes that have the specified route tag value.

Example

Use the following command match routes that have a route tag value of 1234:
match tag 1234 

set as-path

Modifies an Autonomous System (AS) path for a route by adding the specified AS numbers to the front of the path.

Product

HA

Privilege

Security Administrator, Administrator

Mode

Exec > Global Configuration > Context Configuration > Route-map Configuration

configure > context context_name > route-map map_name { deny | permit } seq_number

Entering the above command sequence results in the following prompt:

[context_name]host_name(config-route-map)# 

Syntax

[ no ] set as-path prepend asn+ 

no

Disables prepending the AS path. Any previously set prepends are removed.

prepend

Prepends the AS path.

asn

AS number(s) to be prepended to the AS path. You can specify up to 16 different AS numbers to be prepended in the order specified. Each AS number must be separated by a space. asn must be an integer from 1 through 65535.

Usage Guidelines

Use this command to add up to 16 specified AS numbers to the front of the AS path.

Example

The following command prepends the AS numbers 100, 200, and 1000 to matching AS paths:
set as-path prepend 100 200 1000 

set community

Sets the BGP community destination for the routes matching the route-map.

Product

All

Privilege

Security Administrator, Administrator

Mode

Exec > Global Configuration > Context Configuration > Route-map Configuration

configure > context context_name > route-map map_name { deny | permit } seq_number

Entering the above command sequence results in the following prompt:

[context_name]host_name(config-route-map)# 

Syntax

set community [additive] { internet | local-AS | no-advertise | no-export | none | value AS-community_number AS-community_number AS-community_number+ } 
{ internet | local-AS | no-advertise | no-export | none | value AS-community_number AS-community_number AS-community_number ...  } 
{ internet | local-AS | no-advertise | no-export | none | value AS-community_number AS-community_number AS-community_number ... } 
no set community { internet | local-AS | no-advertise | no-export | value AS-community_number  } 

no

Unsets the specified community destination.

[additive]

When enabled this option allows multiple BGP destinations and route targets to be included in the same community.

{ internet | local-AS | no-advertise | no-export | value AS-community_number

Specifies the destination for the community.
  • internet – Advertise this route to the internet community, and any router that belongs to it.
  • local-AS – Use in confederation scenarios to prevent sending packets outside the local autonomous system (AS).
  • no-advertise – Do not advertise this route to any BGP peer, internal or external.
  • no-export – Do not advertise to external BGP (eBGP) peers. Keep this route within an AS.
  • none – No community attribute
  • value AS-community_number – Specifies a community string in AS:NN format, where AS = 2-byte AS-community hexadecimal number and NN = 2-byte hexadecimal number (1 to 11 characters).

You can enter multiple destinations and route targets separated by spaces.

Usage Guidelines

Sets the BGP community destinations for the routes matching the route-map.

The community list must have been previously configured via the Context Configuration mode ip community-list command.

Example

The following command sets the BGP community destination to AS 400:50:
set community value 400:50 

set extcommunity rt

Sets the BGP external community destination for the routes matching the route-map. The external community is the Route Target (RT).

Product

All

Privilege

Security Administrator, Administrator

Mode

Exec > Global Configuration > Context Configuration > Route-map Configuration

configure > context context_name > route-map map_name { deny | permit } seq_number

Entering the above command sequence results in the following prompt:

[context_name]host_name(config-route-map)# 

Syntax

set extcommunity rt rt_number rt_number rt_number+ 
no set extcommunity rtrt_number + 

no

Unsets the specified BGP external community (Route Target).

rt_number

Specifies a Route Target as a string in AS:NN format, where AS = 2-byte AS-community hexadecimal number and NN = 2-byte hexadecimal number (1 to 11 characters). You can enter multiple route targets separated by spaces.

Usage Guidelines

Sets the BGP external community destinations (route targets) for the routes matching the route-map.

The external community list must have been previously configured via the Context Configuration mode ip extcommunity-list command.

Example

The following command sets the BGP route target to AS 212:34:
set extcommunity rt 212:34 

set ip next-hop

Sets the IPv4 address that is applied as the next hop for routes.

Product

All

Privilege

Security Administrator, Administrator

Mode

Exec > Global Configuration > Context Configuration > Route-map Configuration

configure > context context_name > route-map map_name { deny | permit } seq_number

Entering the above command sequence results in the following prompt:

[context_name]host_name(config-route-map)# 

Syntax

[ no ] set ip next-hop ipv4_address 

no

Disables the specified next hop IPv4 address.

ipv4_address

Specifies the IPv4 address of the next hop to which packets are output, entered using IPv4 dotted-decimal notation.

Usage Guidelines

Use this command to set the IPv4 address that is used as the next hop for routes.

Example

To set the next hop for routes to the IPv4 address 209.165.200.234, use the following command:
set ip next-hop 209.165.200.234 

set ipv6 next-hop

Sets the IPv6 address that is applied as the next hop for routes.

Product

All

Privilege

Security Administrator, Administrator

Mode

Exec > Global Configuration > Context Configuration > Route-map Configuration

configure > context context_name > route-map map_name { deny | permit } seq_number

Entering the above command sequence results in the following prompt:

[context_name]host_name(config-route-map)# 

Syntax

[ no ] set ipv6 next-hop ipv6_address 

no

Disables the specified next hop address.

ipv6_address

Specifies the IPv6 address of the next hop to which packets are output, entered using IPv6 colon-separated-hexadecimal notation.

Usage Guidelines

Use this command to set the IPv6 address that is used as the next hop for routes.

Example

To set the next hop for routes to the IPv6 address 2001:4A2B::1f3F, use the following command:
set ipv6 next-hop 2001:4A2B::1f3F 

set local-preference

Sets the BGP local preference attribute that is sent by the BGP speaker only to IBGP peers.

Product

All

Privilege

Security Administrator, Administrator

Mode

Exec > Global Configuration > Context Configuration > Route-map Configuration

configure > context context_name > route-map map_name { deny | permit } seq_number

Entering the above command sequence results in the following prompt:

[context_name]host_name(config-route-map)# 

Syntax

[ no ] set local-preference pref_number 

no

Disables the specified local preference.

pref_number

Specifies the BGP local preference number as an integer from 1 through 16777214.

Usage Guidelines

Sets the BGP local preference attribute that is sent by the BGP speaker only to IBGP peers. This value can be used by peers to determine the exit point of the Autonomous System (AS).

There is no match clause corresponding to local preference in the route-map because local-preference is directly used in the route selection algorithm.

Example

The following command sets the BGP local preference attribute to 33:
set local-preference 33 

set metric

Sets the route metric for matching routes to a specified value.

Product

All

Privilege

Security Administrator, Administrator

Mode

Exec > Global Configuration > Context Configuration > Route-map Configuration

configure > context context_name > route-map map_name { deny | permit } seq_number

Entering the above command sequence results in the following prompt:

[context_name]host_name(config-route-map)# 

Syntax

[ no ] set metric metric_value 

no

Disables the specified metric type.

metric_value

Specifies the metric value that is set for routes as an integer from 1 through 16777214.

Usage Guidelines

Use this command to set the route metric for matched routes.


Note


BGP needs to be restarted to update the configured value.


Example

To set the route metric to 12345, use the following command:
set metric 12345 

set metric-type

This command sets the route metric type to either Type-1 or Type-2 in the AS-external-LSA.

Product

All

Privilege

Security Administrator, Administrator

Mode

Exec > Global Configuration > Context Configuration > Route-map Configuration

configure > context context_name > route-map map_name { deny | permit } seq_number

Entering the above command sequence results in the following prompt:

[context_name]host_name(config-route-map)# 

Syntax

[ no ] set metric-type { type-1 | type-2 } 

type-1

Sets the route metric to external type-1.

type-2

Sets the route metric to external type-2

Usage Guidelines

Use this command to set the route metric to either external type-1 or external type-2.

Example

To set the route metric to type-1, enter the following command:
set metric-type type-1 

set origin

Sets the Border Gateway Protocol (BGP) origin code to a specified value. This command is for route maps that are used with BGP routing only.

Product

HA

Privilege

Security Administrator, Administrator

Mode

Exec > Global Configuration > Context Configuration > Route-map Configuration

configure > context context_name > route-map map_name { deny | permit } seq_number

Entering the above command sequence results in the following prompt:

[context_name]host_name(config-route-map)# 

Syntax

[ no ] set origin { egp | igp | incomplete } 

no

Disables setting the origin code.

egp

Sets the origin code to specify that the path is from a remote External Gateway Protocol (EGP) system.

igp

Sets the origin code to specify that the path is from a local Interior Gateway Protocol (IGP) system.

incomplete

Sets the origin code to specify that the path is from an unknown system.

Usage Guidelines

Use this command to set a specified origin code for BGP.

Example

To set the origin code to be from an External Gateway Protocol (EGP) system, enter the following command:
set origin egp 

set tag

Sets the route tag value for matched routes.

Product

All

Privilege

Security Administrator, Administrator

Mode

Exec > Global Configuration > Context Configuration > Route-map Configuration

configure > context context_name > route-map map_name { deny | permit } seq_number

Entering the above command sequence results in the following prompt:

[context_name]host_name(config-route-map)# 

Syntax

[ no ] set tag tag_value 

no

Disables setting the route tag to the specified value.

tag_value

Specifies the route tag value as an integer from 0 through 4294967295.

Usage Guidelines

Use this command to set the route tag value that is applied to all matched routes.

Example

To set the route tag value to 12345, enter the following command:
set tag 12345 

set weight

Sets the weight in the routing table for matching routes to the specified value.

Product

PDSN

Privilege

Security Administrator, Administrator

Mode

Exec > Global Configuration > Context Configuration > Route-map Configuration

configure > context context_name > route-map map_name { deny | permit } seq_number

Entering the above command sequence results in the following prompt:

[context_name]host_name(config-route-map)# 

Syntax

[ no ] set weight value 

no

Disables setting the routing weight value.

value

Specifies the weight in the routing table as an integer from 1 through 4294967295.

Usage Guidelines

Use this command to set the routing table weight on matched routes.

Example

The following command sets the routing table weight for matched routes to 1000:
set weight 1000