cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3531
Views
0
Helpful
6
Replies

Routes Redistribution with Prefix Lists from OSPF to RIP

Nightwolf_82
Level 1
Level 1

Hello guys.

In the attachment there is a topology with RIP on the one side and OSPF on another side.

When I'm trying to redistribute routes from RIP to OSPF using prefix lists it works fine.

R2(config)#ip prefix-list RIP_OSPF permit 172.16.0.0/16 le 24
R2(config)#route-map RIP_OSPF permit 10
R2(config-route-map)#match ip address prefix-list RIP_OSPF
R2(config-route-map)#exit
R2(config)#router ospf 1
R2(config-router)#redistribute rip metric 100 subnets route-map RIP_OSPF


However, when I'm trying to use prefix list to redistribute routes from OSPF to RIP using prefix lists it doesn't work.

R2(config)#ip prefix-list OSPF_RIP permit 192.168.0.0/16 le 24
R2(config)#route-map OSPF_RIP permit 10
R2(config-route-map)#match ip address prefix-list OSPF_RIP
R2(config-route-map)#exit
R2(config)#router ospf 1
R2(config-router)#redistribute ospf 1 metric 2 route-map OSPF_RIP


Why prefix lists work for redistribution from RIP to OSPF but doesn't for redistribution from OSPF to RIP.

Just for any case below are full configs from all three routers.

R1#sh run
interface Loopback0
ip address 172.16.0.1 255.255.255.0
!
interface Loopback1
ip address 172.16.1.1 255.255.255.0
!
interface Loopback2
ip address 172.16.2.1 255.255.255.0
!
interface Loopback3
ip address 172.16.3.1 255.255.255.128
!
interface Loopback4
ip address 172.16.3.129 255.255.255.128
!
interface Loopback5
ip address 172.16.4.1 255.255.255.128
!
interface Loopback6
ip address 172.16.4.129 255.255.255.128
!
interface Serial1/0
ip address 10.1.12.1 255.255.255.252[/CODE]

R2#sh run
!
interface Serial1/0
ip address 10.1.12.2 255.255.255.252
!
interface Serial1/1
ip address 10.1.23.1 255.255.255.252
!
router ospf 1
router-id 2.2.2.2
log-adjacency-changes
redistribute rip metric 100 metric-type 1 subnets route-map RIP_OSPF
network 10.1.23.0 0.0.0.3 area 0
!
router rip
version 2
redistribute ospf 1 metric 2 route-map OSPF_RIP
network 10.0.0.0
no auto-summary
!
ip prefix-list OSPF_RIP seq 5 permit 192.168.0.0/16 le 24
!
ip prefix-list RIP_OSPF seq 5 permit 172.16.0.0/16 le 24
!
route-map OPSF_RIP permit 10
match ip address prefix-list OSPF_RIP
!
route-map RIP_OSPF permit 10
match ip address prefix-list RIP_OSPF

R3#sh run
!
interface Loopback0
ip address 192.168.0.1 255.255.255.0
ip ospf network point-to-point
!
interface Loopback1
ip address 192.168.1.1 255.255.255.0
ip ospf network point-to-point
!
interface Loopback2
ip address 192.168.2.1 255.255.255.0
ip ospf network point-to-point
!
interface Loopback3
ip address 192.168.3.1 255.255.255.128
ip ospf network point-to-point
!
interface Loopback4
ip address 192.168.3.129 255.255.255.128
ip ospf network point-to-point
!
interface Loopback5
ip address 192.168.4.1 255.255.255.128
ip ospf network point-to-point
!
interface Loopback6
ip address 192.168.4.129 255.255.255.128
ip ospf network point-to-point
!
interface Serial1/1
ip address 10.1.23.2 255.255.255.252
!
router ospf 1
router-id 3.3.3.3
network 0.0.0.0 255.255.255.255 area 0

6 Replies 6

Richard Burts
Hall of Fame
Hall of Fame

Am I correct that you are expecting R2 to have RIP routes for 172.16.0.0, 172.16.1.0, and 172.16.2.0 and to redistribute them? I believe that what is happening is that R1 running RIP is doing automatic summarization and is advertising 172.16.0.0/16. 

 

HTH

 

Rick

HTH

Rick

The thing is that I tried to redistribute OSPF routes into RIP under OSPF configuration.

R2(config)#router ospf 1
R2(config-router)#redistribute ospf 1 metric 2 route-map OSPF_RIP

 

Hello guys.

Another one question about routes redistribution but with the other topology. Below the configs from all 6 routers:

R1#sh run
!
router ospf 1
 router-id 1.1.1.1
 log-adjacency-changes
 redistribute rip metric 10 metric-type 1 subnets route-map RIP_TO_OSPF
 network 10.1.12.1 0.0.0.0 area 0
 network 10.1.13.1 0.0.0.0 area 0
!
router rip
 version 2
 redistribute ospf 1 metric 5 route-map OSPF_TO_RIP
 network 10.0.0.0
 network 172.16.0.0
 no auto-summary
!
ip prefix-list OSPF_TO_RIP seq 5 permit 192.168.0.0/16 ge 24
ip prefix-list OSPF_TO_RIP seq 10 permit 10.1.12.0/30
ip prefix-list OSPF_TO_RIP seq 15 permit 10.1.13.0/30
ip prefix-list OSPF_TO_RIP seq 20 permit 10.1.24.0/30
ip prefix-list OSPF_TO_RIP seq 25 permit 10.1.34.0/30
!
ip prefix-list RIP_TO_OSPF seq 5 permit 172.16.0.0/16 ge 24
ip prefix-list RIP_TO_OSPF seq 10 permit 10.1.15.0/30
ip prefix-list RIP_TO_OSPF seq 15 permit 10.1.26.0/30
ip prefix-list RIP_TO_OSPF seq 20 permit 10.1.56.0/30
!
route-map OSPF_TO_RIP permit 10
 match ip address prefix-list OSPF_TO_RIP
!
route-map RIP_TO_OSPF permit 10
 match ip address prefix-list RIP_TO_OSPF

R2#sh run
!
router ospf 1
 router-id 2.2.2.2
 log-adjacency-changes
 redistribute rip metric 10 metric-type 1 subnets route-map RIP_TO_OSPF
 network 10.1.12.2 0.0.0.0 area 0
 network 10.1.24.1 0.0.0.0 area 0
!
router rip
 version 2
 redistribute ospf 1 metric 5 route-map OSPF_TO_RIP
 network 10.0.0.0
 network 172.16.0.0
 no auto-summary
!
ip prefix-list OSPF_TO_RIP seq 5 permit 192.168.0.0/16 ge 24
ip prefix-list OSPF_TO_RIP seq 10 permit 10.1.12.0/30
ip prefix-list OSPF_TO_RIP seq 15 permit 10.1.13.0/30
ip prefix-list OSPF_TO_RIP seq 20 permit 10.1.24.0/30
ip prefix-list OSPF_TO_RIP seq 25 permit 10.1.34.0/30
!
ip prefix-list RIP_TO_OSPF seq 5 permit 172.16.0.0/16 ge 24
ip prefix-list RIP_TO_OSPF seq 10 permit 10.1.15.0/30
ip prefix-list RIP_TO_OSPF seq 15 permit 10.1.26.0/30
ip prefix-list RIP_TO_OSPF seq 20 permit 10.1.56.0/30
!
route-map OSPF_TO_RIP permit 10
 match ip address prefix-list OSPF_TO_RIP
!
route-map RIP_TO_OSPF permit 10
 match ip address prefix-list RIP_TO_OSPF

R5#sh run
!
router rip
 version 2
 network 10.0.0.0
 network 172.16.0.0
 no auto-summary

R6#sh run
!
router rip
 version 2
 network 10.0.0.0
 network 172.16.0.0
 no auto-summary

R3#sh run
!
router ospf 1
 router-id 3.3.3.3
 log-adjacency-changes
 network 10.1.13.2 0.0.0.0 area 0
 network 10.1.34.1 0.0.0.0 area 0
 network 192.168.3.0 0.0.0.255 area 0

R4#sh run
!
router ospf 1
 router-id 4.4.4.4
 log-adjacency-changes
 network 10.1.24.2 0.0.0.0 area 0
 network 10.1.34.2 0.0.0.0 area 0

1. Why R2 learns about subnets 10.1.56.0/30, 172.16.5.0/24 and 172.16.6.0/24 via RIP, but R1 learns about the same subnets via OSPF?

R1#sh ip route ospf
     172.16.0.0/24 is subnetted, 4 subnets
O E1    172.16.5.0 [110/11] via 10.1.12.2, 00:15:54, FastEthernet0/1
O E1    172.16.6.0 [110/11] via 10.1.12.2, 00:15:54, FastEthernet0/1
O E1    10.1.56.0 [110/11] via 10.1.12.2, 00:15:54, FastEthernet0/1

2#sh ip route rip

     172.16.0.0/24 is subnetted, 4 subnets
R       172.16.5.0 [120/2] via 10.1.26.2, 00:00:03, FastEthernet0/0
R       172.16.6.0 [120/1] via 10.1.26.2, 00:00:03, FastEthernet0/0
     10.0.0.0/30 is subnetted, 7 subnets
R       10.1.56.0 [120/1] via 10.1.26.2, 00:00:03, FastEthernet0/0

2. Why the traceroute on R3 looks like this? 

R3#traceroute 172.16.5.1

  1 10.1.34.2 32 msec
    10.1.13.1 12 msec
    10.1.34.2 8 msec
  2 10.1.12.2 8 msec
    10.1.24.1 20 msec
    10.1.12.2 16 msec
  3 10.1.26.2 48 msec 40 msec 40 msec
  4 10.1.56.1 40 msec 40 msec 40 msec

R3#traceroute 172.16.6.1

  1 10.1.13.1 32 msec
    10.1.34.2 12 msec
    10.1.13.1 8 msec
  2 10.1.24.1 8 msec
    10.1.12.2 20 msec
    10.1.24.1 16 msec
  3 10.1.26.2 48 msec 40 msec 40 msec

So, you have one of your routers learning the R5 and R6 routes through OSPF, and the other learning them through RIP.  I think what you have is a race condition.  It is the luck of the draw which one gets the OSPF routes and which on the RIP.

You see, as far as R1 and R2 are concerned, they will prefer an OSPF router over a RIP route because it has a lower administrative distance.  The first of those routers, R1 or R2, to see the RIP advertisement from R5 and R6, will redistribute it into OSPF, where it will be seen by the other one.  In your case, R2 saw the RIP first, and redistributed it to R1, which added it as an E1 to its routing table.

Try a debug ip routing.  You might find your routes are flapping.

Does that make sense?

Kevin Dorrell

Luxembourg

Yes, that's correct. OSPF AS is 110 whereas RIP AD is 120. That is why R1 prefers OSPF information rather then RIP information. But why it is R2 which learns the R5 and R6 routes via RIP whereas R1 learns the R5 and R6 routes via OSPF and not vice versa. Does it mean that redistribution was configured first on R2 and then on R1?

BTW, Kevin Could you explain what does "routes are flapping" mean please. 

Yes, it is just a question of whichever router gets to re-distribute the RIP route into OSPF first will keep the RIP route.  The other one will learn the re-distibuted OSPF route from the first one.

Depending on how you have set up the ruting, you could get route flapping.  By route flapping, I mean that the routing tables are unstable, flip-flopping between two different states.  You would see this if you do a debug ip routing - you would see routes being continuously put into the routing table and taken out again. I don't think it will be the case here, but it would be as well to check.  For example, it R1 re-distibutes the re-dirstributed route back into RIP with a low enough metwric, you could have a routing loop.