14-6: redistribute routing-process process-id route-map route-map-name
routing-processRouting process to redistribute into OSPF. The routing process can be BGP, Connected, EGP, EIGRP, IGRP, ISIS, ISO-IGRP, Mobile, ODR, OSPF, RIP, or Static.
process-idThe process ID of the routing process (if applicable).
route-map-nameName of the route map used to control which routes are redistributed or to set the parameters of the redistributed routes (metric, metric-type, or tag).
Purpose: To control the redistribution of routes learned from another routing process into OSPF. Redistributed routes become OSPF external type 2 routes by default. The default cost or metric of a redistributed route is 1 for BGP and 20 for all other protocols. This command will redistribute classful routes into OSPF only if the subnets keyword is not used. There are three general types of classful routes:
A Class A address with an 8-bit mask
A Class B address with a 16-bit mask
A Class C address with a 24-bit mask
You can use the subnets keyword to redistribute all routes. You can also use the metric, metric-type, and tag keywords. These values can also be set in the route map as shown in the examples covered in this section.
Initial Cisco IOS Software Release: 10.0
Configuration Example 6: Controlling the Routes to Be Redistributed Based on IP Address
In Figure 14-3, Router B is receiving six routes from Router C via EIGRP. Three of the EIGRP routes are classful (126.96.36.199/8, 188.8.131.52/16, 184.108.40.206/24) and three are classless (220.127.116.11/12, 18.104.22.168/20, 22.214.171.124/28). For this example, only the classless routes will be redistributed. Before redistributing the EIGRP routes into OSPF on Router B, configure the routers as shown in the listing that follows.
Figure 14-3 A Route Map Is Needed to Control Which Routes Are Redistributed into OSPF from EIGRP
Router A¬ interface Loopback0 ip address 126.96.36.199 255.255.255.255 ! interface Serial0/1 ip address 10.1.1.1 255.255.255.252 clockrate 64000 ! router ospf 1 network 10.1.1.0 0.0.0.3 area 0
Router B interface Loopback0 ip address 188.8.131.52 255.255.255.255 ! interface Serial0 ip address 10.1.1.2 255.255.255.252 ! interface Serial 1 ip address 10.1.1.5 255.255.255.252 ! router eigrp 1 network 10.0.0.0 ! router ospf 1 network 10.1.1.0 0.0.0.3 area 0
Router C interface Loopback0 ip address 184.108.40.206 255.255.255.255 ! interface Loopback1 ip address 220.127.116.11 255.0.0.0 ! interface Loopback2 ip address 18.104.22.168 255.240.0.0 ! interface Loopback3 ip address 22.214.171.124 255.255.0.0 ! interface Loopback4 ip address 126.96.36.199 255.255.240.0 ! interface Loopback5 ip address 188.8.131.52 255.255.255.0 ! interface Loopback6 ip address 184.108.40.206 255.255.255.240 ! interface Serial0 ip address 10.1.1.6 255.255.255.252 ! router eigrp 1 network 220.127.116.11 network 18.104.22.168 network 10.0.0.0 network 22.214.171.124 network 126.96.36.199 network 188.8.131.52 network 184.108.40.206 no auto-summary
Verify that Routers A and B have established an OSPF neighbor relationship.
rtrA#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 220.127.116.11 1 FULL/ - 00:00:36 10.1.1.2 Serial0/1
Verify that Routers B and C have formed an EIGRP neighbor relationship.
rtrB#show ip eigrp neighbors IP-EIGRP neighbors for process 1 H Address Interface Hold Uptime SRTT RTO Q Seq (sec) (ms) Cnt Num 0 10.1.1.6 Se1 11 00:25:42 308 2280 0 4
Verify that Router B is receiving the six EIGRP routes from Router C.rtrB#show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default U - per-user static route, o - ODR Gateway of last resort is not set 18.104.22.168/32 is subnetted, 1 subnets C 22.214.171.124 is directly connected, Loopback0 D 126.96.36.199/24 [90/40640000] via 10.1.1.6, 00:26:25, Serial1 188.8.131.52/28 is subnetted, 1 subnets D 184.108.40.206 [90/40640000] via 10.1.1.6, 00:26:25, Serial1 D 220.127.116.11/8 [90/40640000] via 10.1.1.6, 00:26:25, Serial1 18.104.22.168/12 is subnetted, 1 subnets D 22.214.171.124 [90/40640000] via 10.1.1.6, 00:26:25, Serial1 D 126.96.36.199/16 [90/40640000] via 10.1.1.6, 00:26:25, Serial1 10.0.0.0/30 is subnetted, 2 subnets C 10.1.1.0 is directly connected, Serial0 C 10.1.1.4 is directly connected, Serial1 188.8.131.52/20 is subnetted, 1 subnets D 184.108.40.206 [90/40640000] via 10.1.1.6, 00:26:27, Serial1
Modify the configuration on Router B to redistribute only the classless EIGRP routes into OSPF.Router B router ospf 1 redistribute eigrp 1 subnets route-map control-eigrp ! access-list 1 permit 220.127.116.11 0.15.255.255 access-list 1 permit 18.104.22.168 0.0.15.255 access-list 1 permit 22.214.171.124 0.0.0.15 access-list 1 permit 10.1.1.4 0.0.0.3 route-map control-eigrp permit 10 match ip address 1
Verify that only the classless EIGRP routes have been redistributed into OSPF.rtrA#show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area * - candidate default, U - per-user static route, o - ODR P - periodic downloaded static route Gateway of last resort is not set 126.96.36.199/32 is subnetted, 1 subnets C 188.8.131.52 is directly connected, Loopback0 184.108.40.206/28 is subnetted, 1 subnets O E2 220.127.116.11 [110/20] via 10.1.1.2, 00:02:05, Serial0/1 18.104.22.168/12 is subnetted, 1 subnets O E2 22.214.171.124 [110/20] via 10.1.1.2, 00:02:05, Serial0/1 10.0.0.0/30 is subnetted, 1 subnets C 10.1.1.0 is directly connected, Serial0/1 126.96.36.199/20 is subnetted, 1 subnets O E2 188.8.131.52 [110/20] via 10.1.1.2, 00:02:06, Serial0/1 O E2 10.1.1.4 [110/200] via 10.1.1.2, 00:02:06, Serial0/1