Weird behavior: Redistribution with Route-map from OSPF to RIP

August 13, 2008 at 11:17 am | Posted in Blogroll, OSPF, Routing | Leave a comment

It is observed that if we do OSPF to RIP redistribution (or EIGRP as well, even though I have not tested with EIGRP yet) without route-map, then we introduce a route-map, e.g. to filter routes, the route-map will only take place for OSPF routes that have been bounced, removed or newly learnt. We can bounce routes by resetting OSPF process (this change only impact routes learnt from neighbors, but not the connected routes) and/or bouncing the interface

Here’s the detailed observation
Topology:

R1 ——- R3 ——- R2

OSPF Area0  |   RIP

R1#sh ver | in IOS
Cisco IOS Software, 3700 Software (C3725-ADVENTERPRISEK9-M), Version 12.4(17a), RELEASE SOFTWARE (fc2)

R1#

interface Loopback71
ip address 77.1.1.1 255.255.255.0
!
interface Loopback72
ip address 77.1.2.1 255.255.255.0
!
interface Loopback73
ip address 77.1.3.1 255.255.255.0
!
interface Loopback77
ip address 77.77.77.1 255.255.255.0
ip ospf network point-to-point
!
interface Serial1/1
description Connection to R3
ip address 13.0.0.1 255.255.255.0
!
!
router ospf 1
log-adjacency-changes
area 1 range 77.0.0.0 255.0.0.0
network 13.0.0.1 0.0.0.0 area 0
network 77.1.0.0 0.0.255.255 area 1
network 77.77.77.1 0.0.0.0 area 77

R3#

!
interface Serial1/2
description Connection to R1
ip address 13.0.0.3 255.255.255.0
!
interface Serial1/3
description Connection to R2
ip address 23.0.0.3 255.255.255.0
serial restart-delay 0
!
router ospf 1
network 13.0.0.3 0.0.0.0 area 0
!
router rip
version 2
redistribute ospf 1 metric 1 route-map OSPF->RIP
passive-interface default
network 23.0.0.0
neighbor 23.0.0.2
no auto-summary
!
!
!
ip prefix-list SUMMARY seq 5 permit 77.0.0.0/8
ip prefix-list SUMMARY seq 10 deny 0.0.0.0/0 le 32
!
route-map OSPF->RIP permit 10
match ip address prefix-list SUMMARY
!
route-map OSPF->RIP deny 20

R2#

interface Serial1/1
description Connection to R3
ip address 23.0.0.2 255.255.255.0
!
router rip
version 2
passive-interface default
network 23.0.0.0
neighbor 23.0.0.3
no auto-summary

This configuration result in only summary route being received on R2, as expected.

R2#sh ip route rip
R    77.0.0.0/8 [120/1] via 23.0.0.3, 00:00:18, Serial1/1

R3 has a summary route 77.0.0.0 and a specific 77.77.77.0 (both are learnt from R1)

R3#sh clock
08:59:34.219 UTC Wed Aug 13 2008
R3#sh ip route ospf
77.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
O IA    77.77.77.0/24 [110/65] via 13.0.0.1, 00:00:18, Serial1/2
O IA    77.0.0.0/8 [110/65] via 13.0.0.1, 00:16:07, Serial1/2

If we advertize OSPF to RIP without the route-map, we will see that the specific route is also shown up on R2 (almost immediately)

R3#sh clock
09:05:28.035 UTC Wed Aug 13 2008

R3(config)#router rip
R3(config-router)#no  redistribute ospf 1 metric 1 route-map OSPF->RIP
R3(config-router)#redistribute ospf 1 metric 1

R2#sh clock
09:05:43.919 UTC Wed Aug 13 2008
R2#sh ip route rip
77.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
R       77.77.77.0/24 [120/1] via 23.0.0.3, 00:00:01, Serial1/1
R       77.0.0.0/8 [120/1] via 23.0.0.3, 00:00:01, Serial1/1
13.0.0.0/24 is subnetted, 1 subnets
R       13.0.0.0 [120/1] via 23.0.0.3, 00:00:01, Serial1/1

If we reapply the route-map, the specific route stay on !!!

R3#sh clock
09:07:34.755 UTC Wed Aug 13 2008
R3#c
Enter configuration commands, one per line.  End with CNTL/Z.
R3(config)#router rip
R3(config-router)#redistribute ospf 1 metric 1 route-map OSPF->RIP
R3(config-router)#

R2#sh clock
09:09:29.383 UTC Wed Aug 13 2008
R2#sh ip route rip
77.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
R       77.77.77.0/24 [120/1] via 23.0.0.3, 00:00:22, Serial1/1
R       77.0.0.0/8 [120/1] via 23.0.0.3, 00:00:22, Serial1/1
13.0.0.0/24 is subnetted, 1 subnets
R       13.0.0.0 [120/1] via 23.0.0.3, 00:00:22, Serial1/1
R2#sh clock
09:09:57.151 UTC Wed Aug 13 2008
R2#sh ip route rip
77.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
R       77.77.77.0/24 [120/1] via 23.0.0.3, 00:00:21, Serial1/1
R       77.0.0.0/8 [120/1] via 23.0.0.3, 00:00:21, Serial1/1
13.0.0.0/24 is subnetted, 1 subnets
R       13.0.0.0 [120/1] via 23.0.0.3, 00:00:21, Serial1/1
R2#sh clock
09:11:36.359 UTC Wed Aug 13 2008
R2#sh ip route rip
77.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
R       77.77.77.0/24 [120/1] via 23.0.0.3, 00:00:11, Serial1/1
R       77.0.0.0/8 [120/1] via 23.0.0.3, 00:00:11, Serial1/1
13.0.0.0/24 is subnetted, 1 subnets
R       13.0.0.0 [120/1] via 23.0.0.3, 00:00:11, Serial1/1


The specific route stays on until I bounce the route.

R1(config-if)#int lo77
R1(config-if)#shut
Aug 13 09:12:46.815: %LINK-5-CHANGED: Interface Loopback77, changed state to administratively down
Aug 13 09:12:47.819: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback77, changed state to down
R1(config-if)#no shut
R1(config-if)#
Aug 13 09:12:51.963: %LINK-3-UPDOWN: Interface Loopback77, changed state to up
Aug 13 09:12:52.963: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback77, changed state to up

R2#sh ip route rip
77.0.0.0/8 is subnetted, 1 subnets
R       77.0.0.0 [120/1] via 23.0.0.3, 00:00:09, Serial1/1
13.0.0.0/24 is subnetted, 1 subnets
R       13.0.0.0 [120/1] via 23.0.0.3, 00:00:09, Serial1/1

Note that after I bounce the interface on R1, only the affected route (77.77.77.0/24 disapears from routing table on R2, as R3 does not sends it anymore). The 13.0.0.0/24 still stays on, (i.e. this unaffected route is not subject to the new route-map).

R3#sh ip route ospf
77.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
O IA    77.77.77.0/24 [110/65] via 13.0.0.1, 00:05:49, Serial1/2
O IA    77.0.0.0/8 [110/65] via 13.0.0.1, 00:33:45, Serial1/2

R3#debug  ip rip
RIP protocol debugging is on
Aug 13 09:21:39.387: RIP: sending v2 update to 23.0.0.2 via Serial1/3 (23.0.0.3)
Aug 13 09:21:39.391: RIP: build update entries
Aug 13 09:21:39.391:    13.0.0.0/24 via 0.0.0.0, metric 1, tag 0
Aug 13 09:21:39.395:    77.0.0.0/8 via 0.0.0.0, metric 1, tag 0
Aug 13 09:21:39.395: RIP: Update contains 2 routes
Aug 13 09:21:39.399: RIP: Update queued
Aug 13 09:21:39.399: RIP: Update sent via Serial1/3

R2#sh clock
09:16:28.351 UTC Wed Aug 13 2008
R2#sh ip route rip
77.0.0.0/8 is subnetted, 1 subnets
R       77.0.0.0 [120/1] via 23.0.0.3, 00:00:23, Serial1/1
13.0.0.0/24 is subnetted, 1 subnets
R       13.0.0.0 [120/1] via 23.0.0.3, 00:00:23, Serial1/1
R2#sh clock
09:16:45.031 UTC Wed Aug 13 2008
R2#sh ip route rip
77.0.0.0/8 is subnetted, 1 subnets
R       77.0.0.0 [120/1] via 23.0.0.3, 00:00:14, Serial1/1
13.0.0.0/24 is subnetted, 1 subnets
R       13.0.0.0 [120/1] via 23.0.0.3, 00:00:14, Serial1/1

If I remove the route-map and put it back in, we can see again that R3 continues to advertize all routes to RIP, NOT subject to the route-map

R3(config)#router rip
R3(config-router)#no redistribute ospf 1 metric 1 route-map OSPF->RIP
R3(config-router)#redistribute ospf 1 metric 1
R3(config-router)#redistribute ospf 1 metric 1 route-map OSPF->RIP

Aug 13 09:24:51.883: RIP: sending v2 update to 23.0.0.2 via Serial1/3 (23.0.0.3)
Aug 13 09:24:51.887: RIP: build update entries
Aug 13 09:24:51.887:    13.0.0.0/24 via 0.0.0.0, metric 1, tag 0
Aug 13 09:24:51.891:    77.0.0.0/8 via 0.0.0.0, metric 1, tag 0
Aug 13 09:24:51.891:    77.77.77.0/24 via 0.0.0.0, metric 1, tag 0
Aug 13 09:24:51.895: RIP: Update contains 3 routes
Aug 13 09:24:51.895: RIP: Update queued
Aug 13 09:24:51.899: RIP: Update sent via Serial1/3

If we clear OSPF process, we can see that only OSPF routes affected by the OSPF adjacency reset are subject to the route-map. The connected route (part of OSPF database), will still being advertized to RIP without being subject to the route-map.

R3#clear ip ospf process
Reset ALL OSPF processes? [no]: yes
R3#
Aug 13 09:31:25.135: RIP: sending v2 update to 23.0.0.2 via Serial1/3 (23.0.0.3)
Aug 13 09:31:25.139: RIP: build update entries
Aug 13 09:31:25.139:    13.0.0.0/24 via 0.0.0.0, metric 1, tag 0
Aug 13 09:31:25.143:    77.0.0.0/8 via 0.0.0.0, metric 1, tag 0

Now if we bounce the connected interface, we can see that it will be blocked by the route-map, and it will no longer be redistributed to RIP.

R3#c
Enter configuration commands, one per line.  End with CNTL/Z.
R3(config)#int serial1/2
R3(config-if)#shut
Aug 13 09:33:02.771: %OSPF-5-ADJCHG: Process 1, Nbr 13.0.0.1 on Serial1/2 from FULL to DOWN, Neighbor Down: Interface down or detached
Aug 13 09:33:04.735: %LINK-5-CHANGED: Interface Serial1/2, changed state to administratively down

R3(config-if)#no shut
R3#
Aug 13 09:34:11.847: RIP: sending v2 update to 23.0.0.2 via Serial1/3 (23.0.0.3)
Aug 13 09:34:11.851: RIP: build update entries
Aug 13 09:34:11.851:    77.0.0.0/8 via 0.0.0.0, metric 1, tag 0

R2#sh clock
09:34:50.047 UTC Wed Aug 13 2008
R2#sh ip route rip
R    77.0.0.0/8 [120/1] via 23.0.0.3, 00:00:13, Serial1/1

Advertisements

Leave a Comment »

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.
Entries and comments feeds.

%d bloggers like this: