default route administrative distance?

jbkmjbkm Member Posts: 55 ■■□□□□□□□□
The first thing a router checks to determine which route to use is the administrative distance of the route right? So static route (ad = 1) would always be used before a routing protocol right?

Right now im studying up on default routing and understand that the default route is used when the route is not matched by any other entry in the routing table. looking at the routing tables in the book (cisco press) i see that the default route is designated by an *. Looking over i notice that the brackets indicate an administrative distance of 1 (or 0 if interface is used instead of next hop ip). So why would the router not check the default route first (lowest AD) and see that EVERY route matches the wildcard and use that route? why would it ever use any of the other routes with the higher AD's?

i hope you understand the questions here. it seems a bit wordy to me!

Thanks

John

Comments

  • Danman32Danman32 Member Posts: 1,243
    Because the software knows this is a default route, and is programmed to use it as a last resort.
  • jbkmjbkm Member Posts: 55 ■■□□□□□□□□
    so the software see's that its the default and ignores it untill after all other routes have been checked.

    Thanks for the quick responce!

    John
  • Danman32Danman32 Member Posts: 1,243
    Also consider that default routes can also come from routing protocols.

    I also seem to recall that specificity of routes also determine their order.
    In other words, a route specifying a direction to a host will be used first before a route to a network if the two were to otherwise conflict. A default route has a very broad definition, so it is put at the bottom (last).
  • jbkmjbkm Member Posts: 55 ■■□□□□□□□□
    you use ip default-network xxx.xxx.xxx.xxx instead of a "static with wildcard" to have it advertised by a protocol. So if a router has the default-network advertised via RIP then it would be * but also an AD of 120....
  • dmafteidmaftei Member Posts: 83 ■■□□□□□□□□
    jbkm wrote:
    The first thing a router checks to determine which route to use is the administrative distance of the route right?
    No, the administrative distance plays no role in forwarding (that's what you're asking, right?) When a router needs to forward a packet, it looks up the "best" route in the routing table. "Best" means the matching route with the longest prefix. An example might help. Say your router needs to forward a packet to 192.168.1.1, and the routing table has these entries:
    192.168.2.0/28 ...
    192.168.1.0/24 ...
    192.168.1.0/26 ...
    The router will choose 192.168.1.0/26, because of its longer prefix. It will not choose 192.168.2.0/28 because it's not matching (although it has a longer prefix).

    The administrative distance is used to decide what to install in the routing table when multiple protocols have identical routes. In other words, if RIP has a route to 192.168.1.0/24, and OSPF has a route to 192.168.1.0/24, your routing table will have the OSPF route, because the OSPF's AD is less than RIP's AD.
    BSEE, MSCS
    www.maftei.net
  • marlon23marlon23 Member Posts: 164 ■■□□□□□□□□
    woohooo, dont forget how classless and classfull routing affect usage of default route!
    LAB: 7609-S, 7606-S, 10008, 2x 7301, 7204, 7201 + bunch of ISRs & CAT switches
Sign In or Register to comment.