cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
573
Views
0
Helpful
4
Replies

The routes redistributed don't save and affect the local RIB

Qunli Zhang
Level 1
Level 1

Hi,

Maybe it's an easy question but I seems get into the trap, when a router R1 redistributes routes from its RIP process to OSPF process, as OSPF has low AD than RIP, after the OSPF process got such routes, then why not the router R1 simply save such routes as OSPF routes?

loopback 0___on___R2 -------(RIP)-- R1 --OSPF---------R3
192.168.23.2/24
 

R1#sh run | s router ospf
router ospf 1
 router-id 0.0.0.1
 redistribute rip subnets


R1# sh ip route

Gateway of last resort is not set
...
R 192.168.23.0/24 [120/1] via 10.1.12.2, 00:00:08, Ethernet0/0.12

 

On the R1(the redistribution router), I can see the Type-5 LSA for 192.168.23.0
Type-5 AS External Link States

Link ID ADV Router Age Seq# Checksum Tag
10.1.1.1 0.0.0.1 892 0x80000002 0x003C55 0
10.1.1.2 0.0.0.1 892 0x80000002 0x00325E 0
10.1.12.0 0.0.0.1 892 0x80000002 0x00CCBA 0
10.1.14.0 0.0.0.1 892 0x80000002 0x00B6CE 0
192.168.23.0 0.0.0.1 892 0x80000002 0x0030ED 0
...

Same LSAs on R3(R3 is in same area with R1), R3 displays the route as OSPF E2

R3# sh ip route ospf
10.0.0.0/8 is variably subnetted, 7 subnets, 2 masks
...
O E2 192.168.23.0/24 [110/20] via 10.1.13.1, 01:21:28, Ethernet0/0


So why R1 doesn't display 192.168.23.0/24 route as OSPF route? Any machenism behind guides the router R1 to still set the route 192.168.23.0/24 as RIP route?

Thanks in advance.

PZ.

2 Accepted Solutions

Accepted Solutions

Let me take an approach that is slightly different from Dragan (though basically we are trying to explain the same thing). On R1 you learned the route via RIP and for R1 it is a RIP route. On R1 you redistribute the route into OSPF. Now OSPF has learned about the route but it is not yet an OSPF route and is still just a RIP route as far as R1 is concerned. Now R1 advertises to R3 via OSPF. R3 learns the route as an OSPF route.

 

The essential concept here is that when you redistribute routes into a protocol then the receiving protocol learns about a route but it does not become a route of that protocol until you advertise it to some other router. Perhaps another way to think about it is that the routing table reflects how the router learned the route. In your example R1 learned the route from RIP. Even though OSPF has learned the route on R1 that does not change the face that R1 does not learn the route from OSPF but from RIP.

 

HTH

 

Rick

HTH

Rick

View solution in original post

Rolf Fischer
Level 9
Level 9
"So why R1 doesn't display 192.168.23.0/24 route as OSPF route? Any machenism behind guides the router R1 to still set the route 192.168.23.0/24 as RIP route?"

 

The mechanism is described in RFC 2328 16.4. Calculating AS external routes:

"(2) If the LSA was originated by the calculating router itself, [do nothing with the LSA and] examine the next LSA."

In other words: An ASBR will never install an self-originated external OSPF route into its local routing table (this is also true for default-routes).

 

I think you have already received useful answers, perhaps it may help you to imagine what would happen if R1 would install an OSPF route for the network learned from RIP.

Because the OSPF route has the lower AD, the RIP route would be deleted from the routing-table (replaced by the "more reliable" OSPF route).

This would also delete the corresponding Type-5 LSA from the LSDB becausce redistribution does only take place as long as there is a RIP route in the routing table. So the OSPF route would disapear as well from the routing-table and the RIP route would be installed again and this whole sequence would start again.

If you have more than one redistribution point, you can sometimes run into such problems (at least temporarily) and additional configuration will be needed to achieve a stable redundant redistribution.

Example (debug ip routing):

RT: add 1.1.1.1/32 via 172.16.12.1, rip metric [120/1]
RT: closer admin distance for 1.1.1.1, flushing 1 routes
RT: add 1.1.1.1/32 via 192.168.0.3, ospf metric [110/21]
RT: del 1.1.1.1/32 via 192.168.0.3, ospf metric [110/21]
RT: add 1.1.1.1/32 via 172.16.12.1, rip metric [120/1]

 

Aside from that, keep in mind that the forwarding process of a router makes use of routing table entries in order to forward data through the approriate exit-interface. Would an external OSPF route provide a better next-hop information than the original (local) route does? I don't think so.

 

HTH

Rolf

View solution in original post

4 Replies 4

Dragan Ilic
Level 4
Level 4

You learn that route throw RIP - not OSPF on R1! R3 learn 192 route throw OSPF and that's why it's in routing table as E2 redistributed route. You can't put something in routing table before learning it...AD doesn't have any impact here on R1 for this route...

That's basics on redistribution - please read more on net about redistribution principles...

BR,

Dragan

HTH,
Dragan

Let me take an approach that is slightly different from Dragan (though basically we are trying to explain the same thing). On R1 you learned the route via RIP and for R1 it is a RIP route. On R1 you redistribute the route into OSPF. Now OSPF has learned about the route but it is not yet an OSPF route and is still just a RIP route as far as R1 is concerned. Now R1 advertises to R3 via OSPF. R3 learns the route as an OSPF route.

 

The essential concept here is that when you redistribute routes into a protocol then the receiving protocol learns about a route but it does not become a route of that protocol until you advertise it to some other router. Perhaps another way to think about it is that the routing table reflects how the router learned the route. In your example R1 learned the route from RIP. Even though OSPF has learned the route on R1 that does not change the face that R1 does not learn the route from OSPF but from RIP.

 

HTH

 

Rick

HTH

Rick

Rolf Fischer
Level 9
Level 9
"So why R1 doesn't display 192.168.23.0/24 route as OSPF route? Any machenism behind guides the router R1 to still set the route 192.168.23.0/24 as RIP route?"

 

The mechanism is described in RFC 2328 16.4. Calculating AS external routes:

"(2) If the LSA was originated by the calculating router itself, [do nothing with the LSA and] examine the next LSA."

In other words: An ASBR will never install an self-originated external OSPF route into its local routing table (this is also true for default-routes).

 

I think you have already received useful answers, perhaps it may help you to imagine what would happen if R1 would install an OSPF route for the network learned from RIP.

Because the OSPF route has the lower AD, the RIP route would be deleted from the routing-table (replaced by the "more reliable" OSPF route).

This would also delete the corresponding Type-5 LSA from the LSDB becausce redistribution does only take place as long as there is a RIP route in the routing table. So the OSPF route would disapear as well from the routing-table and the RIP route would be installed again and this whole sequence would start again.

If you have more than one redistribution point, you can sometimes run into such problems (at least temporarily) and additional configuration will be needed to achieve a stable redundant redistribution.

Example (debug ip routing):

RT: add 1.1.1.1/32 via 172.16.12.1, rip metric [120/1]
RT: closer admin distance for 1.1.1.1, flushing 1 routes
RT: add 1.1.1.1/32 via 192.168.0.3, ospf metric [110/21]
RT: del 1.1.1.1/32 via 192.168.0.3, ospf metric [110/21]
RT: add 1.1.1.1/32 via 172.16.12.1, rip metric [120/1]

 

Aside from that, keep in mind that the forwarding process of a router makes use of routing table entries in order to forward data through the approriate exit-interface. Would an external OSPF route provide a better next-hop information than the original (local) route does? I don't think so.

 

HTH

Rolf

Qunli Zhang
Level 1
Level 1

Thanks Rick/Rolf, you both gave the very detailed and understandable answer, these really helped me a lot.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card