Route redistribution between RIP and OSPF

Posted: February 6, 2016 in CISCO

Untitled

 

R1:

!
interface Loopback0
ip address 172.16.1.1 255.255.255.0
!
interface Loopback1
ip address 192.168.48.1 255.255.255.0
!
interface Loopback2
ip address 192.168.49.1 255.255.255.0
!
interface Loopback3
ip address 192.168.50.1 255.255.255.0
!
interface Loopback4
ip address 192.168.51.1 255.255.255.0
!
interface Loopback5
ip address 192.168.70.1 255.255.255.0
!
interface Serial1/0
ip address 172.16.12.1 255.255.255.0
serial restart-delay 0
!
router rip
version 2
network 172.16.0.0
network 192.168.48.0
network 192.168.49.0
network 192.168.50.0
network 192.168.51.0
network 192.168.70.0
no auto-summary

R2:

!
interface Loopback0
ip address 172.16.2.1 255.255.255.0
!
interface Serial1/0
ip address 172.16.12.2 255.255.255.0
serial restart-delay 0
!
interface Serial1/1
ip address 172.16.23.2 255.255.255.0
!
router ospf 1
network 172.16.23.0 0.0.0.255 area 0
!
router rip
version 2
network 172.16.0.0
no auto-summary

  R3:

 

!
interface Loopback0
ip address 172.16.3.1 255.255.255.0
ip ospf network point-to-point
!
interface Loopback1
ip address 192.168.20.1 255.255.255.0
ip ospf network point-to-point
!
interface Loopback2
ip address 192.168.25.1 255.255.255.0
ip ospf network point-to-point
!
interface Loopback3
ip address 192.168.30.1 255.255.255.0
ip ospf network point-to-point
!
interface Loopback4
ip address 192.168.35.1 255.255.255.0
ip ospf network point-to-point
!
interface Loopback5
ip address 192.168.40.1 255.255.255.0
ip ospf network point-to-point
!
interface Serial1/1
ip address 172.16.23.3 255.255.255.0
serial restart-delay 0
!
router ospf 1
network 172.16.0.0 0.0.255.255 area 0
network 192.168.0.0 0.0.255.255 area 0

 

Under RIP configuration,redistribute OSPF route

R2 is Autonomous System Border Router (ASBR) because connects RIP (R1) and OSPF (R2) router,so we need on that router to configure redistribution

R2(config)#router rip
R2(config-router)#redistribute ospf 1 metric 4

If metric is not specified,it defines infinite metric which causes no routes to be advertised

 

R1(config-router)#do sh ip route
Codes: C – connected, S – static, 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
i – IS-IS, su – IS-IS summary, 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

R 192.168.30.0/24 [120/4] via 172.16.12.2, 00:00:01, Serial1/0
R 192.168.25.0/24 [120/4] via 172.16.12.2, 00:00:01, Serial1/0
R 192.168.40.0/24 [120/4] via 172.16.12.2, 00:00:01, Serial1/0
172.16.0.0/24 is subnetted, 5 subnets
R 172.16.23.0 [120/1] via 172.16.12.2, 00:00:01, Serial1/0
C 172.16.12.0 is directly connected, Serial1/0
C 172.16.1.0 is directly connected, Loopback0
R 172.16.2.0 [120/1] via 172.16.12.2, 00:00:01, Serial1/0
R 172.16.3.0 [120/4] via 172.16.12.2, 00:00:03, Serial1/0
R 192.168.20.0/24 [120/4] via 172.16.12.2, 00:00:03, Serial1/0
C 192.168.51.0/24 is directly connected, Loopback4
C 192.168.50.0/24 is directly connected, Loopback3
R 192.168.35.0/24 [120/4] via 172.16.12.2, 00:00:03, Serial1/0
C 192.168.49.0/24 is directly connected, Loopback2
C 192.168.70.0/24 is directly connected, Loopback5
C 192.168.48.0/24 is directly connected, Loopback1

As we can see from the R1 route table,192.168.20-40 networks are advertised

Uder OSPF configuration,redistribute RIP routes

R2(config)#router ospf 1
R2(config-router)#redistribute rip subnets
R2(config-router)#default-metric 10000

subnet keyword must be specified,otherwise,RIP only advertised classful routes.

Default metric for all redistributed OSPF routes is 20,setting metric for higher value makes it less preferable to routes redistributed from other routing protocols

R3#sh ip route
Codes: C – connected, S – static, 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
i – IS-IS, su – IS-IS summary, 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

C 192.168.30.0/24 is directly connected, Loopback3
C 192.168.25.0/24 is directly connected, Loopback2
C 192.168.40.0/24 is directly connected, Loopback5
172.16.0.0/24 is subnetted, 2 subnets
C 172.16.23.0 is directly connected, Serial1/1
C 172.16.3.0 is directly connected, Loopback0
C 192.168.20.0/24 is directly connected, Loopback1
C 192.168.35.0/24 is directly connected, Loopback4
O E2 192.168.48.0/24 [110/10000] via 172.16.23.2, 00:00:25, Serial1/1
O E2 192.168.49.0/24 [110/10000] via 172.16.23.2, 00:00:25, Serial1/1
O E2 192.168.50.0/24 [110/10000] via 172.16.23.2, 00:00:25, Serial1/1
O E2 192.168.70.0/24 [110/10000] via 172.16.23.2, 00:00:25, Serial1/1
O E2 192.168.70.0/24 [110/10000] via 172.16.23.2, 00:00:25, Serial1/1

We can see that routes from RIP are advertised as External routes (E2) with metric 10000 (set as default metric).

E2 means default metric.If there are only one ASBR E2 metric can be used.E2 ignores internal metric when calculating route to network.E1,from other side calculate internal metric (metric to the ASBR router in same area),plus cost to reach specific network.Default metric is E2.To change it to E1 type:

R2(config)#router ospf 1
R2(config-router)#redistribute rip subnets metric-type 1

 

For router R3 to reach ASBR (R2),cost will be 64

R3#sh ip ospf border-routers

OSPF Process 1 internal Routing Table

Codes: i - Intra-area route, I - Inter-area route

i 172.16.2.1 [64] via 172.16.23.2, Serial1/1, ASBR, Area 0, SPF 20

C 192.168.30.0/24 is directly connected, Loopback3
C 192.168.25.0/24 is directly connected, Loopback2
C 192.168.40.0/24 is directly connected, Loopback5
172.16.0.0/24 is subnetted, 2 subnets
C 172.16.23.0 is directly connected, Serial1/1
C 172.16.3.0 is directly connected, Loopback0
C 192.168.20.0/24 is directly connected, Loopback1
C 192.168.35.0/24 is directly connected, Loopback4
O E1 192.168.48.0/24 [110/10064] via 172.16.23.2, 00:00:25, Serial1/1
O E1 192.168.49.0/24 [110/10064] via 172.16.23.2, 00:00:25, Serial1/1
O E1 192.168.50.0/24 [110/10064] via 172.16.23.2, 00:00:25, Serial1/1
O E1 192.168.51.0/24 [110/10064] via 172.16.23.2, 00:00:25, Serial1/1
O E1 192.168.70.0/24 [110/10064] via 172.16.23.2, 00:00:25, Serial1/1

Cost is now 10064 (default metric 10000+internal metric 64=10064) and marked as E1

E1 metric is used when there are multiple ASBR’s ,when we want to load-balance between ASBR’s

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

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