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 [I]RIP_OSPF[/I] permit 172.16.0.0/16 le 24
R2(config)#route-map [I]RIP_OSPF[/I] permit 10
R2(config-route-map)#match ip address prefix-list [I]RIP_OSPF[/I]
R2(config-route-map)#exit
R2(config)#router ospf 1
R2(config-router)#redistribute rip metric 100 subnets route-map [I]RIP_OSPF[/I]
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 [I]OSPF_RIP[/I] permit 192.168.0.0/16 le 24
R2(config)#route-map [I]OSPF_RIP[/I] permit 10
R2(config-route-map)#match ip address prefix-list [I]OSPF_RIP[/I]
R2(config-route-map)#exit
R2(config)#router ospf 1
R2(config-router)#redistribute ospf 1 metric 2 route-map [I]OSPF_RIP[/I]
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
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