Using Route Maps with Route Redistribution
Router(config)#route-map MY_MAP permit 10 |
Creates a route map called MY_MAP. This route-map statement will permit redistribution based on subsequent criteria. A sequence number of 10 is assigned. |
Router(config-route-map)#match ip address 5 |
Specifies the match criteria (the conditions that should be tested); in this case, match addresses filtered using a standard access list number 5. |
Router(config-route-map)#set metric 500 |
Specifies the set action (what action is to be performed if the match criteria is met); in this case, set the external metric to 500 (instead of the default value of 20). |
Router(config-route-map)#set metric-type type-1 |
Specifies a second set action for the same match criteria. In this case, set the external OSPF network type to E1. |
Router(config-route-map)#route-map MY_MAP deny 20 |
Adds a second statement to the MY_MAP route map that will deny redistribution based on subsequent criteria. |
Router(config-route-map)#match ip address prefix-list MY_PFL |
Specifies the match criteria (the conditions that should be tested); in this case, match addresses filtered using a prefix list named MY_PFL. |
Router(config-route-map)#route-map MY_MAP permit 30 |
Adds a third statement to the MY_MAP route map that will permit redistribution based on subsequent criteria. |
NOTE: No “match” criteria are explicitly specified; all other routes will be redistributed with the following “set” criteria applied. |
|
Router(config-route-map)#set metric 5000 |
Specifies the set action (what action is to be performed if the match criteria is met); in this case, set the external metric to 5000 (instead of the default value of 20) |
Router(config-route-map)#set metric-type type 2 |
Specifies a second set action for the same match criteria; in this case, set the external OSPF network type to E2. This is optional since the default type for redistributed routes into OSPF is external type 2. |
Router(config-route-map)#router ospf 10 |
Enters OSPF process ID 10 routing process. |
Router(config-router)#redistribute eigrp 1 route-map MY_MAP subnets |
Redistributes only EIGRP routes that are permitted by route map MY_MAP into OSPF. |
Configuration Example: Route Maps
Figure 4-8 shows the network topology for the configuration that follows, which demonstrates how to control redistribution with a route map using the commands covered in this chapter. Assume that all basic configurations and EIGRP and OSPF routing have been configured correctly.
Figure 4-8 Network Topology for Route Map Configuration
The objective is to only redistribute networks 172.16.1.0/24 and 172.16.2.0/24 into OSPF and advertise them as external type 1 (E1) routes with an external metric of 50.
HULL(config)#access-list 5 permit 172.16.1.0 0.0.0.255 |
Creates a standard ACL number 5 and explicitly permits the 172.16.1.0/24 network. |
HULL (config)#access-list 5 permit 172.16.2.0 0.0.0.255 |
Adds a second line to ACL 5 that explicitly permits the 172.16.2.0/24 network. |
HULL(config)#route-map FILTER permit 10 |
Creates a route map called FILTER. This route map will permit traffic based on subsequent criteria. A sequence number of 10 is assigned. |
HULL(config-route-map)#match ip address 5 |
Specifies the match criteria; match addresses filtered from ACL 5. |
HULL(config-route-map)#set metric 50 HULL(config-route-map)#set metric-type type-1 |
Specifies the set actions (what actions are to be performed if the match criterion is met); in this case, sets the external metric to 50 and sets the type to external type 1 (E1). |
HULL(config)#router ospf 1 |
Enters OSPF process ID 1 routing process. |
HULL(config)#redistribute eigrp 10 subnets route-map FILTER |
Redistributes only those EIGRP networks into OSPF which match the route map. |
NOTE: Networks 172.16.2.0/24 and 172.16.3.0/24 will not be redistributed because of the implicit deny any at the end of the route map. |