set metric
Sets the route's metric value.
Syntax: set metric metric-value
no set metric
metric-value
For BGP: the metric is the Multi-Exit-Discriminator (MED). Valid values are integers 0 to 4294967295.
Description: Use the set metric command to define the metric used when advertising routes via BGP. Metric values set with this command override the default metric value for this route.
Use the no set metric command to select the default metric for this route.
Route maps consist of sets of match and set commands. Match commands define the match criteria for route maps. Routes that match the match criteria are processed according to the actions defined by the set commands. Routes that do not match at least one of the match criteria in the route map are ignored.
Use the route-map command to create a route map. Use the various match and set commands to define the conditions for redistributing routes between protocols or instances of the same protocol.
Metrics are values that the router uses to indicate preferred paths to networks. Updates with non-zero metrics are used for route selection inside the autonomous system. BGP automatically compares metrics for routes to internal neighbors. You can use metric to select the best path when there are multiple alternatives.
Routes with lower metric values are more preferred.
Factory Default: Default metric value.
Command Mode: Route map configuration.
Example: In the following example, all routes advertised to external neighbor 10.5.1.121 have the metric set to 100.
- The ip as-path access-list commands create an as-based access list named ISP2_Permit411 that permits only routes that include 411 in their as-path.
- The route-map command creates a route map named set-metric.
- The set metric command sets the metric to 100.
- The router bgp command enables BGP and assigns the router to autonomous system 45.
- The neighbor remote-as command identifies an external neighbor 10.5.1.121.
- The neighbor route-map command applies the route map to outbound route updates to neighbor 10.5.1.121.
- Only route updates that include 411 in their as-path are forwarded to neighbor 10.5.1.121. Route updates that are forwarded have their metric set to 100.
router(config)#ip as-path access-list ISP2_Permit411 permit _411_
router(config)#ip as-path access-list ISP2_Permit411 deny any
router(config)#route-map set-metric permit 10
router(config-route-map)#match ip address ISP2_Permit411
router(config-route-map)#set metric 100
router(config-route-map)#end
router(config)#
router(config)#router bgp 411
router(config-router)#neighbor 10.5.1.121 remote-as 412
router(config-router)#neighbor 10.5.1.121 route-map set-metric out
Related Commands: route-map
match as-path
match community
match ip address
match ip next-hop
match ip route-source
match metric
show route-map
match route-type
match tag
set as-path
set community
set community
set ip next-hop
set level
set local-preference
set metric-type
set origin
set tag
set weight
Copyright © 2004
Avici Systems Inc.
Avici® and TSR®
is a registered trademark of Avici Systems Inc.
IPriori, Composite Links, SSR, QSR, and NSR® are
trademarks of Avici Systems Inc.
Source
File Name: Routing_Pol.fm
HTML File Name: Routing_Pol37.html
Last Updated: 05/10/04 at 16:38:37