So, lets talk about how can we change the cost while distribution between routing protocols. Distribution between two routing domains should be done very carfully. It is easy when the there is single distribution router between the two domains. Things get slightly complicated when distributing between two domains and two routers. While extra efforts should be done when there are multiple domains with multipe routers. The image below shows these domains and routers.
When we have single router, it will apply the “split-Horizon” rule by itself. Which stats don’t redistirbute a route into the same domain learned from. For example, if the router learned a route x.x.x.x through RIP, it will distribute it into OSPF. When distributing OSPF routes into RIP, the router will filter the x.x.x.x router cause it was learned through RIP orginally.
Given that, most realistic scenarios would have multpile routers, so changing the cost of routes will be a trick that should be mastered. Lets redistribute from OSPF the route 220.127.116.11 into RIP. First we would need to learn the OSPF database.
R1(config-router)#do show ip os dataOSPF Router with ID (18.104.22.168) (Process ID 1)Router Link States (Area 0)Link ID ADV Router Age Seq# Checksum Link count22.214.171.124 126.96.36.199 1408 0x80000004 0x000989 2188.8.131.52 184.108.40.206 922 0x80000004 0x00D254 2220.127.116.11 18.104.22.168 1155 0x80000008 0x008C67 5Type-5 AS External Link StatesLink ID ADV Router Age Seq# Checksum Tag22.214.171.124 126.96.36.199 706 0x80000001 0x000F2B 0188.8.131.52 184.108.40.206 922 0x80000001 0x00DD79 0220.127.116.11 18.104.22.168 922 0x80000001 0x008997 022.214.171.124 126.96.36.199 922 0x80000001 0x0021B0 0
distance metric router access-list (RIP and EIGRP would use the neigbour IP, and OSPF would use Router-ID). for our example, to make our redistributed route into rip to be more disatractive than the origianl RIP (AD of 120)
router ospf 1distance 121 188.8.131.52 0.0.0.0 10