match metric

To redistribute routes in the routing table that match the routing metric value, use the match metric command. To remove the tag entry, use the no form of this command.

match metric metric-value [+- deviation-number] [...metric-value [+- deviation-number]]

no match metric metric-value [+- deviation-number] [...metric-value [+- deviation-number]]

Syntax Description

metric-value

Internal route metric. The range is from 1 to 4,294,967,295.

+ -

Specifies a standard deviation range of the metric. The router matches any metric that falls inclusively in that range.

deviation-number

(Optional) Standard deviation number that offsets the number configured for the metric-value argument. The deviation-number argument can be any number. There is no default.


Command Default

No match values are defined.

Command Modes

Route-map configuration mode

Command History

Release
Modification

5.0(3)N1(1)

This command was introduced.


Usage Guidelines

To redistribute routes with the specified metric, use the match metric command in route-map configuration mode. To remove the entry for the redistributed route from the routing table, use the no form of this command.

You can specify one or more metrics (or) range of metrics using the deviation-number argument. At least one of the specified metrics must match for the command to pass.

An ellipsis (...) in the command syntax indicates that your command input can include multiple values for the arguments.

Use the route-map global configuration command, and the match and set route-map configuration commands to define the conditions for redistributing routes from one routing protocol into another. Each route-map command has a list of match and set commands associated with it. The match commands specify the match criteria—the conditions under which redistribution is allowed for the current route-map command. The set commands specify the set actions—the particular redistribution actions to perform if the criteria enforced by the match commands are met. The no route-map command deletes the route map.

The match route-map configuration command has multiple formats. The match commands can be given in any order and all match commands must pass to cause the route to be redistributed according to the set actions given with the set commands. The no forms of the match commands remove the specified match criteria.

A route map can have several parts. Any route that does not match at least one match clause that relates 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 second route map section with an explicit match specified.

Examples

This example shows how to redistribute routes stored in the routing table with a metric of 5:

switch(config)# route-map blueberry
switch(config-route-map)# match metric 5

Related Commands

Command
Description

match as-path

Matches a BGP autonomous system path access list.

match community

Matches a BGP community.

match ip next-hop

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

match ip route-source

Redistributes routes that have been advertised by routers and access servers at the address specified by the access lists.

match metric

Redistributes routes with the metric specified.

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 community

Sets the BGP communities attribute.

set level

Indicates where to import routes.

set local-preference

Specifies a preference value for the autonomous system path.

set metric

Sets the metric value for a routing protocol.

set metric-type

Sets the metric type for the destination routing protocol.

set next-hop

Specifies the address of the next hop.

set tag

Sets a tag value of the destination routing protocol.

set weight

Specifies the BGP weight for the routing table.