Given the below scenario
dexter#show ip eigrp topology all-links
IP-EIGRP Topology Table for AS(1)/ID(192.168.0.200)
Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
r - reply Status, s - sia Status
P 10.10.0.0/16, 1 successors, FD is 310047232, serno 15560
via 172.16.0.13 (310047232/310046976), Vlan1
via 172.17.0.5 (258816/258560), Vlan2
via 172.16.0.15 (2170112/2169856), Vlan1
P 10.8.0.0/13, 1 successors, FD is 258816, serno 10589
via Summary (258816/0), Null0
via 172.17.0.5 (258816/258560), Vlan2
dexter#show ip route 10.10.0.0
Routing entry for 10.10.0.0/16
Known via "eigrp 1", distance 90, metric 310047232, type internal
Redistributing via eigrp 1
Last update from 172.16.0.13 on Vlan1, 00:00:29 ago
Routing Descriptor Blocks:
* 172.16.0.13, from 172.16.0.13, 00:00:29 ago, via Vlan1
Route metric is 310047232, traffic share count is 1
Total delay is 1000110 microseconds, minimum bandwidth is 9 Kbit
Reliability 255/255, minimum MTU 1416 bytes
Loading 1/255, Hops 3
Why is the 172.16.0.13 is installed as the next hop instead of 172.17.0.5, which has less Cost ?
I think i posted the question oo quickly. The AD on the selected route is 90 as compared to less-cost route (through 172.17.0.5), which is 170 (Being distributed into EIGRP by BGP).
However the route with AD=170 is more efficient and I want that to be installed in the routing table as the primary route.
What are the ways I can acheive that ?
It would help to have your post router configs. But here is an example of redistributing and changeing the AD.
Example 1 sets all redistributed distaces to the same in eigrp as internal eigrp AD.
router eigrp xxx
distance eigrp 90 90
Example 2 set all networks matching to ad of 90 in eigrp. You'll have to play around with the second a little bit to get what you want.
router eigrp xxx
distance 90 10.10.10.0 0.0.255.255
The bottom line here is that no matter how good the 'cost' of a route is, the primary parameter that determines the believability of a route is the administrative distance.
The administrative distance of the routes has to be the same for the cost/metric to come into consideration.
Actually, I'll go one step further. Even if you changed the administrative distances so internal and external routes in the same EIGRP process have the same admin distance, the EIGRP process itself is going to prefer the internal route over the external one. The administrative distance of a route only impacts it's installation in the routing table, it doesn't impact the best path decision within the protocol.
It might help to understand the process a little. When routes are received and processed, they are placed in the EIGRP topology table. The list of entries for this destination are walked, and the best metric is chosen. If the best is an internal, all the externals are basically taken out of the picture at this point (ignored). Once the best route is found, the list is sorted by metric, until all the routes with RD's less than the FD are found, and then the rest of the list is left unsorted.
As long as there's an internal route in the table, there's no way an external route will bubble to the top to be installed in the routing table (!). In this case, the administrative distances don't matter.
What you are saying is condradictory to the result output pasted by the asker ?
He seems to be saying that the route selected is internal even though the external route's metric is lower.
You seem to be saying that the externals will not considered at all if there is an internal route in the eigrp topology table.
Could you kindly explain (may be i am not interpretting your explanation right ?? )
It seems to me that Russ's explanation is entirely consistent with the original post. The original post says that there is an external EIGRP route with a lower metric but the internal EIGRP route (with a higher metric) is chosen as the route to use. Russ says that when EIGRP has an external route and an internal route that EIGRP will always use the internal route no matter what the metrics are (the external will not be considered if there is an internal). That is exactly what the original post says is happening. I do not see anything contradictory in this.
"He seems to be saying that the route selected is internal even though the external route's metric is lower."
This is correct, and it's correct behaviour. Internals should always be selected over externals, no matter what their metrics are.
However, I just set this up in the lab, looked through the code, and talked to one of the EIGRP coders--and it doesn't work that way today. Essentially, reversing the admin distances _will_ cause EIGRP to prefer externals over internals, right now. There is actually a defect filed for this--it relies on a quirk in the way EIGRP processes routes that's "always been that way."
But, setting the EIGRP process up so externals are preferred _can_ cause routing loops in many situations, and it's not supported. TAC shouldn't support this configuration, and the DE's won't. Eventually, the EIGRP code will change so changing the admin distance will not impact the sort order of the topology table at all (I originally thought it didn't).
First of all, Thanks to everyone for a very active discussion.
In summary, my situation was
Route Sourced from BGP (so AD=170) is External
Route Sourced from EIGRP (AD = 90) is Internal
Under basic operation the Internal EIGRP will be chosen, since it has a lower AD.
If I understand correctly the discussion, then this basic principal is no longer applicable, if I change the AD (through config commands etc) of the External and make it lower than 90 for that route. Shouldn't the router then select the lower AD route ? (Irrespective of External\Internal source). Isn't that the basic purpose of the AD parameter ?
As a second option, if the change the EIGRP AS number to 2 on the router, that is advertising the less efficient Route then the source of that route should change from Internal-->External and then the Less Cost route should be installed ?
However, it seems pretty strange that the commands are there to change the AD of any route and still the router won't prefer\consider this and instead should always prefer Internal Route (As per Russ) ?
"Under basic operation the Internal EIGRP will be chosen, since it has a lower AD."
The AD is supposed to work between processes, not within a single process. There's a vast difference between the two.
"If I understand correctly the discussion, then this basic principal is no longer applicable, if I change the AD (through config commands etc) of the External and make it lower than 90 for that route. Shouldn't the router then select the lower AD route?"
The way it currently works, changing the admin distance so the external is better than the internal will actually make EIGRP prefer the external over the internal. This is not supported (as in the TAC won't support this, nor, if you find a defect or problem with it, the coders won't accept or fix defects when configuring EIGRP this way (this was what my conversation with the coders centered around today).
"However, it seems pretty strange that the commands are there to change the AD of any route and still the router won't prefer\consider this and instead should always prefer Internal Route...."
This is because the admin distance is designed to determine which process will install a route into the routing table, not to determine the best route within a routing process (which is what the metrics, etc, are for). BGP and EIGRP are the only two protocols that allow you to set the admin distance for internals higher than externals--and it can cause routing loops in both protocols.
Many thanks Russ, for the explanation !
Rick - you are right in that i misinterpreted his explanation :-)
thanks again !
All clear now.