Saturday, April 27, 2013

Redistribution between 3 IGPs issue.

After passing my CCNP R&S from time to time I read old BSCI materials and do labs to repeat some materials or cover blank areas. Recently I encountered strange behavior when tried redistribution between 3 IGPs.
The topology is as following:
Let's start with basic configuration:
R1:
interface Loopback0
 ip address 172.16.1.1 255.255.255.0
 ip ospf network point-to-point
!
interface FastEthernet0/0
 ip address 10.0.13.1 255.255.255.0
!
interface FastEthernet0/1
 ip address 10.0.12.1 255.255.255.0
!
interface FastEthernet1/0
 ip address 20.0.14.1 255.255.255.0
!
router eigrp 1
 network 10.0.13.0 0.0.0.255
 no auto-summary
!
router ospf 1
 network 10.0.12.0 0.0.0.255 area 0
 network 172.16.1.0 0.0.0.255 area 0
!
router rip
 version 2
 network 20.0.0.0
 no auto-summary


R2:
interface Loopback0
 ip address 172.16.2.2 255.255.255.0
 ip ospf network point-to-point
!
interface FastEthernet0/1
 ip address 10.0.12.2 255.255.255.0
!
router ospf 1
 network 10.0.12.0 0.0.0.255 area 0
 network 172.16.2.0 0.0.0.255 area 0


R3:
interface Loopback0
 ip address 172.16.3.3 255.255.255.0
!
interface FastEthernet0/0
 ip address 10.0.13.3 255.255.255.0
 duplex auto
 speed auto
!
router eigrp 1
 network 10.0.13.0 0.0.0.255
 network 172.16.3.0 0.0.0.255
 no auto-summary


R4:
interface Loopback0
 ip address 172.16.4.4 255.255.255.0
!
interface FastEthernet1/0
 ip address 20.0.14.4 255.255.255.0
!
router rip
 version 2
 network 20.0.0.0
 network 172.16.0.0
 no auto-summary


At this moment everything is working as expected - R1 receives all the routes from all IGPs:
R1#show ip route
     20.0.0.0/24 is subnetted, 1 subnets
C       20.0.14.0 is directly connected, FastEthernet1/0
     172.16.0.0/24 is subnetted, 4 subnets
R       172.16.4.0 [120/1] via 20.0.14.4, 00:00:08, FastEthernet1/0
C       172.16.1.0 is directly connected, Loopback0
O       172.16.2.0 [110/11] via 10.0.12.2, 00:40:36, FastEthernet0/1
D       172.16.3.0 [90/409600] via 10.0.13.3, 00:22:40, FastEthernet0/0
     10.0.0.0/24 is subnetted, 2 subnets
C       10.0.12.0 is directly connected, FastEthernet0/1
C       10.0.13.0 is directly connected, FastEthernet0/0


The main task is to check how works redistribution from EIGRP into OSPF and then from OSPF into RIP. Something like (EIGRP->OSPF)->RIP. I won't bother myself with mutual redistribution, only one-way:
R1:
router ospf 1
 log-adjacency-changes
 redistribute eigrp 1 subnets
 network 10.0.12.0 0.0.0.255 area 0
 network 172.16.1.0 0.0.0.255 area 0
!
router rip
 version 2
 redistribute ospf 1 metric 10
 network 20.0.0.0
 no auto-summary


In theory, on R4 I should receive all prefixes, nevertheless R4 receives only OSPF prefixes, not EIGRP:
R4#show ip route
     20.0.0.0/24 is subnetted, 1 subnets
C       20.0.14.0 is directly connected, FastEthernet1/0
     172.16.0.0/24 is subnetted, 3 subnets
C       172.16.4.0 is directly connected, Loopback0
R       172.16.1.0 [120/10] via 20.0.14.1, 00:00:10, FastEthernet1/0
R       172.16.2.0 [120/10] via 20.0.14.1, 00:00:10, FastEthernet1/0
     10.0.0.0/24 is subnetted, 1 subnets
R       10.0.12.0 [120/10] via 20.0.14.1, 00:00:11, FastEthernet1/0


Which is pretty surprising because R1 has these prefixes in the OSPF database:
R1#show ip ospf database | begin Type-5
                Type-5 AS External Link States
Link ID         ADV Router      Age         Seq#       Checksum Tag
10.0.13.0       172.16.1.1      195         0x80000001 0x003694 0
172.16.3.0      172.16.1.1      195         0x80000001 0x00A180 0


But it is not advertising them to R4:
R1#debug ip rip
RIP protocol debugging is on
R1#
*Mar  1 01:04:31.991: RIP: sending v2 update to 224.0.0.9 via FastEthernet1/0 (20.0.14.1)
*Mar  1 01:04:31.991: RIP: build update entries
*Mar  1 01:04:31.991:   10.0.12.0/24 via 0.0.0.0, metric 10, tag 0
*Mar  1 01:04:31.995:   172.16.1.0/24 via 0.0.0.0, metric 10, tag 0
*Mar  1 01:04:31.995:   172.16.2.0/24 via 0.0.0.0, metric 10, tag 0




Nor it has them in the RIP database:
R1#show ip rip database
10.0.0.0/8    auto-summary
10.0.12.0/24    redistributed
    [10] via 0.0.0.0,
20.0.0.0/8    auto-summary
20.0.14.0/24    directly connected, FastEthernet1/0
172.16.0.0/16    auto-summary
172.16.1.0/24    redistributed
    [10] via 0.0.0.0,
172.16.2.0/24    redistributed
    [10] via 10.0.12.2,
172.16.4.0/24
    [1] via 20.0.14.4, 00:00:22, FastEthernet1/0



The only way to solve it is redistribution EIGRP directly into RIP:
R1:
router rip
 version 2
 redistribute ospf 1 metric 10
 redistribute eigrp 1 metric 9
 network 20.0.0.0
 no auto-summary


And now these prefixes are there:
R4#show ip route
     20.0.0.0/24 is subnetted, 1 subnets
C       20.0.14.0 is directly connected, FastEthernet1/0
     172.16.0.0/24 is subnetted, 4 subnets
C       172.16.4.0 is directly connected, Loopback0
R       172.16.1.0 [120/10] via 20.0.14.1, 00:00:23, FastEthernet1/0
R       172.16.2.0 [120/10] via 20.0.14.1, 00:00:23, FastEthernet1/0
R       172.16.3.0 [120/9] via 20.0.14.1, 00:00:23, FastEthernet1/0
     10.0.0.0/24 is subnetted, 2 subnets
R       10.0.12.0 [120/10] via 20.0.14.1, 00:00:24, FastEthernet1/0
R       10.0.13.0 [120/9] via 20.0.14.1, 00:00:24, FastEthernet1/
0


The same behavior occurs when I change the redistribution order. For example (RIP->EIGRP)->OSPF:
R1:
router eigrp 1
 redistribute rip metric 1500 100 255 1 1500
 network 10.0.13.0 0.0.0.255
 no auto-summary
!
router ospf 1
 log-adjacency-changes
 redistribute eigrp 1 subnets
 network 10.0.12.0 0.0.0.255 area 0
 network 172.16.1.0 0.0.0.255 area 0

R2#show ip route
     172.16.0.0/24 is subnetted, 3 subnets
O       172.16.1.0 [110/11] via 10.0.12.1, 01:03:05, FastEthernet0/1
C       172.16.2.0 is directly connected, Loopback0
O E2    172.16.3.0 [110/20] via 10.0.12.1, 00:00:32, FastEthernet0/1
     10.0.0.0/24 is subnetted, 2 subnets
C       10.0.12.0 is directly connected, FastEthernet0/1
O E2    10.0.13.0 [110/20] via 10.0.12.1, 00:00:32, FastEthernet0/1


But at this time R1 doesn't have these prefixes in the OSPF database:
R1#show ip ospf database | b Type-5
                Type-5 AS External Link States
Link ID         ADV Router      Age         Seq#       Checksum Tag
10.0.13.0       172.16.1.1      272         0x80000001 0x003694 0
172.16.3.0      172.16.1.1      272         0x80000001 0x00A180 0


Only in the EIGRP topology table:
R1#show ip eigrp topology
IP-EIGRP Topology Table for AS(1)/ID(172.16.1.1)
Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
       r - reply Status, s - sia Status

P 10.0.13.0/24, 1 successors, FD is 281600
        via Connected, FastEthernet0/0
P 20.0.14.0/24, 1 successors, FD is 1732096
        via Redistributed (1732096/0)
P 172.16.4.0/24, 1 successors, FD is 1732096
        via Redistributed (1732096/0)
P 172.16.3.0/24, 1 successors, FD is 409600
        via 10.0.13.3 (409600/128256), FastEthernet0/0




UPD.: the same is true for IPv6 IGP redistribution.

UPD2.: I checked this in the Huawei environment (with IS-IS instead of EIGRP), the result is the same:
R1:
isis 1
 is-level level-2
 cost-style wide
 network-entity 49.0001.7201.6001.0001.00
 is-name R1
#
ospf 1
 import-route isis 1 cost 1000
 area 0.0.0.0
  network 172.16.1.0 0.0.0.255
  network 10.0.12.0 0.0.0.255
#
rip 1
 undo summary
 version 2
 network 20.0.0.0
 import-route ospf 1 cost 10


[R4]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 9        Routes : 9       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

      10.0.12.0/24  RIP     100  11          D   20.0.14.1       GigabitEthernet0/0/2
      20.0.14.0/24  Direct  0    0           D   20.0.14.4       GigabitEthernet0/0/2
      20.0.14.4/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/2
      127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0
      127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0
     172.16.1.0/24  RIP     100  11          D   20.0.14.1       GigabitEthernet0/0/2
     172.16.2.2/32  RIP     100  11          D   20.0.14.1       GigabitEthernet0/0/2
     172.16.4.0/24  Direct  0    0           D   172.16.4.4      LoopBack0
     172.16.4.4/32  Direct  0    0           D   127.0.0.1       LoopBack0


UPD3.: Finally, I came to conclusion regarding this issue. The main requirement for a redistributed prefix to be announced to a neighbor is that it has to be presented in the routing table. But it is not the only requirement. Besides being in the routing table this prefix have to be learned by the routing process which is redistributing it.
In the example above it means that EIGRP prefixes that are redistributed into OSPF have to be in the routing table of R1 with IGP code O (for OSPF) to be presented in the RIP updates to R4.

No comments:

Post a Comment