The only connected routes affected by this redistribute command are the routes not specified by the network command. You cannot use the default-metric command to affect the metric used to advertise connected routes.
Default redistribution of IGPs or EGP into BGP is not allowed unless default- information originate is specified.
When routes are redistributed into OSPF and no metric is specified in the metric keyword, the default metric that OSPF uses is 20 for routes from all protocols except BGP route, which gets a metric of 1.
Examples: The following are examples of the various configurations you would use to redistribute one routing protocol into another routing protocol. The following example configuration causes OSPF routes to be redistributed into a BGP:
domain: router bgp 109 redistribute ospf...
The following example configuration causes IGRP routes to be redistributed into an OSPF:
domain: router ospf 110 redistribute igrp...
The following example causes the specified IGRP process routes to be redistributed into an OSPF domain. The IGRP-derived metric will be remapped to 100 and RIP routes to 200:
router ospf 109 redistribute igrp 108 metric 100 subnets redistribute rip metric 200 subnets
In the following example, BGP routes are configured to be redistributed into IS-IS. The link-state cost is specified as 5, and the metric type will be set to external, indicating that it has lower priority than internal metrics:
router isis redistribute bgp 120 metric 5 metric-type external
Related Commands: default-information originate (BGP), default-information originate (EGP), default-information originate (IS-IS), default-information originate (OSPF), distribute-list out, route-map, show route-map
To define the conditions for redistributing routes from one routing protocol into another, or to enable policy routing, use the route-map global configuration command and the match and set route-map configuration commands. To delete an entry, use the no route-map command. The syntax for this command (and the no form) is as follows:
route-map map-tag [permit | deny] [sequence-number] no route-map map-tag [permit | deny] [sequence-number]
Default: No default is available.
Command Mode: Global configuration.
Usage Guidelines: Use route maps to redistribute routes or to subject packets to policy routing as described in the paragraphs that follow on each, respectively.
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 criteriathe conditions under which redistribution is allowed for the current route map. The set commands specify the set actionsthe 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 related match commands are listed in the section Related Commands for Redistribution. 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.
Use route maps when you want detailed control over how routes are redistributed between routing processes. The destination routing protocol is the one you specify with the router global configuration command. The source routing protocol is the one you specify with the redistribute router configuration command. See the following example as an illustration of how route maps are configured.
When you are passing routes through a route map, a route map can have several parts. Any route that does not match at least one match clause relating to a route-map command will be ignored; that is, the route will not be advertised for outbound route maps and will not be accepted for inbound route maps. If you want to modify only some data, you must configure a second route-map section with an explicit match specified.