06-25-2014 08:22 AM - edited 03-07-2019 07:50 PM
Hi Floks,
i have basic doubt on metric calculation of the routes in cisco routers.
Please share me if there is any link for reference.
thanks and regards,
Rajesh Kumar V
Solved! Go to Solution.
06-25-2014 11:49 AM
I believe that the prior response has confused metric with Administrative Distance. A static route does have an Administrative Distance and by default it is 1 and can be set to some different value. Metrics are used by dynamic routing protocols. A static route does not have a metric unless it is being redistributed into a dynamic routing protocol and in that case the assignment of metric is dependent on the particular routing protocol (OSPF does it differently from EIGRP which does it differently from RIP).
HTH
Rick
06-25-2014 08:32 AM
Any comments really helpful for me . please share your points.
thanks
Rajeshkumar V
06-26-2014 02:17 AM
Hi Rajesh,
Default route you cannot set it to 0. It can have the metric between 1 to 255.
Please do rate for the helpful posts and mark correct answers
Thanks
Karthik
06-26-2014 03:09 AM
Thanks karthi.
So, Basically we cannot use 0 as metric for directly connected route.
In that case we cannot use 0 as the metric for static route too ?.
I see that many router manufactures use metric 0 (ad=1 metric=0 [1/0]) for static routes and also standard mention that non valid metric is -1 and not 0.
thanks
Rajesh.
06-26-2014 03:37 AM
Directly connected can be considered as 0 always and static route is with 1 as the default and it differs for each routing protocols.
Route Source | Default Distance Values |
---|---|
Connected interface | 0 |
Static route | 1 |
Enhanced Interior Gateway Routing Protocol (EIGRP) summary route | 5 |
External Border Gateway Protocol (BGP) | 20 |
Internal EIGRP | 90 |
IGRP | 100 |
OSPF | 110 |
Intermediate System-to-Intermediate System (IS-IS) | 115 |
Routing Information Protocol (RIP) | 120 |
Exterior Gateway Protocol (EGP) | 140 |
On Demand Routing (ODR) | 160 |
External EIGRP | 170 |
Internal BGP | 200 |
Unknown* | 255 |
06-26-2014 03:54 AM
thanks a lot karthi.
what you said is exactly correct for Administrative Distance (AD).
my doubt is in metric point. can we set 0 as a metric for static route ? if yes , how we are determining.
thanks
Rajesh kuamr V
06-26-2014 04:00 AM
example:
06-26-2014 04:19 AM
I am not sure you can achieve it with static route.... when you redistribute static routes in to dynamic routing protocols you can set a metric for the static route.
But in static route as per my knowledge you cannot do it.
Regards
Karthik
06-26-2014 04:37 AM
thanks karthi.
i will check and update u.
06-25-2014 10:49 AM
1. Default is one. it can be overridden
2.Its not calculated. Dynamic protocols calculate metrics. this is static...therefore no calculation. It can be "set" with a configuration command.
http://www.cisco.com/c/en/us/td/docs/ios-xml/ios/iproute_pi/configuration/12-4/iri-12-4-book.html
06-25-2014 11:49 AM
I believe that the prior response has confused metric with Administrative Distance. A static route does have an Administrative Distance and by default it is 1 and can be set to some different value. Metrics are used by dynamic routing protocols. A static route does not have a metric unless it is being redistributed into a dynamic routing protocol and in that case the assignment of metric is dependent on the particular routing protocol (OSPF does it differently from EIGRP which does it differently from RIP).
HTH
Rick
06-26-2014 12:48 AM
Hi All,
Thanks for sharing.
i have another question.
what was the metric of local route by default. can i set that to 0 ?
please confirm.
05-19-2020 01:52 AM - edited 05-19-2020 01:54 AM
Hello everyone,
What does [1/0] mean for static routes when we give the command show ip route.
I know 1 is the AD value of static route, and 0 is the metric value.
But what does 0 represent here? Is it hop count to next directly connected interface.. how is the 0 metric value calculated and why is it always 0 in [1/0].
If you can explain with a diagram, it would really help. Thanks. :-)
05-19-2020 02:53 AM
Hello @whizkidraj ,
as clearly explained in this thread in Cisco IOS implementation static routes have an admin distance of 1 by default that can be changed when configuring a so called floating static route.
The metric value is never computed in static routing.
The IP routing table daemon provides a 0 for this missing value for static entries because it handles also dynamic routing entries in the form [AD/metric].
In the case of static routes that [1/0] the 0 is just a place holder a value given to a field that is never checked. It cannot be modified by configuration.
To be noted when a static route specifies an outgoing interface instead of an IP next-hop it can have AD 0 like a connected route.
But in evey case the metric value is meaningless when comparing static routes between them or with entries generated by dynamic routing protocols.
The most specific entry is used first then if there is a tie the lowest AD is preferred.
This is correct because each routing protocol has its own way to calculate metric for example in RIP a metric of 16 is infinite . OSPF intra area routes are 16 bit unsigned integer ( up to 65,535) OSPF inter area are 24 bit values. EIGRP metric was 32 bit in classic EIGRP. In last EIGRP implementation (the named EIGRP ) the metric is 64 bit integer and needs a scaling factor to be reported in the routing table as the routing table metric field is 32 bit wide.
Hope to help
Giuseppe
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