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 126.96.36.199 into RIP. First we would need to learn the OSPF database.
R1(config-router)#do show ip os dataOSPF Router with ID (188.8.131.52) (Process ID 1)Router Link States (Area 0)Link ID ADV Router Age Seq# Checksum Link count184.108.40.206 220.127.116.11 1408 0×80000004 0×000989 218.104.22.168 22.214.171.124 922 0×80000004 0x00D254 2126.96.36.199 188.8.131.52 1155 0×80000008 0x008C67 5Type-5 AS External Link StatesLink ID ADV Router Age Seq# Checksum Tag184.108.40.206 220.127.116.11 706 0×80000001 0x000F2B 018.104.22.168 22.214.171.124 922 0×80000001 0x00DD79 0126.96.36.199 188.8.131.52 922 0×80000001 0×008997 0184.108.40.206 220.127.116.11 922 0×80000001 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 18.104.22.168 0.0.0.0 10