What will the router choose, better route or AD?

cisco_kiddcisco_kidd Member Posts: 64 ■■□□□□□□□□
Hey guys,

Confused about one thing, if I had a router configured with OSPF and EIGRP, and a destination route on EIGRP with a /24, however a better route over a /30 via OSPF, which would the router choose? Does the router choose the better route regardless of Administrative distance or does it choose the lower AD?

Comments

  • deth1kdeth1k Member Posts: 312
    Longest match always wins
  • cisco_kiddcisco_kidd Member Posts: 64 ■■□□□□□□□□
    deth1k wrote: »
    Longest match always wins

    Thanks deth1k,

    So you're saying:
    • EIGRP (internal): 192.168.32.0/26
    • RIP: 192.168.32.0/29
    • OSPF: 192.168.32.0/19

      RIP would be the most preferred route?
  • pham0329pham0329 Member Posts: 556
    Yes.

    Suppose you have a connected route to 192.168.0.0/24, and a RIP route to 192.168.0.128/25. If a packet comes in for 192.168.0.129, it will be routed via the RIP, even though the connected route has an AD of 0.
  • Forsaken_GAForsaken_GA Member Posts: 4,024
    cisco_kidd wrote: »
    Thanks deth1k,

    So you're saying:
    • EIGRP (internal): 192.168.32.0/26
    • RIP: 192.168.32.0/29
    • OSPF: 192.168.32.0/19

      RIP would be the most preferred route?

    RIght. All three routes would be installed in the routing table, since they're different prefix lenghts. AD is only used when prefix lengths are the same.
  • pham0329pham0329 Member Posts: 556
    RIght. All three routes would be installed in the routing table, since they're different prefix lenghts. AD is only used when prefix lengths are the same.

    and it's from different sources! If it's from the same source/routing protocol, the metric will be used to determine the route.
  • cisco_kiddcisco_kidd Member Posts: 64 ■■□□□□□□□□
    Excellent, thanks for the clarification!! Longest match always wins, need to remember that.
  • johnwest43johnwest43 Member Posts: 294
    Just remember that the order in which you see information in the routing table is the order in which the router uses to decide which route is preferred.
    1: Subnet mask, most specific wins.
    2: AD, used if subnet mask is equal on two or more routes
    3:Metric, used if route is learned from 2 or more routers using the same routing protocol.

    Subnet Mask----AD-- Metric
    D 10.0.0.64/30 [90 / 130816] via 10.0.0.34,
    CCNP: ROUTE B][COLOR=#ff0000]x[/COLOR][/B , SWITCH B][COLOR=#ff0000]x[/COLOR][/B, TSHOOT [X ] Completed on 2/18/2014
  • cisco_troopercisco_trooper Member Posts: 1,441 ■■■■□□□□□□
    Yep, the most specific route will always win. AD won't matter unless the routes have the same subnet mask.

    johnwest summed it up pretty well.
Sign In or Register to comment.