Optimizing Route Selection in Multi-Protocol Redistribution Scenarios
To achieve optimal routing after redistribution between RIP and OSPF domains, path selection can be manipulated by modifying route metrics or filtering spceific routes. The goal is to influence the routing table to prefer the most efficient paths.
RIP Domain Optimizaton (R1 Perspective)
Method 1: Adjusting RIP Metrics via Prefix Lists
This method increases the metric (cost) for less desirable paths, making them less preferable. The rip metricin and rip metricout commands are applied on interrfaces.
On router R2, increase the metric for the 34.0.0.0/24 network learned and advertised on GigabitEthernet 0/0/0.
[R2] ip ip-prefix NET_34 permit 34.0.0.0 24
[R2] interface GigabitEthernet 0/0/0
[R2-GigabitEthernet0/0/0] rip metricout ip-prefix NET_34 2
[R2-GigabitEthernet0/0/0] rip metricin ip-prefix NET_34 2
[R2-GigabitEthernet0/0/0] quit
On router R3, apply a similar configuration for the 24.0.0.0/24 network.
[R3] ip ip-prefix NET_24 permit 24.0.0.0 24
[R3] interface GigabitEthernet 0/0/0
[R3-GigabitEthernet0/0/0] rip metricout ip-prefix NET_24 2
[R3-GigabitEthernet0/0/0] rip metricin ip-prefix NET_24 2
[R3-GigabitEthernet0/0/0]
Method 2: Filtering Encoming Routes with a Filter-Policy This method blocks specific subnets from being installed in the RIP routing table on a per-interface basis. A prefix list is used to define the filtering logic. On router R1, block the 34.0.0.0/24 route received on its GigabitEthernet 0/0/0 interface.
[R1] ip ip-prefix ALL permit 0.0.0.0 0 less-equal 32
[R1] ip ip-prefix BLOCK_34 deny 34.0.0.0 24
[R1] rip
[R1-rip-1] filter-policy ip-prefix BLOCK_34 import GigabitEthernet 0/0/0
[R1-rip-1] filter-policy ip-prefix ALL import GigabitEthernet 0/0/0
[R1-rip-1] quit
The order is critical: the specific deny statement must precede the general permit-all statement.
OSPF Domain Optimization (R4 Perspective)
For OSPF, a Route-Policy combined with ACLs provides granular control during the redistribution process from RIP into OSPF.
Configuration on Router R2 Prevent the redistribution of the RIP-learned 13.0.0.0/24 network and R3's loopback (3.3.3.0/24) into OSPF, while permittting all other RIP routes.
[R2] acl number 3000
[R2-acl-adv-3000] rule 5 permit ip source 13.0.0.0 0.0.0.255
[R2-acl-adv-3000] quit
[R2] acl number 3001
[R2-acl-adv-3001] rule 5 permit ip source 3.3.3.0 0.0.0.255
[R2-acl-adv-3001] quit
[R2] route-policy REDIST_FILTER deny node 5
[R2-route-policy] if-match acl 3000
[R2-route-policy] quit
[R2] route-policy REDIST_FILTER deny node 10
[R2-route-policy] if-match acl 3001
[R2-route-policy] quit
[R2] route-policy REDIST_FILTER permit node 15
[R2-route-policy] quit
[R2] ospf 1
[R2-ospf-1] import-route rip route-policy REDIST_FILTER
[R2-ospf-1]
Configuration on Router R3 Similarly, prevent the redistribution of the 12.0.0.0/24 network and R2's loopback (2.2.2.0/24).
[R3] acl number 3000
[R3-acl-adv-3000] rule 5 permit ip source 12.0.0.0 0.0.0.255
[R3-acl-adv-3000] quit
[R3] acl number 3001
[R3-acl-adv-3001] rule 5 permit ip source 2.2.2.0 0.0.0.255
[R3-acl-adv-3001] quit
[R3] route-policy REDIST_FILTER deny node 5
[R3-route-policy] if-match acl 3000
[R3-route-policy] quit
[R3] route-policy REDIST_FILTER deny node 10
[R3-route-policy] if-match acl 3001
[R3-route-policy] quit
[R3] route-policy REDIST_FILTER permit node 15
[R3-route-policy] quit
[R3] ospf 1
[R3-ospf-1] import-route rip route-policy REDIST_FILTER
[R3-ospf-1]
These configurations ensure that each OSPF router only redistributes optimal RIP routes, eliminating suboptimal paths from the OSPF domain's routing table.