Optimizing Multi-Protocol Route Redistribution in HCIP Environments

Topology and Initial Problem Statement

Consider a scenario where router R2 originates a loopback network (2.0 segment) and advertises it via RIP. Because R4 also runs RIP, it learns the 2.0 prefix through that protocol. R2 then performs mutual redistribution between RIP and OSPF, injecting RIP routes into OSPF. The 2.0 prefix now reaches R4 via OSPF as well—specifically as a Type-5 LSA with a default preference of 150, which is higher (less preferred) than RIP's default of 100. Consequently, R4 discards the OSPF route in favor of the RIP-learned route and updates its forwarding path through R3 to reach R2’s loopback. If R4 subsequently redistributes OSPF into RIP, the 2.0 prefix re-enters the RIP domain with a cleared metric. R1 then sees two equal-cost paths toward 2.0—one through R2 and another through R4—creating suboptimal routing and potential loops. This phenomenon is known as route feedback.

Basic Infrastructure Setup

IP Addressing and Loopbacks

Configure interfaces and loopback addresses on all four routers as outlined below.

R1

<Huawei>system-view
[Huawei]sysname AR1
[AR1]interface g0/0/0
[AR1-GigabitEthernet0/0/0]ip address 12.1.1.1 24
[AR1-GigabitEthernet0/0/0]quit
[AR1]interface g0/0/1
[AR1-GigabitEthernet0/0/1]ip address 13.1.1.1 24
[AR1-GigabitEthernet0/0/1]quit
[AR1]interface LoopBack 0
[AR1-LoopBack0]ip address 1.1.1.1 32
[AR1-LoopBack0]quit

R2

<Huawei>system-view
[Huawei]sysname AR2
[AR2]interface LoopBack 0
[AR2-LoopBack0]ip address 2.2.2.2 32
[AR2-LoopBack0]quit
[AR2]interface g0/0/0
[AR2-GigabitEthernet0/0/0]ip address 12.1.1.2 24
[AR2-GigabitEthernet0/0/0]quit
[AR2]interface g0/0/1
[AR2-GigabitEthernet0/0/1]ip address 24.1.1.1 24
[AR2-GigabitEthernet0/0/1]quit

R3

<Huawei>system-view
[Huawei]sysname AR3
[AR3]interface LoopBack 0
[AR3-LoopBack0]ip address 3.3.3.3 32
[AR3-LoopBack0]quit
[AR3]interface g0/0/1
[AR3-GigabitEthernet0/0/1]ip address 13.1.1.2 24
[AR3-GigabitEthernet0/0/1]quit
[AR3]interface g0/0/0
[AR3-GigabitEthernet0/0/0]ip address 34.1.1.1 24
[AR3-GigabitEthernet0/0/0]quit

R4

<Huawei>system-view
[Huawei]sysname AR4
[AR4]interface LoopBack 0
[AR4-LoopBack0]ip address 4.4.4.4 32
[AR4-LoopBack0]quit
[AR4]interface g0/0/0
[AR4-GigabitEthernet0/0/0]ip address 24.1.1.2 24
[AR4-GigabitEthernet0/0/0]quit
[AR4]interface g0/0/1
[AR4-GigabitEthernet0/0/1]ip address 34.1.1.2 24
[AR4-GigabitEthernet0/0/1]quit

Enabling RIP and OSPF

Deploy RIPv2 and single-area OSPF on relevant interfaces and loopbacks.

R1

[R1]rip 1
[R1-rip-1]version 2
[R1-rip-1]network 12.0.0.0
[R1-rip-1]network 1.0.0.0
[R1-rip-1]quit

R2

[R2]rip 1
[R2-rip-1]version 2
[R2-rip-1]network 12.0.0.0
[R2-rip-1]network 2.0.0.0
[R2-rip-1]quit
[R2]ospf 1 router-id 2.2.2.2
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 24.1.1.0 0.0.0.255
[R2-ospf-1-area-0.0.0.0]quit
[R2-ospf-1]quit

R3

[R3]ospf 1 router-id 3.3.3.3
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]network 34.1.1.0 0.0.0.255
[R3-ospf-1-area-0.0.0.0]quit
[R3-ospf-1]quit
[R3]rip 1
[R3-rip-1]version 2
[R3-rip-1]network 13.0.0.0
[R3-rip-1]network 3.0.0.0
[R3-rip-1]quit

R4

[R4]ospf 1 router-id 4.4.4.4
[R4-ospf-1]area 0
[R4-ospf-1-area-0.0.0.0]network 24.1.1.0 0.0.0.255
[R4-ospf-1-area-0.0.0.0]network 34.1.1.0 0.0.0.255
[R4-ospf-1-area-0.0.0.0]network 4.4.4.4 0.0.0.0
[R4-ospf-1-area-0.0.0.0]quit
[R4-ospf-1]quit
[R4]rip 1
[R4-rip-1]version 2
[R4-rip-1]network 24.0.0.0
[R4-rip-1]quit

Mutual Redistribution Configuration

AR2

<AR2>system-view
[AR2]rip 1
[AR2-rip-1]import-route ospf 1
[AR2-rip-1]quit
[AR2]ospf 1
[AR2-ospf-1]import-route rip 1
[AR2-ospf-1]quit

AR3

<AR3>system-view
[AR3]ospf 1
[AR3-ospf-1]import-route rip 1
[AR3-ospf-1]quit
[AR3]rip 1
[AR3-rip-1]import-route ospf 1
[AR3-rip-1]quit

Optimizing the Routing Table on AR1

After redistribution, AR1 enstalls multiple next-hops for prefixes such as 24.1.1.0/24 and 34.1.1.0. To enforce a single preferred path, we adjust incoming RIP metrics and apply prefix-based filtering.

AR1

[AR1]acl 2000
[AR1-acl-basic-2000]rule permit source 3.3.3.3 0
[AR1-acl-basic-2000]quit
[AR1]interface g0/0/0
[AR1-GigabitEthernet0/0/0]rip metricin 2000 4
[AR1-GigabitEthernet0/0/0]quit
[AR1]ip ip-prefix by deny 24.1.1.0 24
[AR1]ip ip-prefix by permit 0.0.0.0 0 less-equal 32
[AR1]rip 1
[AR1-rip-1]filter-policy ip-prefix by import g0/0/1
[AR1-rip-1]quit

Additionally, AR2 uses a route-policy to block the advertisement of the 34.1.1.0/24 prefix into RIP.

AR2

[AR2]ip ip-prefix yb permit 34.1.1.0 24
[AR2]route-policy aaa deny node 10
[AR2-route-policy]if-match ip-prefix yb
[AR2-route-policy]quit
[AR2]route-policy aaa permit node 20
[AR2-route-policy]quit
[AR2]rip 1
[AR2-rip-1]import-route ospf 1 route-policy aaa
[AR2-rip-1]quit

Refining Path Selection on AR4

AR4 may see duplicate paths toward 12.1.1.1 and 13.1.1.1. Use a route-policy on AR3 to tag the 12.1.1.0/24 prefix and manipulate its OSPF cost. AR4 then filters incoming LSAs by tag.

AR3

[AR3]ip ip-prefix byby permit 2.2.2.2 32
[AR3]route-policy ybyb permit node 11
[AR3-route-policy]if-match ip-prefix byby
[AR3-route-policy]apply cost 6
[AR3-route-policy]quit
[AR3]route-policy ybyb permit node 20
[AR3-route-policy]quit
[AR3]ospf 1
[AR3-ospf-1]import-route rip 1 route-policy ybyb
[AR3-ospf-1]quit

[AR3]ip ip-prefix aa permit 12.1.1.0 24
[AR3]route-policy bb permit node 10
[AR3-route-policy]if-match ip-prefix aa
[AR3-route-policy]apply tag 5
[AR3-route-policy]quit
[AR3]route-policy bb permit node 20
[AR3-route-policy]quit
[AR3]ospf 1
[AR3-ospf-1]import-route rip 1 route-policy bb
[AR3-ospf-1]quit

AR4

<AR4>system-view
[AR4]route-policy nn deny node 10
[AR4-route-policy]if-match tag 5
[AR4-route-policy]quit
[AR4]route-policy nn permit node 20
[AR4-route-policy]quit
[AR4]ospf 1
[AR4-ospf-1]filter-policy route-policy nn import
[AR4-ospf-1]quit

These measures eliminate redundant next-hops, restore optimal forwarding, and prevent route feedback loops caused by bidirectional redistribution.

Tags: HCIP Redistribution OSPF RIP Route Policy

Posted on Sat, 31 Oct 2026 16:52:30 +0000 by JAY6390