I have a home lab setup with three 3640 routers, easily named and connected as "Top", "Left", and "Right". They are connected in a triangle, with the top router on the top and the other two on the bottom. Each router has 2 serial cables connecting it to the other 2 routers, and each router has a loopback configured.
The link on the bottom is RIPv2, and the left side and right side links are running OSPF. I am redistributing from RIP to OSPF on the 2 bottom routers so that the top router can reach the bottom link. Everything is hunky-dory, except that suboptimal routes are being introduced due to OSPF having a lower AD than RIP - so the left router will reach the right router's loopback via the top router - taking a longer path through 2 serial ports because the OSPF route is preferred over the shorter RIP route. Fine - I understand this.
My idea was this - why not configure an access list permitting the RIP routes (the bottom serial link and the bottom two routers' loopbacks), and then apply a distance command of 125 in ospf using that access-list. I read in the CCNP book that this is a good way to prevent suboptimal routes from being installed in the routing table.
What happened, in effect, was this:
before distance command, the top router would reach the left router's loopback via it's serial connection to the left router.
after the distance command, the top router had 2 equal cost paths to the left router's loopback, one via the left router and the other via the right router.
the right router originated an LSA advertising the left router's loopack address via itself when I configured the distance command.
Here are the pertinent details of the routing table:
O E1 172.16.3.0 [110/84] via 172.16.2.2, 00:05:50, Serial1/0
O E1 172.16.3.0 [110/84] via 172.16.6.2, 00:00:20, Serial1/1
[110/84] via 172.16.2.2, 00:00:20, Serial1/0
172.16.2.2 is the left router
172.16.6.2 is the right router with the distance command configured.
Any help would be greatly appreciated. Also any advice on a perhaps better way to avoid suboptimal routes that does not involve originating routes that a router should really not originate.
Cheers and thanks in advance.