02-25-2014 01:31 AM - edited 03-04-2019 10:26 PM
Hi
If we define two default routes in a router, which route it prefers. Please clarify.
Thanks & Regards,
Naveen
02-25-2014 01:52 AM
Hi Naveen,
If you configure them as static routes with the same administrative distance, they both will be placed into the routing table, e.g.:
ip route 0.0.0.0 0.0.0.0 192.0.2.1
ip route 0.0.0.0 0.0.0.0 223.255.255.2
will result into:
Router# show ip route static
S* 0.0.0.0/0 [1/0] via 223.255.255.2
[1/0] via 192.0.2.1
In this case, the router will use them both and will do load-sharing.
If any of these routes had a lower administrative distance, it would be preferred and it would be the only one installed into the routing table. This also goes for default routes learned from routing protocols: the protocol with the lowest administrative distance wins. And of course, a static default route having the administrative distance of 1 always wins over any dynamically learned default route because dynamic routing protocols have their administrative distance higher than 1.
Best regards,
Peter
02-25-2014 07:13 PM
Hi Peter,
Thanks for the clarification.
If the static routes were redistributed under dynamic routing protocol and from here if one default route is redisributed with OSPF and one with EIGRP.
Will it prefer the defaukt route learned via EIGRP ?
02-25-2014 08:51 PM
Naveen,
Will it prefer the defaukt route learned via EIGRP ?
In fact, no, it will prefer the default route via OSPF. Because the default route will be redistributed into EIGRP, its administrative distance will be 170. OSPF has the same administrative distance of 110 for intra-area, inter-area and external routes. So if the default route is being learned both by OSPF and EIGRP, OSPF will win.
To be very precise, you can not redistribute a default route into OSPF. You can redistribute any other route (i.e. any other prefix) but the only way to make OSPF inject a default route is to use the default-information originate command. Cisco's OSPF implementation internally skipa the default route when redistributing routes to avoid potential problems if the default route is redistributed unintentionally.
Best regards,
Peter
02-25-2014 02:00 AM
Hi Naveen,
This will do a per session load-balancing (unique source/destination address) and then the traffic will flow nearly 50% on both links.
More details on the load balancing can be found on below link
http://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/5212-46.html
Hope that helps.
Regards
Najaf
Please rate when applicable or helpful !!!
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide